#include "c-pragma.h"
#include "rtl.h"
#include "ggc.h"
-#include "varray.h"
#include "expr.h"
#include "c-common.h"
#include "tm_p.h"
int flag_isoc94;
-/* Nonzero means use the ISO C99 dialect of C. */
+/* Nonzero means use the ISO C99 (or C1X) dialect of C. */
int flag_isoc99;
+/* Nonzero means use the ISO C1X dialect of C. */
+
+int flag_isoc1x;
+
/* Nonzero means that we have builtin functions, and main is an int. */
int flag_hosted = 1;
int flag_pretty_templates = 1;
-/* Nonzero means warn about implicit declarations. */
-
-int warn_implicit = 1;
-
/* Maximum template instantiation depth. This limit exists to limit the
time it takes to notice infinite template instantiations; the default
value of 1024 is likely to be in the next C++ standard. */
{ "mutable", RID_MUTABLE, D_CXXONLY | D_CXXWARN },
{ "namespace", RID_NAMESPACE, D_CXXONLY | D_CXXWARN },
{ "new", RID_NEW, D_CXXONLY | D_CXXWARN },
+ { "nullptr", RID_NULLPTR, D_CXXONLY | D_CXX0X | D_CXXWARN },
{ "operator", RID_OPERATOR, D_CXXONLY | D_CXXWARN },
{ "private", RID_PRIVATE, D_CXX_OBJC | D_CXXWARN },
{ "protected", RID_PROTECTED, D_CXX_OBJC | D_CXXWARN },
TYPE_UNSIGNED (sizetype)), intop);
/* Replace the integer argument with a suitable product by the object size.
- Do this multiplication as signed, then convert to the appropriate
- type for the pointer operation. */
- intop = convert (sizetype,
- build_binary_op (loc,
- MULT_EXPR, intop,
- convert (TREE_TYPE (intop), size_exp), 1));
+ Do this multiplication as signed, then convert to the appropriate type
+ for the pointer operation and disregard an overflow that occured only
+ because of the sign-extension change in the latter conversion. */
+ {
+ tree t = build_binary_op (loc,
+ MULT_EXPR, intop,
+ convert (TREE_TYPE (intop), size_exp), 1);
+ intop = convert (sizetype, t);
+ if (TREE_OVERFLOW_P (intop) && !TREE_OVERFLOW (t))
+ intop = build_int_cst_wide (TREE_TYPE (intop), TREE_INT_CST_LOW (intop),
+ TREE_INT_CST_HIGH (intop));
+ }
/* Create the sum or difference. */
if (resultcode == MINUS_EXPR)
if (complain)
error_at (loc, "invalid application of %qs to incomplete type %qT ",
op_name, type);
- value = size_zero_node;
+ return error_mark_node;
}
else
{
#undef DEF_ATTR_TREE_LIST
}
+/* Returns TRUE iff the attribute indicated by ATTR_ID takes a plain
+ identifier as an argument, so the front end shouldn't look it up. */
+
+bool
+attribute_takes_identifier_p (const_tree attr_id)
+{
+ if (is_attribute_p ("mode", attr_id)
+ || is_attribute_p ("format", attr_id)
+ || is_attribute_p ("cleanup", attr_id))
+ return true;
+ else
+ return targetm.attribute_takes_identifier_p (attr_id);
+}
+
/* Attribute handlers common to C front ends. */
/* Handle a "packed" attribute; arguments as in
{
TREE_USED (node) = 1;
DECL_PRESERVE_P (node) = 1;
+ if (TREE_CODE (node) == VAR_DECL)
+ DECL_READ_P (node) = 1;
}
else
{
|| TREE_CODE (decl) == FUNCTION_DECL
|| TREE_CODE (decl) == LABEL_DECL
|| TREE_CODE (decl) == TYPE_DECL)
- TREE_USED (decl) = 1;
+ {
+ TREE_USED (decl) = 1;
+ if (TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == PARM_DECL)
+ DECL_READ_P (decl) = 1;
+ }
else
{
warning (OPT_Wattributes, "%qE attribute ignored", name);
}
else if (is_type)
{
+ if ((flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
+ /* OK, modify the type in place. */;
/* If we have a TYPE_DECL, then copy the type, so that we
don't accidentally modify a builtin type. See pushdecl. */
- if (decl && TREE_TYPE (decl) != error_mark_node
- && DECL_ORIGINAL_TYPE (decl) == NULL_TREE)
+ else if (decl && TREE_TYPE (decl) != error_mark_node
+ && DECL_ORIGINAL_TYPE (decl) == NULL_TREE)
{
tree tt = TREE_TYPE (decl);
*type = build_variant_type_copy (*type);
TREE_USED (*type) = TREE_USED (decl);
TREE_TYPE (decl) = *type;
}
- else if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
+ else
*type = build_variant_type_copy (*type);
TYPE_ALIGN (*type) = (1U << i) * BITS_PER_UNIT;