diff options
| author | Devang Patel <dpatel@apple.com> | 2009-10-01 01:03:26 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-10-01 01:03:26 +0000 |
| commit | 539f434334ae6cc5becba8b3099eb20ab7fe48dc (patch) | |
| tree | cf41f5dc27b313b9bc0ad7ff9ca1bf0d0272bddf /lib/CodeGen/SelectionDAG/FastISel.cpp | |
| parent | 86049dcedaba49929bf6e4c1cd84f9d85cadb987 (diff) | |
| download | external_llvm-539f434334ae6cc5becba8b3099eb20ab7fe48dc.zip external_llvm-539f434334ae6cc5becba8b3099eb20ab7fe48dc.tar.gz external_llvm-539f434334ae6cc5becba8b3099eb20ab7fe48dc.tar.bz2 | |
If location info is attached with an instruction then keep track of alloca slots used by a variable. This info will be used by AsmPrinter to emit debug info for variables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83189 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 54544a4..0bec2cf 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -407,7 +407,6 @@ bool FastISel::SelectCall(User *I) { || !DW->ShouldEmitDwarfDebug()) return true; - Value *Variable = DI->getVariable(); Value *Address = DI->getAddress(); if (BitCastInst *BCI = dyn_cast<BitCastInst>(Address)) Address = BCI->getOperand(0); @@ -418,8 +417,15 @@ bool FastISel::SelectCall(User *I) { StaticAllocaMap.find(AI); if (SI == StaticAllocaMap.end()) break; // VLAs. int FI = SI->second; - - DW->RecordVariable(cast<MDNode>(Variable), FI); + 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); + } + DW->RecordVariable(DI->getVariable(), FI); return true; } case Intrinsic::eh_exception: { |
