[dragonegg] r182393 - Port gcc-4.8 support from mainline.
Duncan Sands
baldrick at free.fr
Tue May 21 09:16:37 PDT 2013
Author: baldrick
Date: Tue May 21 11:16:37 2013
New Revision: 182393
URL: http://llvm.org/viewvc/llvm-project?rev=182393&view=rev
Log:
Port gcc-4.8 support from mainline.
Modified:
dragonegg/branches/release_33/ (props changed)
dragonegg/branches/release_33/Makefile
dragonegg/branches/release_33/README
dragonegg/branches/release_33/include/dragonegg/Trees.h
dragonegg/branches/release_33/src/Backend.cpp
dragonegg/branches/release_33/src/Convert.cpp
dragonegg/branches/release_33/src/Debug.cpp
dragonegg/branches/release_33/src/x86/ABIHack.inc
dragonegg/branches/release_33/test/validator/c++/2007-01-06-ELF-Thunk-Sections.cpp
dragonegg/branches/release_33/test/validator/c/2012-10-01-Alloca.c
dragonegg/branches/release_33/test/validator/c/FunctionVariableAlias.c
dragonegg/branches/release_33/test/validator/c/VariableFunctionAlias.c
Propchange: dragonegg/branches/release_33/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 21 11:16:37 2013
@@ -1 +1 @@
-/dragonegg/trunk:181689-182192
+/dragonegg/trunk:181689-182277
Modified: dragonegg/branches/release_33/Makefile
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/Makefile?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/Makefile (original)
+++ dragonegg/branches/release_33/Makefile Tue May 21 11:16:37 2013
@@ -86,6 +86,14 @@ CPP_OPTIONS+=$(CPPFLAGS) $(shell $(LLVM_
ifdef DISABLE_VERSION_CHECK
CPP_OPTIONS+=-DDISABLE_VERSION_CHECK
endif
+ifneq ($(GCC_MINOR), 5)
+ ifneq ($(GCC_MINOR), 6)
+ ifneq ($(GCC_MINOR), 7)
+ # gcc-4.8 and later are always built with C++.
+ CPP_OPTIONS+=-DENABLE_BUILD_WITH_CXX
+ endif
+ endif
+endif
LD_OPTIONS+=$(shell $(LLVM_CONFIG) --ldflags) $(LDFLAGS)
Modified: dragonegg/branches/release_33/README
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/README?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/README (original)
+++ dragonegg/branches/release_33/README Tue May 21 11:16:37 2013
@@ -5,7 +5,7 @@
Prerequisites
-------------
-The dragonegg plugin works with gcc 4.5, gcc 4.6 or gcc-4.7, so you will need to
+The dragonegg plugin works with gcc 4.5, 4.6, 4.7 or 4.8, so you will need to
have one of these installed. Many linux distributions ship one or both of them,
perhaps as an addon package; binaries can be downloaded for most platforms.
Otherwise you can always build gcc yourself. Plugin support (--enable-plugin)
Modified: dragonegg/branches/release_33/include/dragonegg/Trees.h
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/include/dragonegg/Trees.h?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/include/dragonegg/Trees.h (original)
+++ dragonegg/branches/release_33/include/dragonegg/Trees.h Tue May 21 11:16:37 2013
@@ -141,4 +141,29 @@ unsigned getFieldAlignment(const_tree fi
/// isBitfield - Returns whether to treat the specified field as a bitfield.
bool isBitfield(const_tree field_decl);
+// Compatibility hacks for older versions of GCC.
+#if (GCC_MINOR < 8)
+// Supported allocation types:
+struct va_gc {
+}; // Allocation uses ggc_alloc.
+
+// Fake vector class specialized below.
+template <typename T, typename A> class vec {
+};
+
+#define INSTANTIATE_VECTOR(TT) \
+ template <> class vec<TT, va_gc> { \
+ VEC(TT, gc) & v; \
+ public: \
+ vec(VEC(TT, gc) & V) : v(V) {} \
+ \
+ bool is_empty() const { return VEC_empty(TT, &v); } \
+ unsigned length() const { return VEC_length(TT, &v); } \
+ TT &operator[](unsigned i) const { return *VEC_index(TT, &v, i); } \
+ bool iterate(unsigned ix, TT **ptr) const { \
+ return VEC_iterate(TT, &v, ix, *ptr); \
+ } \
+ }
+#endif
+
#endif /* DRAGONEGG_TREES_H */
Modified: dragonegg/branches/release_33/src/Backend.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/src/Backend.cpp?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/src/Backend.cpp (original)
+++ dragonegg/branches/release_33/src/Backend.cpp Tue May 21 11:16:37 2013
@@ -156,6 +156,33 @@ static FunctionPassManager *CodeGenPasse
static void createPerFunctionOptimizationPasses();
static void createPerModuleOptimizationPasses();
+// Compatibility hacks for older versions of GCC.
+#if (GCC_MINOR < 8)
+
+static struct cgraph_node *cgraph_symbol(struct cgraph_node *N) { return N; }
+static struct varpool_node *varpool_symbol(struct varpool_node *N) { return N; }
+
+#define ipa_ref_list_referring_iterate(L,I,P) \
+ ipa_ref_list_refering_iterate(L,I,P)
+#define ipa_ref_referring_node(R) ipa_ref_refering_node(R)
+#define ipa_ref_referring_varpool_node(R) ipa_ref_refering_varpool_node(R)
+
+#define asm_nodes cgraph_asm_nodes
+#define asm_node cgraph_asm_node
+
+#define FOR_EACH_FUNCTION(node) \
+ for ((node) = cgraph_nodes; (node); (node) = (node)->next)
+
+#define FOR_EACH_VARIABLE(node) \
+ for ((node) = varpool_nodes; (node); (node) = (node)->next)
+
+#else
+
+static symtab_node_base *cgraph_symbol(cgraph_node *N) { return &N->symbol; }
+static symtab_node_base *varpool_symbol(varpool_node *N) { return &N->symbol; }
+
+#endif
+
//===----------------------------------------------------------------------===//
// Matching LLVM Values with GCC DECL trees
//===----------------------------------------------------------------------===//
@@ -498,32 +525,45 @@ static void CreateTargetMachine(const st
TheTarget->setMCUseDwarfDirectory(false);
}
+/// output_ident - Insert a .ident directive that identifies the plugin.
+static void output_ident(const char *ident_str) {
+ const char *ident_asm_op = "\t.ident\t";
+#if (GCC_MINOR < 8)
+#ifdef IDENT_ASM_OP
+ ident_asm_op = IDENT_ASM_OP;
+#endif
+#endif
+ std::string Directive(ident_asm_op);
+ Directive += "\"";
+ Directive += ident_str;
+ Directive += " LLVM: ";
+ Directive += LLVM_VERSION;
+ Directive += "\"";
+ TheModule->setModuleInlineAsm(Directive);
+}
+
/// CreateModule - Create and initialize a module to output LLVM IR to.
static void CreateModule(const std::string &TargetTriple) {
// Create the module itself.
StringRef ModuleID = main_input_filename ? main_input_filename : "";
TheModule = new Module(ModuleID, getGlobalContext());
-// Insert a special .ident directive to identify the version of the plugin
-// which compiled this code. The format of the .ident string is patterned
-// after the ones produced by GCC.
+#if (GCC_MINOR < 8)
#ifdef IDENT_ASM_OP
if (!flag_no_ident) {
+ std::string IdentString;
const char *pkg_version = "(GNU) ";
if (strcmp("(GCC) ", pkgversion_string))
pkg_version = pkgversion_string;
- std::string IdentString = IDENT_ASM_OP;
- IdentString += "\"GCC: ";
+ IdentString += "GCC: ";
IdentString += pkg_version;
IdentString += version_string;
- IdentString += " LLVM: ";
- IdentString += LLVM_VERSION;
- IdentString += "\"";
- TheModule->setModuleInlineAsm(IdentString);
+ output_ident(IdentString.c_str());
}
#endif
+#endif
// Install information about the target triple and data layout into the module
// for optimizer use.
@@ -900,9 +940,9 @@ static void emit_alias(tree decl, tree t
if (isa<IDENTIFIER_NODE>(target)) {
if (struct cgraph_node *fnode = cgraph_node_for_asm(target))
- target = fnode->decl;
+ target = cgraph_symbol(fnode)->decl;
else if (struct varpool_node *vnode = varpool_node_for_asm(target))
- target = vnode->decl;
+ target = varpool_symbol(vnode)->decl;
}
GlobalValue *Aliasee = 0;
@@ -968,10 +1008,12 @@ static void emit_varpool_aliases(struct
emit_alias(alias->decl, node->decl);
#else
struct ipa_ref *ref;
- for (int i = 0; ipa_ref_list_refering_iterate(&node->ref_list, i, ref); i++)
+ for (int i = 0;
+ ipa_ref_list_referring_iterate(&varpool_symbol(node)->ref_list, i, ref);
+ i++)
if (ref->use == IPA_REF_ALIAS) {
- struct varpool_node *alias = ipa_ref_refering_varpool_node(ref);
- emit_alias(alias->decl, alias->alias_of);
+ struct varpool_node *alias = ipa_ref_referring_varpool_node(ref);
+ emit_alias(varpool_symbol(alias)->decl, alias->alias_of);
emit_varpool_aliases(alias);
}
#endif
@@ -1147,7 +1189,9 @@ static void emit_global(tree decl) {
assert(SizeOfGlobalMatchesDecl(GV, decl) && "Global has wrong size!");
// Mark the global as written so gcc doesn't waste time outputting it.
+#if (GCC_MINOR < 8)
TREE_ASM_WRITTEN(decl) = 1;
+#endif
// Output any associated aliases.
if (isa<VAR_DECL>(decl))
@@ -1580,6 +1624,12 @@ static void llvm_start_unit(void */*gcc_
// Ensure that GCC doesn't decorate stdcall and fastcall function names:
// LLVM codegen takes care of this, and we don't want them decorated twice.
targetm.mangle_decl_assembler_name = default_mangle_decl_assembler_name;
+
+#if (GCC_MINOR > 7)
+ // Arrange for a special .ident directive identifying the compiler and plugin
+ // versions to be inserted into the final assembler.
+ targetm.asm_out.output_ident = output_ident;
+#endif
}
/// emit_cgraph_aliases - Output any aliases associated with the given cgraph
@@ -1599,10 +1649,12 @@ static void emit_cgraph_aliases(struct c
// for thunks to be output as functions and thus visit thunk aliases when the
// thunk function is output.
struct ipa_ref *ref;
- for (int i = 0; ipa_ref_list_refering_iterate(&node->ref_list, i, ref); i++)
+ for (int i = 0;
+ ipa_ref_list_referring_iterate(&cgraph_symbol(node)->ref_list, i, ref);
+ i++)
if (ref->use == IPA_REF_ALIAS) {
- struct cgraph_node *alias = ipa_ref_refering_node(ref);
- emit_alias(alias->decl, alias->thunk.alias);
+ struct cgraph_node *alias = ipa_ref_referring_node(ref);
+ emit_alias(cgraph_symbol(alias)->decl, alias->thunk.alias);
emit_cgraph_aliases(alias);
}
#endif
@@ -1645,8 +1697,15 @@ static unsigned int rtl_emit_function(vo
emit_current_function();
}
- // Free any data structures.
+ // Free tree-ssa data structures.
+#if (GCC_MINOR < 8)
execute_free_datastructures();
+#else
+ free_dominance_info(CDI_DOMINATORS);
+ free_dominance_info(CDI_POST_DOMINATORS);
+ // And get rid of annotations we no longer need.
+ delete_tree_cfg_annotations();
+#endif
// Finally, we have written out this function!
TREE_ASM_WRITTEN(current_function_decl) = 1;
@@ -1656,6 +1715,9 @@ static unsigned int rtl_emit_function(vo
/// pass_rtl_emit_function - RTL pass that converts a function to LLVM IR.
static struct rtl_opt_pass pass_rtl_emit_function = { {
RTL_PASS, "rtl_emit_function", /* name */
+#if (GCC_MINOR >= 8)
+ OPTGROUP_NONE, /* optinfo_flags */
+#endif
NULL, /* gate */
rtl_emit_function, /* execute */
NULL, /* sub */
@@ -1671,14 +1733,14 @@ static struct rtl_opt_pass pass_rtl_emit
/// emit_file_scope_asms - Output any file-scope assembly.
static void emit_file_scope_asms() {
- for (struct cgraph_asm_node *can = cgraph_asm_nodes; can; can = can->next) {
- tree string = can->asm_str;
+ for (struct asm_node *anode = asm_nodes; anode; anode = anode->next) {
+ tree string = anode->asm_str;
if (isa<ADDR_EXPR>(string))
string = TREE_OPERAND(string, 0);
TheModule->appendModuleInlineAsm(TREE_STRING_POINTER(string));
}
// Remove the asms so gcc doesn't waste time outputting them.
- cgraph_asm_nodes = NULL;
+ asm_nodes = NULL;
}
#if (GCC_MINOR > 6)
@@ -1691,27 +1753,35 @@ static tree get_alias_symbol(tree decl)
/// emit_cgraph_weakrefs - Output any cgraph weak references to external
/// declarations.
static void emit_cgraph_weakrefs() {
- for (struct cgraph_node *node = cgraph_nodes; node; node = node->next)
- if (node->alias && DECL_EXTERNAL(node->decl) &&
- lookup_attribute("weakref", DECL_ATTRIBUTES(node->decl)))
- emit_alias(node->decl, node->thunk.alias ? node->thunk.alias
- : get_alias_symbol(node->decl));
+ struct cgraph_node *node;
+ FOR_EACH_FUNCTION(node)
+ if (node->alias && DECL_EXTERNAL(cgraph_symbol(node)->decl) &&
+ lookup_attribute("weakref", DECL_ATTRIBUTES(cgraph_symbol(node)->decl)))
+ emit_alias(cgraph_symbol(node)->decl, node->thunk.alias ?
+ node->thunk.alias :
+ get_alias_symbol(cgraph_symbol(node)->decl));
}
/// emit_varpool_weakrefs - Output any varpool weak references to external
/// declarations.
static void emit_varpool_weakrefs() {
- for (struct varpool_node *vnode = varpool_nodes; vnode; vnode = vnode->next)
- if (vnode->alias && DECL_EXTERNAL(vnode->decl) &&
- lookup_attribute("weakref", DECL_ATTRIBUTES(vnode->decl)))
- emit_alias(vnode->decl, vnode->alias_of ? vnode->alias_of
- : get_alias_symbol(vnode->decl));
+ struct varpool_node *vnode;
+ FOR_EACH_VARIABLE(vnode)
+ if (vnode->alias && DECL_EXTERNAL(varpool_symbol(vnode)->decl) &&
+ lookup_attribute("weakref",
+ DECL_ATTRIBUTES(varpool_symbol(vnode)->decl)))
+ emit_alias(varpool_symbol(vnode)->decl, vnode->alias_of ? vnode->alias_of
+ : get_alias_symbol(varpool_symbol(vnode)->decl));
}
#endif
+#if (GCC_MINOR < 8)
+INSTANTIATE_VECTOR(alias_pair);
+#endif
+
/// llvm_emit_globals - Output GCC global variables, aliases and asm's to the
/// LLVM IR.
-static void llvm_emit_globals(void */*gcc_data*/, void */*user_data*/) {
+static void llvm_emit_globals(void * /*gcc_data*/, void * /*user_data*/) {
if (errorcount || sorrycount)
return; // Do not process broken code.
@@ -1723,16 +1793,19 @@ static void llvm_emit_globals(void */*gc
// Some global variables must be output even if unused, for example because
// they are externally visible. Output them now. All other variables are
// output when their user is, or discarded if unused.
- for (struct varpool_node *vnode = varpool_nodes; vnode; vnode = vnode->next) {
+ struct varpool_node *vnode;
+ FOR_EACH_VARIABLE(vnode) {
// If the node is explicitly marked as not being needed, then skip it.
+#if (GCC_MINOR < 8)
if (!vnode->needed)
continue;
+#endif
// If the node is an alias then skip it - aliases are handled below.
if (vnode->alias)
continue;
// If this variable must be output even if unused then output it.
- tree decl = vnode->decl;
+ tree decl = varpool_symbol(vnode)->decl;
if (vnode->analyzed &&
(
#if (GCC_MINOR > 5)
@@ -1763,9 +1836,12 @@ static void llvm_emit_globals(void */*gc
// Emit any aliases that aren't represented in cgraph or varpool, for example
// a function that aliases a variable or a variable that aliases a function.
- alias_pair *p;
- for (unsigned i = 0; VEC_iterate(alias_pair, alias_pairs, i, p); i++)
- emit_alias(p->decl, p->target);
+ if (alias_pairs) {
+ alias_pair *p;
+ const vec<alias_pair, va_gc> &pairs = *alias_pairs;
+ for (unsigned i = 0; pairs.iterate(i, &p); i++)
+ emit_alias(p->decl, p->target);
+ }
}
static void InlineAsmDiagnosticHandler(const SMDiagnostic &D, void */*Data*/,
@@ -1921,6 +1997,9 @@ static bool gate_null(void) { return fal
/// pass_gimple_null - Gimple pass that does nothing.
static struct gimple_opt_pass pass_gimple_null = { {
GIMPLE_PASS, "*gimple_null", /* name */
+#if (GCC_MINOR >= 8)
+ OPTGROUP_NONE, /* optinfo_flags */
+#endif
gate_null, /* gate */
NULL, /* execute */
NULL, /* sub */
@@ -1949,6 +2028,9 @@ static bool gate_correct_state(void) { r
/// newly inserted functions are processed before being converted to LLVM IR.
static struct gimple_opt_pass pass_gimple_correct_state = { {
GIMPLE_PASS, "*gimple_correct_state", /* name */
+#if (GCC_MINOR >= 8)
+ OPTGROUP_NONE, /* optinfo_flags */
+#endif
gate_correct_state, /* gate */
execute_correct_state, /* execute */
NULL, /* sub */
@@ -1965,6 +2047,9 @@ static struct gimple_opt_pass pass_gimpl
/// pass_ipa_null - IPA pass that does nothing.
static struct ipa_opt_pass_d pass_ipa_null = {
{ IPA_PASS, "*ipa_null", /* name */
+#if (GCC_MINOR >= 8)
+ OPTGROUP_NONE, /* optinfo_flags */
+#endif
gate_null, /* gate */
NULL, /* execute */
NULL, /* sub */
@@ -1994,6 +2079,9 @@ static struct ipa_opt_pass_d pass_ipa_nu
/// pass_rtl_null - RTL pass that does nothing.
static struct rtl_opt_pass pass_rtl_null = { { RTL_PASS, "*rtl_null", /* name */
+#if (GCC_MINOR >= 8)
+ OPTGROUP_NONE,/* optinfo_flags */
+#endif
gate_null, /* gate */
NULL, /* execute */
NULL, /* sub */
@@ -2010,6 +2098,9 @@ static struct rtl_opt_pass pass_rtl_null
/// pass_simple_ipa_null - Simple IPA pass that does nothing.
static struct simple_ipa_opt_pass pass_simple_ipa_null = { {
SIMPLE_IPA_PASS, "*simple_ipa_null", /* name */
+#if (GCC_MINOR >= 8)
+ OPTGROUP_NONE, /* optinfo_flags */
+#endif
gate_null, /* gate */
NULL, /* execute */
NULL, /* sub */
@@ -2254,12 +2345,14 @@ int __attribute__((visibility("default")
pass_info.pos_op = PASS_POS_REPLACE;
register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info);
+#if (GCC_MINOR < 8)
// Turn off pass_ipa_matrix_reorg.
pass_info.pass = &pass_simple_ipa_null.pass;
pass_info.reference_pass_name = "matrix-reorg";
pass_info.ref_pass_instance_number = 0;
pass_info.pos_op = PASS_POS_REPLACE;
register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info);
+#endif
// Leave pass_ipa_tm.
@@ -2423,7 +2516,11 @@ int __attribute__((visibility("default")
register_callback(plugin_name, PLUGIN_PASS_MANAGER_SETUP, NULL, &pass_info);
// Turn off all other rtl passes.
+#if (GCC_MINOR < 8)
pass_info.pass = &pass_gimple_null.pass;
+#else
+ pass_info.pass = &pass_rtl_null.pass;
+#endif
pass_info.reference_pass_name = "*rest_of_compilation";
pass_info.ref_pass_instance_number = 0;
pass_info.pos_op = PASS_POS_REPLACE;
Modified: dragonegg/branches/release_33/src/Convert.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/src/Convert.cpp?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/src/Convert.cpp (original)
+++ dragonegg/branches/release_33/src/Convert.cpp Tue May 21 11:16:37 2013
@@ -2894,6 +2894,10 @@ Value *TreeToLLVM::EmitOBJ_TYPE_REF(tree
getRegType(TREE_TYPE(exp)));
}
+#if (GCC_MINOR < 8)
+INSTANTIATE_VECTOR(constructor_elt);
+#endif
+
/// EmitCONSTRUCTOR - emit the constructor into the location specified by
/// DestLoc.
Value *TreeToLLVM::EmitCONSTRUCTOR(tree exp, const MemRef *DestLoc) {
@@ -2938,25 +2942,27 @@ Value *TreeToLLVM::EmitCONSTRUCTOR(tree
// Start out with the value zero'd out.
EmitAggregateZero(*DestLoc, type);
- VEC(constructor_elt, gc) *elt = CONSTRUCTOR_ELTS(exp);
+ if (!CONSTRUCTOR_ELTS(exp))
+ return 0; // No elements.
+
+ const vec<constructor_elt, va_gc> &elt = *CONSTRUCTOR_ELTS(exp);
+
+ if (elt.is_empty())
+ return 0; // No elements.
+
switch (TREE_CODE(TREE_TYPE(exp))) {
case ARRAY_TYPE:
case RECORD_TYPE:
default:
- if (!elt || !VEC_length(constructor_elt, elt))
- return 0;
debug_tree(exp);
llvm_unreachable("We don't handle elements yet!");
case QUAL_UNION_TYPE:
case UNION_TYPE:
// Store each element of the constructor into the corresponding field of
// DEST.
- if (!elt || VEC_empty(constructor_elt, elt))
- return 0; // no elements
- assert(VEC_length(constructor_elt, elt) == 1 &&
- "Union CONSTRUCTOR should have one element!");
- tree tree_purpose = VEC_index(constructor_elt, elt, 0)->index;
- tree tree_value = VEC_index(constructor_elt, elt, 0)->value;
+ assert(elt.length() == 1 && "Union CONSTRUCTOR should have one element!");
+ tree tree_purpose = elt[0].index;
+ tree tree_value = elt[0].value;
if (!tree_purpose)
return 0; // Not actually initialized?
@@ -6352,8 +6358,10 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
#elif(GCC_MINOR < 7)
std::max(get_object_alignment(exp, BIGGEST_ALIGNMENT),
TYPE_ALIGN(TREE_TYPE(exp)));
-#else
+#elif (GCC_MINOR < 8)
get_object_or_type_alignment(exp);
+#else
+ get_object_alignment(exp);
#endif
bool Volatile = TREE_THIS_VOLATILE(exp);
@@ -6474,8 +6482,10 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
#elif(GCC_MINOR < 7)
std::max(get_object_alignment(exp, BIGGEST_ALIGNMENT),
TYPE_ALIGN(TREE_TYPE(exp)));
-#else
+#elif (GCC_MINOR < 8)
get_object_or_type_alignment(exp);
+#else
+ get_object_alignment(exp);
#endif
bool Volatile = TREE_THIS_VOLATILE(exp);
@@ -6691,14 +6701,25 @@ bool TreeToLLVM::EmitBuiltinCall(gimple
Constant *TreeToLLVM::EmitVectorRegisterConstant(tree reg) {
// If there are no elements then immediately return the default value for a
// small speedup.
+#if (GCC_MINOR < 8)
if (!TREE_VECTOR_CST_ELTS(reg))
+#else
+ if (!VECTOR_CST_NELTS(reg))
+#endif
return getDefaultValue(getRegType(TREE_TYPE(reg)));
// Convert the elements.
SmallVector<Constant *, 16> Elts;
tree elt_type = TREE_TYPE(TREE_TYPE(reg));
- for (tree elt = TREE_VECTOR_CST_ELTS(reg); elt; elt = TREE_CHAIN(elt))
- Elts.push_back(EmitRegisterConstantWithCast(TREE_VALUE(elt), elt_type));
+#if (GCC_MINOR < 8)
+ for (tree ch = TREE_VECTOR_CST_ELTS(reg); ch; ch = TREE_CHAIN(ch)) {
+ tree elt = TREE_VALUE(ch);
+#else
+ for (unsigned i = 0, e = VECTOR_CST_NELTS(reg); i != e; ++i) {
+ tree elt = VECTOR_CST_ELT(reg, i);
+#endif
+ Elts.push_back(EmitRegisterConstantWithCast(elt, elt_type));
+ }
// If there weren't enough elements then set the rest of the vector to the
// default value.
Modified: dragonegg/branches/release_33/src/Debug.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/src/Debug.cpp?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/src/Debug.cpp (original)
+++ dragonegg/branches/release_33/src/Debug.cpp Tue May 21 11:16:37 2013
@@ -153,7 +153,7 @@ static StringRef GetNodeName(tree Node)
/// whether the node is a TYPE or DECL. UseStub is true if we should consider
/// the type stub as the actually location (ignored in struct/unions/enums.)
static expanded_location GetNodeLocation(tree Node, bool UseStub = true) {
- expanded_location Location = { NULL, 0, 0, false };
+ expanded_location Location = {};
if (Node == NULL_TREE)
return Location;
@@ -625,7 +625,8 @@ DIType DebugInfo::createEnumType(tree ty
llvm::DIArray EltArray = Builder.getOrCreateArray(Elements);
- expanded_location Loc = { NULL, 0, 0, false };
+ expanded_location Loc = {};
+
if (TYPE_SIZE(type))
// Incomplete enums do not have any location info.
Loc = GetNodeLocation(TREE_CHAIN(type), false);
@@ -705,8 +706,6 @@ DIType DebugInfo::createStructType(tree
llvm::SmallVector<Value*, 16> EltTys;
if (tree binfo = TYPE_BINFO(type)) {
- VEC(tree, gc) *accesses = BINFO_BASE_ACCESSES(binfo);
-
for (unsigned i = 0, e = BINFO_N_BASE_BINFOS(binfo); i != e; ++i) {
tree BInfo = BINFO_BASE_BINFO(binfo, i);
tree BInfoType = BINFO_TYPE(BInfo);
@@ -714,8 +713,8 @@ DIType DebugInfo::createStructType(tree
unsigned BFlags = 0;
if (BINFO_VIRTUAL_P(BInfo))
BFlags = llvm::DIType::FlagVirtual;
- if (accesses) {
- tree access = VEC_index(tree, accesses, i);
+ if (BINFO_BASE_ACCESSES(binfo)) {
+ tree access = BINFO_BASE_ACCESS(binfo, i);
if (access == access_protected_node)
BFlags |= llvm::DIType::FlagProtected;
else if (access == access_private_node)
Modified: dragonegg/branches/release_33/src/x86/ABIHack.inc
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/src/x86/ABIHack.inc?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/src/x86/ABIHack.inc (original)
+++ dragonegg/branches/release_33/src/x86/ABIHack.inc Tue May 21 11:16:37 2013
@@ -1496,9 +1496,6 @@ enum processor_type ix86_tune;
/* Which instruction set architecture to use. */
enum processor_type ix86_arch;
-/* true if sse prefetch instruction is not NOOP. */
-int x86_prefetch_sse;
-
/* Preferred alignment for stack boundary in bits. */
unsigned int ix86_preferred_stack_boundary;
Modified: dragonegg/branches/release_33/test/validator/c++/2007-01-06-ELF-Thunk-Sections.cpp
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/test/validator/c%2B%2B/2007-01-06-ELF-Thunk-Sections.cpp?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/test/validator/c++/2007-01-06-ELF-Thunk-Sections.cpp (original)
+++ dragonegg/branches/release_33/test/validator/c++/2007-01-06-ELF-Thunk-Sections.cpp Tue May 21 11:16:37 2013
@@ -1,6 +1,6 @@
// RUN: %dragonegg %s -S -o - | FileCheck %s
// PR1085
-// XFAIL: gcc-4.7
+// XFAIL: gcc-4.7, gcc-4.8
// CHECK: define weak void @_ZThn{{[48]}}_N
// CHECK: define weak void @_ZThn{{[48]}}_N
Modified: dragonegg/branches/release_33/test/validator/c/2012-10-01-Alloca.c
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/test/validator/c/2012-10-01-Alloca.c?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/test/validator/c/2012-10-01-Alloca.c (original)
+++ dragonegg/branches/release_33/test/validator/c/2012-10-01-Alloca.c Tue May 21 11:16:37 2013
@@ -1,5 +1,5 @@
// RUN: %dragonegg -S %s -o - | FileCheck %s
-// XFAIL: gcc-4.7
+// XFAIL: gcc-4.7, gcc-4.8
void use(int*);
Modified: dragonegg/branches/release_33/test/validator/c/FunctionVariableAlias.c
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/test/validator/c/FunctionVariableAlias.c?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/test/validator/c/FunctionVariableAlias.c (original)
+++ dragonegg/branches/release_33/test/validator/c/FunctionVariableAlias.c Tue May 21 11:16:37 2013
@@ -1,4 +1,5 @@
// RUN: %dragonegg -S %s -o - | FileCheck %s
+// XFAIL: gcc-4.8
int qux;
void foo(void) __attribute__ ((alias ("qux")));
Modified: dragonegg/branches/release_33/test/validator/c/VariableFunctionAlias.c
URL: http://llvm.org/viewvc/llvm-project/dragonegg/branches/release_33/test/validator/c/VariableFunctionAlias.c?rev=182393&r1=182392&r2=182393&view=diff
==============================================================================
--- dragonegg/branches/release_33/test/validator/c/VariableFunctionAlias.c (original)
+++ dragonegg/branches/release_33/test/validator/c/VariableFunctionAlias.c Tue May 21 11:16:37 2013
@@ -1,4 +1,5 @@
// RUN: %dragonegg -S %s -o - | FileCheck %s
+// XFAIL: gcc-4.8
void qux(void) { };
extern int foo __attribute__ ((alias ("qux")));
More information about the llvm-commits
mailing list