summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-09 22:42:28 +0000
committerDevang Patel <dpatel@apple.com>2009-10-09 22:42:28 +0000
commitdf45c7f64254cdf8659b336bdec5c268781ff073 (patch)
treee6af3324e124c74e4f38aa45aad989c06f40d320 /llvm/lib/CodeGen/SelectionDAG
parent8413751fab4b2eb15ddc1cea1317b31ab000ded2 (diff)
downloadbcm5719-llvm-df45c7f64254cdf8659b336bdec5c268781ff073.tar.gz
bcm5719-llvm-df45c7f64254cdf8659b336bdec5c268781ff073.zip
Extract scope information from the variable itself, instead of relying on alloca or llvm.dbg.declare location.
While recording beginning of a function, use scope info from the first location entry instead of just relying on first location entry itself. llvm-svn: 83684
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp10
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp10
2 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index bccff160ce9..e4ccbce471c 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -417,14 +417,8 @@ bool FastISel::SelectCall(User *I) {
StaticAllocaMap.find(AI);
if (SI == StaticAllocaMap.end()) break; // VLAs.
int FI = SI->second;
- if (MMI) {
- MetadataContext &TheMetadata = AI->getContext().getMetadata();
- unsigned MDDbgKind = TheMetadata.getMDKind("dbg");
- MDNode *AllocaLocation =
- dyn_cast_or_null<MDNode>(TheMetadata.getMD(MDDbgKind, AI));
- if (AllocaLocation)
- MMI->setVariableDbgInfo(DI->getVariable(), AllocaLocation, FI);
- }
+ if (MMI)
+ MMI->setVariableDbgInfo(DI->getVariable(), FI);
#ifndef ATTACH_DEBUG_INFO_TO_AN_INSN
DW->RecordVariable(DI->getVariable(), FI);
#endif
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index a27fbe68adc..aa4ae733c25 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -3970,7 +3970,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
if (!isValidDebugInfoIntrinsic(DI, CodeGenOpt::None))
return 0;
- Value *Variable = DI.getVariable();
+ MDNode *Variable = DI.getVariable();
Value *Address = DI.getAddress();
if (BitCastInst *BCI = dyn_cast<BitCastInst>(Address))
Address = BCI->getOperand(0);
@@ -3983,7 +3983,13 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
if (SI == FuncInfo.StaticAllocaMap.end())
return 0; // VLAs.
int FI = SI->second;
- DW->RecordVariable(cast<MDNode>(Variable), FI);
+#ifdef ATTACH_DEBUG_INFO_TO_AN_INSN
+ MachineModuleInfo *MMI = DAG.getMachineModuleInfo();
+ if (MMI)
+ MMI->setVariableDbgInfo(Variable, FI);
+#else
+ DW->RecordVariable(Variable, FI);
+#endif
return 0;
}
case Intrinsic::eh_exception: {
OpenPOWER on IntegriCloud