aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-04-06 22:45:26 +0000
committerDale Johannesen <dalej@apple.com>2010-04-06 22:45:26 +0000
commit49d915bb9a60b1dc9d1b5313dc8849427a034dfa (patch)
treed609cd27f8decf36f13d4245dd1b6ed177d6a015 /lib/CodeGen
parent0a580d30e0538a561ca39b3970c8c92f8df850e3 (diff)
Revert 100573, it's causing some testsuite problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100578 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp63
1 files changed, 4 insertions, 59 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 9dfa964ac9..c86e2411d3 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -434,59 +434,7 @@ static void EmitKill(const MachineInstr *MI, AsmPrinter &AP) {
AP.OutStreamer.AddBlankLine();
}
-static void EmitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) {
- char buf[100];
- std::string Str = "\t";
- Str += AP.MAI->getCommentString();
- Str += "DEBUG_VALUE: ";
- // This code handles only the 3-operand target-independent form.
- assert(MI->getNumOperands() == 3);
-
- // cast away const; DIetc do not take const operands for some reason.
- DIVariable V((MDNode*)(MI->getOperand(2).getMetadata()));
- Str += V.getName();
- Str += " <- ";
-
- // Register or immediate value. Register 0 means undef.
- if (MI->getOperand(0).isFPImm()) {
- APFloat APF = APFloat(MI->getOperand(0).getFPImm()->getValueAPF());
- if (MI->getOperand(0).getFPImm()->getType()->isFloatTy()) {
- sprintf(buf, "%e", APF.convertToFloat());
- Str += buf;
- } else if (MI->getOperand(0).getFPImm()->getType()->isDoubleTy()) {
- sprintf(buf, "%e", APF.convertToDouble());
- Str += buf;
- } else {
- // There is no good way to print long double. Convert a copy to
- // double. Ah well, it's only a comment.
- bool ignored;
- APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven,
- &ignored);
- Str += "(long double) ";
- sprintf(buf, "%e", APF.convertToDouble());
- Str += buf;
- }
- } else if (MI->getOperand(0).isImm()) {
- sprintf(buf, "%lld", MI->getOperand(0).getImm());
- Str += buf;
- } else if (MI->getOperand(0).isReg()) {
- if (MI->getOperand(0).getReg() == 0) {
- // Suppress offset, it is not meaningful here.
- Str += "undef";
- // NOTE: Want this comment at start of line, don't emit with AddComment.
- AP.OutStreamer.EmitRawText(Twine(Str));
- return;
- }
- Str += AP.TM.getRegisterInfo()->getName(MI->getOperand(0).getReg());
- } else
- llvm_unreachable("Unknown operand type");
-
- Str += '+';
- sprintf(buf, "%lld", MI->getOperand(1).getImm());
- Str += buf;
- // NOTE: Want this comment at start of line, don't emit with AddComment.
- AP.OutStreamer.EmitRawText(Twine(Str));
-}
+
/// EmitFunctionBody - This method emits the body and trailer for a
/// function.
@@ -525,9 +473,6 @@ void AsmPrinter::EmitFunctionBody() {
case TargetOpcode::INLINEASM:
EmitInlineAsm(II);
break;
- case TargetOpcode::DBG_VALUE:
- if (isVerbose()) EmitDebugValueComment(II, *this);
- break;
case TargetOpcode::IMPLICIT_DEF:
if (isVerbose()) EmitImplicitDef(II, *this);
break;
@@ -1291,7 +1236,7 @@ static void EmitGlobalConstantFP(const ConstantFP *CFP, unsigned AddrSpace,
if (CFP->getType()->isX86_FP80Ty()) {
// all long double variants are printed as hex
- // API needed to prevent premature destruction
+ // api needed to prevent premature destruction
APInt API = CFP->getValueAPF().bitcastToAPInt();
const uint64_t *p = API.getRawData();
if (AP.isVerbose()) {
@@ -1321,8 +1266,8 @@ static void EmitGlobalConstantFP(const ConstantFP *CFP, unsigned AddrSpace,
assert(CFP->getType()->isPPC_FP128Ty() &&
"Floating point constant type not handled");
- // All long double variants are printed as hex
- // API needed to prevent premature destruction.
+ // All long double variants are printed as hex api needed to prevent
+ // premature destruction.
APInt API = CFP->getValueAPF().bitcastToAPInt();
const uint64_t *p = API.getRawData();
if (AP.TM.getTargetData()->isBigEndian()) {