aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2009-10-01 01:15:28 +0000
committerDevang Patel <dpatel@apple.com>2009-10-01 01:15:28 +0000
commitf736728788cddfb56d44fb826cb5d91dfdbfe294 (patch)
tree91dfb9a92f10fa56c668d69e9ece0099fd5e7433 /lib
parent539f434334ae6cc5becba8b3099eb20ab7fe48dc (diff)
downloadexternal_llvm-f736728788cddfb56d44fb826cb5d91dfdbfe294.zip
external_llvm-f736728788cddfb56d44fb826cb5d91dfdbfe294.tar.gz
external_llvm-f736728788cddfb56d44fb826cb5d91dfdbfe294.tar.bz2
Add another MDNode into DebugLocTuple. This will be used to keep track of inlined functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83190 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/DebugInfo.cpp11
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp2
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index 6df1610..6b13e74 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/lib/Analysis/DebugInfo.cpp
@@ -952,7 +952,6 @@ void DIFactory::InsertDeclare(Value *Storage, DIVariable D, BasicBlock *BB) {
/// processModule - Process entire module and collect debug info.
void DebugInfoFinder::processModule(Module &M) {
-
for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
for (Function::iterator FI = (*I).begin(), FE = (*I).end(); FI != FE; ++FI)
for (BasicBlock::iterator BI = (*FI).begin(), BE = (*FI).end(); BI != BE;
@@ -1271,7 +1270,7 @@ bool getLocationInfo(const Value *V, std::string &DisplayName,
Value *Context = SPI.getContext();
// If this location is already tracked then use it.
- DebugLocTuple Tuple(cast<MDNode>(Context), SPI.getLine(),
+ DebugLocTuple Tuple(cast<MDNode>(Context), NULL, SPI.getLine(),
SPI.getColumn());
DenseMap<DebugLocTuple, unsigned>::iterator II
= DebugLocInfo.DebugIdMap.find(Tuple);
@@ -1292,9 +1291,11 @@ bool getLocationInfo(const Value *V, std::string &DisplayName,
DebugLocTracker &DebugLocInfo) {
DebugLoc DL;
MDNode *Context = Loc.getScope().getNode();
-
+ MDNode *InlinedLoc = NULL;
+ if (!Loc.getOrigLocation().isNull())
+ InlinedLoc = Loc.getOrigLocation().getNode();
// If this location is already tracked then use it.
- DebugLocTuple Tuple(Context, Loc.getLineNumber(),
+ DebugLocTuple Tuple(Context, InlinedLoc, Loc.getLineNumber(),
Loc.getColumnNumber());
DenseMap<DebugLocTuple, unsigned>::iterator II
= DebugLocInfo.DebugIdMap.find(Tuple);
@@ -1321,7 +1322,7 @@ bool getLocationInfo(const Value *V, std::string &DisplayName,
DICompileUnit CU(Subprogram.getCompileUnit());
// If this location is already tracked then use it.
- DebugLocTuple Tuple(CU.getNode(), Line, /* Column */ 0);
+ DebugLocTuple Tuple(CU.getNode(), NULL, Line, /* Column */ 0);
DenseMap<DebugLocTuple, unsigned>::iterator II
= DebugLocInfo.DebugIdMap.find(Tuple);
if (II != DebugLocInfo.DebugIdMap.end())
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 484ce94..7e83473 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -60,7 +60,7 @@ AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
OutStreamer(*createAsmStreamer(OutContext, O, *T, 0)),
LastMI(0), LastFn(0), Counter(~0U),
- PrevDLT(0, ~0U, ~0U) {
+ PrevDLT(0, 0, ~0U, ~0U) {
DW = 0; MMI = 0;
switch (AsmVerbose) {
case cl::BOU_UNSET: VerboseAsm = VDef; break;