OSDN Git Service

Don't consider debug intrinsics when checking
authorDale Johannesen <dalej@apple.com>
Tue, 10 Mar 2009 22:20:02 +0000 (22:20 +0000)
committerDale Johannesen <dalej@apple.com>
Tue, 10 Mar 2009 22:20:02 +0000 (22:20 +0000)
whether a callee to be inlined is a leaf.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66588 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Utils/CloneFunction.cpp

index 50340d1..5921102 100644 (file)
@@ -47,7 +47,7 @@ BasicBlock *llvm::CloneBasicBlock(const BasicBlock *BB,
     NewBB->getInstList().push_back(NewInst);
     ValueMap[II] = NewInst;                // Add instruction map to value.
     
-    hasCalls |= isa<CallInst>(II);
+    hasCalls |= (isa<CallInst>(II) && !isa<DbgInfoIntrinsic>(II));
     if (const AllocaInst *AI = dyn_cast<AllocaInst>(II)) {
       if (isa<ConstantInt>(AI->getArraySize()))
         hasStaticAllocas = true;
@@ -249,7 +249,7 @@ void PruningFunctionCloner::CloneBlock(const BasicBlock *BB,
     NewBB->getInstList().push_back(NewInst);
     ValueMap[II] = NewInst;                // Add instruction map to value.
     
-    hasCalls |= isa<CallInst>(II);
+    hasCalls |= (isa<CallInst>(II) && !isa<DbgInfoIntrinsic>(II));
     if (const AllocaInst *AI = dyn_cast<AllocaInst>(II)) {
       if (isa<ConstantInt>(AI->getArraySize()))
         hasStaticAllocas = true;