[llvm-commits] [llvm] r78432 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Fri Aug 7 16:42:01 PDT 2009
Author: lattner
Date: Fri Aug 7 18:42:01 2009
New Revision: 78432
URL: http://llvm.org/viewvc/llvm-project?rev=78432&view=rev
Log:
code cleanup
Modified:
llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=78432&r1=78431&r2=78432&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Aug 7 18:42:01 2009
@@ -1687,27 +1687,25 @@
}
/// EmitComments - Pretty-print comments for instructions
-void AsmPrinter::EmitComments(const MachineInstr &MI) const
-{
- if (VerboseAsm) {
- if (!MI.getDebugLoc().isUnknown()) {
- DebugLocTuple DLT = MF->getDebugLocTuple(MI.getDebugLoc());
+void AsmPrinter::EmitComments(const MachineInstr &MI) const {
+ if (!VerboseAsm ||
+ MI.getDebugLoc().isUnknown())
+ return;
+
+ DebugLocTuple DLT = MF->getDebugLocTuple(MI.getDebugLoc());
- // Print source line info
- O.PadToColumn(TAI->getCommentColumn(), 1);
- O << TAI->getCommentString() << " SrcLine ";
- if (DLT.CompileUnit->hasInitializer()) {
- Constant *Name = DLT.CompileUnit->getInitializer();
- if (ConstantArray *NameString = dyn_cast<ConstantArray>(Name))
- if (NameString->isString()) {
- O << NameString->getAsString() << " ";
- }
- }
- O << DLT.Line;
- if (DLT.Col != 0)
- O << ":" << DLT.Col;
- }
+ // Print source line info
+ O.PadToColumn(TAI->getCommentColumn(), 1);
+ O << TAI->getCommentString() << " SrcLine ";
+ if (DLT.CompileUnit->hasInitializer()) {
+ Constant *Name = DLT.CompileUnit->getInitializer();
+ if (ConstantArray *NameString = dyn_cast<ConstantArray>(Name))
+ if (NameString->isString())
+ O << NameString->getAsString() << " ";
}
+ O << DLT.Line;
+ if (DLT.Col != 0)
+ O << ":" << DLT.Col;
}
/// EmitComments - Pretty-print comments for instructions
More information about the llvm-commits
mailing list