[llvm-commits] CVS: llvm/lib/VMCore/Verifier.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Oct 6 17:48:01 PDT 2002


Changes in directory llvm/lib/VMCore:

Verifier.cpp updated: 1.39 -> 1.40

---
Log message:

Check that we don't have external varaibles with internal linkage


---
Diffs of the changes:

Index: llvm/lib/VMCore/Verifier.cpp
diff -u llvm/lib/VMCore/Verifier.cpp:1.39 llvm/lib/VMCore/Verifier.cpp:1.40
--- llvm/lib/VMCore/Verifier.cpp:1.39	Sun Oct  6 16:00:31 2002
+++ llvm/lib/VMCore/Verifier.cpp	Sun Oct  6 17:47:32 2002
@@ -25,7 +25,7 @@
 //  * Verify that a function's argument list agrees with it's declared type.
 //  . Verify that arrays and structures have fixed elements: No unsized arrays.
 //  * It is illegal to specify a name for a void value.
-//  * It is illegal to have a internal function that is just a declaration
+//  * It is illegal to have a internal global value with no intitalizer
 //  * It is illegal to have a ret instruction that returns a value that does not
 //    agree with the function return value type.
 //  * Function call argument types match the function prototype
@@ -97,6 +97,10 @@
       for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
         if (I->isExternal() && I->hasInternalLinkage())
           CheckFailed("Function Declaration has Internal Linkage!", I);
+
+      for (Module::giterator I = M.gbegin(), E = M.gend(); I != E; ++I)
+        if (I->isExternal() && I->hasInternalLinkage())
+          CheckFailed("Global Variable is external with internal linkage!", I);
 
       // If the module is broken, abort at this time.
       abortIfBroken();





More information about the llvm-commits mailing list