only check non-external functions
authorChris Lattner <sabre@nondot.org>
Wed, 13 Dec 2006 04:45:46 +0000 (04:45 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 13 Dec 2006 04:45:46 +0000 (04:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32530 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp

index 38ce2525be7fefc1294c1dd844ccd134f1899be3..472d451bde8a8fbed8338b1bda75a4d68158abda 100644 (file)
@@ -334,12 +334,6 @@ void Verifier::visitFunction(Function &F) {
           F.getReturnType() == Type::VoidTy,
           "Functions cannot return aggregate values!", &F);
 
-  // Verify that this function (which has a body) is not named "llvm.*".  It
-  // is not legal to define intrinsics.
-  if (F.getName().size() >= 5)
-    Assert1(F.getName().substr(0, 5) != "llvm.",
-            "llvm intrinsics cannot be defined!", &F);
-  
   // Check that this function meets the restrictions on this calling convention.
   switch (F.getCallingConv()) {
   default:
@@ -371,6 +365,12 @@ void Verifier::visitFunction(Function &F) {
    }
 
   if (!F.isExternal()) {
+    // Verify that this function (which has a body) is not named "llvm.*".  It
+    // is not legal to define intrinsics.
+    if (F.getName().size() >= 5)
+      Assert1(F.getName().substr(0, 5) != "llvm.",
+              "llvm intrinsics cannot be defined!", &F);
+    
     verifySymbolTable(F.getSymbolTable());
 
     // Check the entry node