summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2010-01-26 00:09:58 +0000
committerDale Johannesen <dalej@apple.com>2010-01-26 00:09:58 +0000
commitd5575f29f197c35822d9dd137dec9a46b91f57ce (patch)
treec69922121e7600c0f6564005b81f66d475891545 /llvm/lib
parentad857fc070ba00d966c3f6f3127d68a631f545c7 (diff)
downloadbcm5719-llvm-d5575f29f197c35822d9dd137dec9a46b91f57ce.tar.gz
bcm5719-llvm-d5575f29f197c35822d9dd137dec9a46b91f57ce.zip
Generate DEBUG_VALUE comments on x86. The (limited)
dbg.declare's we currently generate go through both register allocators without perturbing the results. llvm-svn: 94480
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp3
-rw-r--r--llvm/lib/Target/X86/X86FastISel.cpp10
2 files changed, 13 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index 09fd657fffd..b7dbd03fc3a 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -343,6 +343,9 @@ bool FastISel::SelectCall(User *I) {
if (MDNode *Dbg = DI->getMetadata("dbg"))
MMI->setVariableDbgInfo(DI->getVariable(), FI, Dbg);
}
+ // Building the map above is target independent. Generating DEBUG_VALUE
+ // inline is target dependent; do this now.
+ (void)TargetSelectInstruction(cast<Instruction>(I));
return true;
}
case Intrinsic::eh_exception: {
diff --git a/llvm/lib/Target/X86/X86FastISel.cpp b/llvm/lib/Target/X86/X86FastISel.cpp
index d5ad61b2666..94dec7ce355 100644
--- a/llvm/lib/Target/X86/X86FastISel.cpp
+++ b/llvm/lib/Target/X86/X86FastISel.cpp
@@ -1153,6 +1153,16 @@ bool X86FastISel::X86VisitIntrinsicCall(IntrinsicInst &I) {
// FIXME: Handle more intrinsics.
switch (I.getIntrinsicID()) {
default: return false;
+ case Intrinsic::dbg_declare: {
+ DbgDeclareInst *DI = cast<DbgDeclareInst>(&I);
+ X86AddressMode AM;
+ if (!X86SelectAddress(DI->getAddress(), AM))
+ return false;
+ const TargetInstrDesc &II = TII.get(TargetInstrInfo::DEBUG_VALUE);
+ addFullAddress(BuildMI(MBB, DL, II), AM).addImm(0).
+ addMetadata(DI->getVariable());
+ return true;
+ }
case Intrinsic::trap: {
BuildMI(MBB, DL, TII.get(X86::TRAP));
return true;
OpenPOWER on IntegriCloud