aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-04-26 20:05:01 +0000
committerDale Johannesen <dalej@apple.com>2010-04-26 20:05:01 +0000
commit9cc2d0db1cdd278f83d17ae1529ffb4ffc57485e (patch)
treee25a6a0cb094095a3b61c712de2a22612d00d761 /lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
parentf734f3770ccecf3696a51bef51941cee318e8986 (diff)
downloadexternal_llvm-9cc2d0db1cdd278f83d17ae1529ffb4ffc57485e.tar.gz
external_llvm-9cc2d0db1cdd278f83d17ae1529ffb4ffc57485e.tar.bz2
external_llvm-9cc2d0db1cdd278f83d17ae1529ffb4ffc57485e.zip
Add PPC AsmPrinter handling for target-specific form of
DBG_VALUE, and a cautionary comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102371 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp')
-rw-r--r--lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
index 17446b0dcd..f85ebae8de 100644
--- a/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
+++ b/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
@@ -21,6 +21,7 @@
#include "PPCPredicates.h"
#include "PPCTargetMachine.h"
#include "PPCSubtarget.h"
+#include "llvm/Analysis/DebugInfo.h"
#include "llvm/Constants.h"
#include "llvm/DerivedTypes.h"
#include "llvm/Module.h"
@@ -535,6 +536,23 @@ void PPCAsmPrinter::EmitInstruction(const MachineInstr *MI) {
SmallString<128> Str;
raw_svector_ostream O(Str);
+ if (MI->getOpcode() == TargetOpcode::DBG_VALUE) {
+ unsigned NOps = MI->getNumOperands();
+ assert(NOps==4);
+ O << '\t' << MAI->getCommentString() << "DEBUG_VALUE: ";
+ // cast away const; DIetc do not take const operands for some reason.
+ DIVariable V(const_cast<MDNode *>(MI->getOperand(NOps-1).getMetadata()));
+ O << V.getName();
+ O << " <- ";
+ // Frame address. Currently handles register +- offset only.
+ assert(MI->getOperand(0).isReg() && MI->getOperand(1).isImm());
+ O << '['; printOperand(MI, 0, O); O << '+'; printOperand(MI, 1, O);
+ O << ']';
+ O << "+";
+ printOperand(MI, NOps-2, O);
+ OutStreamer.EmitRawText(O.str());
+ return;
+ }
// Check for slwi/srwi mnemonics.
if (MI->getOpcode() == PPC::RLWINM) {
unsigned char SH = MI->getOperand(2).getImm();