Here's a patch for llvm-gcc for PR1136 renaming GlobalValue::isExternal
as isDeclaration.

Reid.

Index: gcc/llvm-backend.cpp
===================================================================
--- gcc/llvm-backend.cpp	(revision 262)
+++ gcc/llvm-backend.cpp	(working copy)
@@ -398,7 +398,7 @@
     CodeGenPasses->doInitialization();
     for (Module::iterator I = TheModule->begin(), E = TheModule->end();
          I != E; ++I)
-      if (!I->isExternal())
+      if (!I->isDeclaration())
         CodeGenPasses->run(*I);
     CodeGenPasses->doFinalization();
   }
@@ -802,7 +802,7 @@
 
   // Do not mark something that is already known to be linkonce or internal.
   if (GV->hasExternalLinkage()) {
-    if (GV->isExternal())
+    if (GV->isDeclaration())
       GV->setLinkage(GlobalValue::ExternalWeakLinkage);
     else
       GV->setLinkage(GlobalValue::WeakLinkage);
Index: gcc/llvm-convert.cpp
===================================================================
--- gcc/llvm-convert.cpp	(revision 262)
+++ gcc/llvm-convert.cpp	(working copy)
@@ -303,7 +303,7 @@
     Function *&FnEntry = EmittedFunctions[Name];
     if (FnEntry) {
       assert(FnEntry->getName() == Name && "Same entry, different name?");
-      assert(FnEntry->isExternal() &&
+      assert(FnEntry->isDeclaration() &&
              "Multiple fns with same name and neither are external!");
       FnEntry->setName("");  // Clear name to avoid conflicts.
       assert(FnEntry->getCallingConv() == CallingConv &&
@@ -4019,7 +4019,7 @@
     // If this is an aggregate CONST_DECL, emit it to LLVM now.  GCC happens to
     // get this case right by forcing the initializer into memory.
     if (TREE_CODE(exp) == CONST_DECL) {
-      if (DECL_INITIAL(exp) && GV->isExternal()) {
+      if (DECL_INITIAL(exp) && GV->isDeclaration()) {
         emit_global_to_llvm(exp);
         Decl = DECL_LLVM(exp);     // Decl could have change if it changed type.
       }
@@ -5059,7 +5059,7 @@
   // If this is an aggregate CONST_DECL, emit it to LLVM now.  GCC happens to
   // get this case right by forcing the initializer into memory.
   if (TREE_CODE(exp) == CONST_DECL) {
-    if (DECL_INITIAL(exp) && Val->isExternal()) {
+    if (DECL_INITIAL(exp) && Val->isDeclaration()) {
       emit_global_to_llvm(exp);
       // Decl could have change if it changed type.
       Val = cast<GlobalValue>(DECL_LLVM(exp));
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to