Allow verifier to be run on partially materialized modules.
authorNate Begeman <natebegeman@mac.com>
Fri, 25 Jul 2008 17:28:23 +0000 (17:28 +0000)
committerNate Begeman <natebegeman@mac.com>
Fri, 25 Jul 2008 17:28:23 +0000 (17:28 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54028 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp

index 0aef414a68142980c025d46d4fc2aae16784eb31..4711689f44ab7641d935bb0c4bcf052f738e01a2 100644 (file)
@@ -332,6 +332,7 @@ void Verifier::visitGlobalValue(GlobalValue &GV) {
           GV.hasExternalLinkage() ||
           GV.hasDLLImportLinkage() ||
           GV.hasExternalWeakLinkage() ||
+          GV.hasGhostLinkage() ||
           (isa<GlobalAlias>(GV) &&
            (GV.hasInternalLinkage() || GV.hasWeakLinkage())),
   "Global is external, but doesn't have external or dllimport or weak linkage!",
@@ -510,7 +511,7 @@ void Verifier::visitFunction(Function &F) {
 
   if (F.isDeclaration()) {
     Assert1(F.hasExternalLinkage() || F.hasDLLImportLinkage() ||
-            F.hasExternalWeakLinkage(),
+            F.hasExternalWeakLinkage() || F.hasGhostLinkage(),
             "invalid linkage type for function declaration", &F);
   } else {
     // Verify that this function (which has a body) is not named "llvm.*".  It