From: Dale Johannesen Date: Sat, 1 May 2010 16:41:11 +0000 (+0000) Subject: Don't count debug info as instructions. This was X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d014761c9337f270f497aa960d51ee424bb166d5;p=oota-llvm.git Don't count debug info as instructions. This was 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 --- diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 2c92de82d86..ded4b3f18bb 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -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; }