From 043c4e5c1d012c8131c7f2fa27a4def32740c42f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 20 Jan 2010 07:19:19 +0000 Subject: emit integer and fp zeros as (e.g.) .byte 0 instead of .space 1, for tidiness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93992 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index f584787ade..bb0cb18190 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -700,9 +700,7 @@ void AsmPrinter::EOL() const { void AsmPrinter::EOL(const Twine &Comment) const { if (VerboseAsm && !Comment.isTriviallyEmpty()) { O.PadToColumn(MAI->getCommentColumn()); - O << MAI->getCommentString() - << ' ' - << Comment; + O << MAI->getCommentString() << ' ' << Comment; } O << '\n'; } @@ -1212,7 +1210,7 @@ static void EmitGlobalConstantLargeInt(const ConstantInt *CI, /// EmitGlobalConstant - Print a general LLVM constant to the .s file. void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) { - if (CV->isNullValue() || isa(CV)) { + if (isa(CV) || isa(CV)) { uint64_t Size = TM.getTargetData()->getTypeAllocSize(CV->getType()); return OutStreamer.EmitZeros(Size, AddrSpace); } @@ -1250,6 +1248,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV, unsigned AddrSpace) { if (const ConstantVector *V = dyn_cast(CV)) return EmitGlobalConstantVector(V, AddrSpace, *this); + // ConstantExpr case. printDataDirective(CV->getType(), AddrSpace); EmitConstantValueOnly(CV); O << '\n'; @@ -1307,19 +1306,17 @@ void AsmPrinter::processDebugLoc(const MachineInstr *MI, if (CurDLT.getScope().isNull()) return; - if (BeforePrintingInsn) { - if (CurDLT.getNode() != PrevDLT) { - unsigned L = DW->RecordSourceLine(CurDLT.getLineNumber(), - CurDLT.getColumnNumber(), - CurDLT.getScope().getNode()); - printLabel(L); - O << '\n'; - DW->BeginScope(MI, L); - PrevDLT = CurDLT.getNode(); - } - } else { + if (!BeforePrintingInsn) { // After printing instruction DW->EndScope(MI); + } else if (CurDLT.getNode() != PrevDLT) { + unsigned L = DW->RecordSourceLine(CurDLT.getLineNumber(), + CurDLT.getColumnNumber(), + CurDLT.getScope().getNode()); + printLabel(L); + O << '\n'; + DW->BeginScope(MI, L); + PrevDLT = CurDLT.getNode(); } } -- cgit v1.2.3-70-g09d2