[llvm-commits] [llvm-gcc-4.2] r81431 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Evan Cheng evan.cheng at apple.com
Wed Sep 9 22:08:24 PDT 2009


Author: evancheng
Date: Thu Sep 10 00:08:23 2009
New Revision: 81431

URL: http://llvm.org/viewvc/llvm-project?rev=81431&view=rev
Log:
It's ok to re-define an extern inline function.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=81431&r1=81430&r2=81431&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Sep 10 00:08:23 2009
@@ -448,7 +448,8 @@
     Function *FnEntry = TheModule->getFunction(Name);
     if (FnEntry) {
       assert(FnEntry->getName() == Name && "Same entry, different name?");
-      assert(FnEntry->isDeclaration() &&
+      assert((FnEntry->isDeclaration() ||
+              FnEntry->getLinkage() == Function::AvailableExternallyLinkage) &&
              "Multiple fns with same name and neither are external!");
       FnEntry->setName("");  // Clear name to avoid conflicts.
       assert(FnEntry->getCallingConv() == CallingConv &&





More information about the llvm-commits mailing list