Make sure the only user of InlineAsm's are direct calls.
authorChris Lattner <sabre@nondot.org>
Thu, 26 Jan 2006 00:08:45 +0000 (00:08 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 26 Jan 2006 00:08:45 +0000 (00:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25626 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp

index 36462388b380be68b6bdc32284378758b6735bfa..8113d5bbbcd8779e434f2dc34e6ba66610153c84 100644 (file)
@@ -47,6 +47,7 @@
 #include "llvm/Module.h"
 #include "llvm/ModuleProvider.h"
 #include "llvm/DerivedTypes.h"
+#include "llvm/InlineAsm.h"
 #include "llvm/Instructions.h"
 #include "llvm/Intrinsics.h"
 #include "llvm/PassManager.h"
@@ -663,6 +664,9 @@ void Verifier::visitInstruction(Instruction &I) {
                 !EF->dominates(&BB->getParent()->getEntryBlock(), PredBB),
                 "Instruction does not dominate all uses!", Op, &I);
       }
+    } else if (isa<InlineAsm>(I.getOperand(i))) {
+      Assert1(i == 0 && isa<CallInst>(I),
+              "Cannot take the address of an inline asm!", &I);
     }
   }
   InstsInThisBlock.insert(&I);