aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-06 22:47:32 +0000
committerChris Lattner <sabre@nondot.org>2002-10-06 22:47:32 +0000
commit61b91bc156bb9e3d9017a9e93d567f8dccfa3f68 (patch)
tree30dd4c72c26a0e26403c33c6bede58b9c0d33a61 /lib/VMCore
parent08c0e6af4f82ca6213a7e63d6085633f92c25a81 (diff)
downloadexternal_llvm-61b91bc156bb9e3d9017a9e93d567f8dccfa3f68.zip
external_llvm-61b91bc156bb9e3d9017a9e93d567f8dccfa3f68.tar.gz
external_llvm-61b91bc156bb9e3d9017a9e93d567f8dccfa3f68.tar.bz2
Check that we don't have external varaibles with internal linkage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4051 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Verifier.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 1663ddf..b01b5ef 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -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
@@ -98,6 +98,10 @@ namespace { // Anonymous namespace for class
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();
return false;