diff options
| author | Devang Patel <dpatel@apple.com> | 2011-06-24 20:46:11 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2011-06-24 20:46:11 +0000 |
| commit | f071d72c44d654c6fadbca1d095240e7eb86d700 (patch) | |
| tree | 4da0b251166c93a31829099eb96ef959a2f05806 /llvm/lib/VMCore/DebugInfoProbe.cpp | |
| parent | e862d59eee138bdd49965dfe64fc6b4ec8360f26 (diff) | |
| download | bcm5719-llvm-f071d72c44d654c6fadbca1d095240e7eb86d700.tar.gz bcm5719-llvm-f071d72c44d654c6fadbca1d095240e7eb86d700.zip | |
Handle debug info for i128 constants.
llvm-svn: 133821
Diffstat (limited to 'llvm/lib/VMCore/DebugInfoProbe.cpp')
| -rw-r--r-- | llvm/lib/VMCore/DebugInfoProbe.cpp | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/llvm/lib/VMCore/DebugInfoProbe.cpp b/llvm/lib/VMCore/DebugInfoProbe.cpp index d1275ff58ca..382c2971482 100644 --- a/llvm/lib/VMCore/DebugInfoProbe.cpp +++ b/llvm/lib/VMCore/DebugInfoProbe.cpp @@ -53,6 +53,7 @@ namespace llvm { Function *TheFn; std::set<MDNode *> DbgVariables; std::set<Instruction *> MissingDebugLoc; + std::set<unsigned> LineNos; }; } @@ -66,14 +67,19 @@ void DebugInfoProbeImpl::initialize(StringRef PName, Function &F) { DbgVariables.clear(); MissingDebugLoc.clear(); + LineNos.clear(); TheFn = &F; for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ++BI) { - if (!isa<PHINode>(BI) && BI->getDebugLoc().isUnknown()) - MissingDebugLoc.insert(BI); - if (!isa<DbgInfoIntrinsic>(BI)) continue; + DebugLoc DL = BI->getDebugLoc(); + if (DL.isUnknown()) { + if (!isa<PHINode>(BI)) + MissingDebugLoc.insert(BI); + } else + LineNos.insert(DL.getLine()); + if (!isa<DbgInfoIntrinsic>(BI)) continue; Value *Addr = NULL; MDNode *Node = NULL; if (DbgDeclareInst *DDI = dyn_cast<DbgDeclareInst>(BI)) { @@ -114,16 +120,20 @@ void DebugInfoProbeImpl::finalize(Function &F) { assert (TheFn == &F && "Invalid function to measure!"); std::set<MDNode *>DbgVariables2; + std::set<unsigned>LineNos2; for (Function::iterator FI = F.begin(), FE = F.end(); FI != FE; ++FI) for (BasicBlock::iterator BI = FI->begin(), BE = FI->end(); BI != BE; ++BI) { - if (!isa<PHINode>(BI) && BI->getDebugLoc().isUnknown() && - MissingDebugLoc.count(BI) == 0) { - ++NumDbgLineLost; - DEBUG(dbgs() << "DebugInfoProbe (" << PassName << "): --- "); - DEBUG(BI->print(dbgs())); - DEBUG(dbgs() << "\n"); - } + DebugLoc DL = BI->getDebugLoc(); + if (DL.isUnknown()) { + if (!isa<PHINode>(BI) && MissingDebugLoc.count(BI) == 0) { + ++NumDbgLineLost; + DEBUG(dbgs() << "DebugInfoProbe (" << PassName << "): --- "); + DEBUG(BI->print(dbgs())); + DEBUG(dbgs() << "\n"); + } + } else + LineNos2.insert(DL.getLine()); if (!isa<DbgInfoIntrinsic>(BI)) continue; Value *Addr = NULL; MDNode *Node = NULL; @@ -138,6 +148,12 @@ void DebugInfoProbeImpl::finalize(Function &F) { DbgVariables2.insert(Node); } + for (std::set<unsigned>::iterator I = LineNos.begin(), + E = LineNos.end(); I != E; ++I) { + unsigned LNO = *I; + if (LineNos2.count(LNO) == 0) + DEBUG(dbgs() << "DebugInfoProbe dropping line number " << LNO << "\n"); + } for (std::set<MDNode *>::iterator I = DbgVariables.begin(), E = DbgVariables.end(); I != E; ++I) { if (DbgVariables2.count(*I) == 0 && (*I)->getNumOperands() >= 2) { |

