[llvm-commits] [llvm] r100700 - /llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Chris Lattner
sabre at nondot.org
Wed Apr 7 15:29:10 PDT 2010
Author: lattner
Date: Wed Apr 7 17:29:10 2010
New Revision: 100700
URL: http://llvm.org/viewvc/llvm-project?rev=100700&view=rev
Log:
tidy up
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=100700&r1=100699&r2=100700&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Wed Apr 7 17:29:10 2010
@@ -466,7 +466,7 @@
OS << '\t' << AP.MAI->getCommentString() << "DEBUG_VALUE: ";
// cast away const; DIetc do not take const operands for some reason.
- DIVariable V((MDNode*)(MI->getOperand(2).getMetadata()));
+ DIVariable V(const_cast<MDNode*>(MI->getOperand(2).getMetadata()));
OS << V.getName() << " <- ";
// Register or immediate value. Register 0 means undef.
@@ -486,7 +486,8 @@
}
} else if (MI->getOperand(0).isImm()) {
OS << MI->getOperand(0).getImm();
- } else if (MI->getOperand(0).isReg()) {
+ } else {
+ assert(MI->getOperand(0).isReg() && "Unknown operand type");
if (MI->getOperand(0).getReg() == 0) {
// Suppress offset, it is not meaningful here.
OS << "undef";
@@ -495,9 +496,8 @@
return true;
}
OS << AP.TM.getRegisterInfo()->getName(MI->getOperand(0).getReg());
- } else
- llvm_unreachable("Unknown operand type");
-
+ }
+
OS << '+' << MI->getOperand(1).getImm();
// NOTE: Want this comment at start of line, don't emit with AddComment.
AP.OutStreamer.EmitRawText(OS.str());
More information about the llvm-commits
mailing list