remove C++ init_priority attribute

This commit is contained in:
YamaArashi
2016-04-29 05:46:43 -07:00
parent fb026be50e
commit 47d4861fb7
2 changed files with 1 additions and 68 deletions

View File

@@ -46,8 +46,7 @@ int skip_evaluation;
enum attrs {A_PACKED, A_NOCOMMON, A_COMMON, A_NORETURN, A_CONST, A_T_UNION,
A_NO_CHECK_MEMORY_USAGE, A_NO_INSTRUMENT_FUNCTION,
A_CONSTRUCTOR, A_DESTRUCTOR, A_MODE, A_SECTION, A_ALIGNED,
A_UNUSED, A_WEAK, A_ALIAS,
A_INIT_PRIORITY};
A_UNUSED, A_WEAK, A_ALIAS};
static void declare_hidden_char_array (char *, char *);
static void add_attribute (enum attrs, char *,
@@ -79,12 +78,6 @@ static int if_stack_pointer = 0;
/* Generate RTL for the start of an if-then, and record the start of it
for ambiguous else detection. */
/* A list of objects which have constructors or destructors which
reside in the global scope, and have an init_priority attribute
associated with them. The decl is stored in the TREE_VALUE slot
and the priority number is stored in the TREE_PURPOSE slot. */
tree static_aggregates_initp;
void
c_expand_start_cond (cond, exitflag, compstmt_count)
tree cond;
@@ -376,7 +369,6 @@ init_attributes ()
add_attribute (A_ALIGNED, "aligned", 0, 1, 0);
add_attribute (A_WEAK, "weak", 0, 0, 1);
add_attribute (A_ALIAS, "alias", 1, 1, 1);
add_attribute (A_INIT_PRIORITY, "init_priority", 0, 1, 0);
add_attribute (A_NO_INSTRUMENT_FUNCTION, "no_instrument_function", 0, 0, 1);
add_attribute (A_NO_CHECK_MEMORY_USAGE, "no_check_memory_usage", 0, 0, 1);
}
@@ -687,59 +679,6 @@ decl_attributes (node, attributes, prefix_attributes)
DECL_NO_CHECK_MEMORY_USAGE (decl) = 1;
break;
case A_INIT_PRIORITY:
{
tree initp_expr = (args ? TREE_VALUE (args): NULL_TREE);
int pri;
if (initp_expr)
STRIP_NOPS (initp_expr);
if (!initp_expr || TREE_CODE (initp_expr) != INTEGER_CST)
{
error ("requested init_priority is not an integer constant");
continue;
}
pri = TREE_INT_CST_LOW (initp_expr);
while (TREE_CODE (type) == ARRAY_TYPE)
type = TREE_TYPE (type);
if (is_type || TREE_CODE (decl) != VAR_DECL
|| ! TREE_STATIC (decl)
|| DECL_EXTERNAL (decl)
|| (TREE_CODE (type) != RECORD_TYPE
&& TREE_CODE (type) != UNION_TYPE)
/* Static objects in functions are initialized the
first time control passes through that
function. This is not precise enough to pin down an
init_priority value, so don't allow it. */
|| current_function_decl)
{
error ("can only use init_priority attribute on file-scope definitions of objects of class type");
continue;
}
if (pri > MAX_INIT_PRIORITY || pri <= 0)
{
error ("requested init_priority is out of range");
continue;
}
/* Check for init_priorities that are reserved for
language and runtime support implementations.*/
if (pri <= MAX_RESERVED_INIT_PRIORITY)
{
warning
("requested init_priority is reserved for internal use");
}
static_aggregates_initp
= perm_tree_cons (initp_expr, decl, static_aggregates_initp);
break;
}
case A_NO_INSTRUMENT_FUNCTION:
if (TREE_CODE (decl) != FUNCTION_DECL)
{

View File

@@ -1160,12 +1160,6 @@ struct tree_type
do not allocate storage, and refer to a definition elsewhere. */
#define DECL_EXTERNAL(NODE) (DECL_CHECK (NODE)->decl.external_flag)
/* In a VAR_DECL for a RECORD_TYPE, sets number for non-init_priority
initializatons. */
#define DEFAULT_INIT_PRIORITY 65535
#define MAX_INIT_PRIORITY 65535
#define MAX_RESERVED_INIT_PRIORITY 100
/* In a TYPE_DECL
nonzero means the detail info about this type is not dumped into stabs.
Instead it will generate cross reference ('x') of names.