Don't count debug info as instructions. This was
authorDale Johannesen <dalej@apple.com>
Sat, 1 May 2010 16:41:11 +0000 (16:41 +0000)
committerDale Johannesen <dalej@apple.com>
Sat, 1 May 2010 16:41:11 +0000 (16:41 +0000)
preventing the emission of the NOP on Darwin for a
function with no actual code.  From timberwolfmc
with TEST=optllcdbg.

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

lib/CodeGen/AsmPrinter/AsmPrinter.cpp

index 2c92de82d862e1dcd21dc392f93e3c71a9ed43e3..ded4b3f18bbc383481d1f19e4311870d018b51dd 100644 (file)
@@ -558,7 +558,8 @@ void AsmPrinter::EmitFunctionBody() {
     for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
          II != IE; ++II) {
       // Print the assembly for the instruction.
-      if (!II->isLabel() && !II->isImplicitDef() && !II->isKill()) {
+      if (!II->isLabel() && !II->isImplicitDef() && !II->isKill() &&
+          !II->isDebugValue()) {
         HasAnyRealCode = true;
         ++EmittedInsts;
       }