[LLVMbugs] [Bug 9212] New: Missed feature in llvm::getLocationInfo (can't retrieve function's debugging information)
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Sun Feb 13 20:23:03 PST 2011
http://llvm.org/bugs/show_bug.cgi?id=9212
Summary: Missed feature in llvm::getLocationInfo (can't
retrieve function's debugging information)
Product: libraries
Version: trunk
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P
Component: Global Analyses
AssignedTo: unassignedbugs at nondot.org
ReportedBy: art.oriented at gmail.com
CC: llvmbugs at cs.uiuc.edu
Created an attachment (id=6159)
--> (http://llvm.org/bugs/attachment.cgi?id=6159)
My simple modification
'llvm::getLocationInfo' can't retrieve the dbg info of 'Function' (while
instructions and global variables are working) because it looks like that it
wasn't simply implemented yet. I don't have an access to update the patch, so
I'd like to let you know via this system.
Z:\dev\my-llvm\lib\Analysis>diff -u DebugInfo.cpp DebugInfo_old.cpp
--- DebugInfo.cpp 2011-02-09 15:15:39 -0500
+++ DebugInfo_old.cpp 2011-02-13 23:19:27 -0500
@@ -1592,23 +1592,6 @@
return 0;
}
-/// Find the debug info descriptor corresponding to this function.
-static Value *findDbgSubprogramDeclare(Function *V) {
- const Module *M = V->getParent();
- NamedMDNode *NMD = M->getNamedMetadata("llvm.dbg.sp");
- if (!NMD)
- return 0;
-
- for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) {
- DIDescriptor DIG(cast<MDNode>(NMD->getOperand(i)));
- if (!DIG.isSubprogram())
- continue;
- if (DISubprogram(DIG).getFunction() == V)
- return DIG;
- }
- return 0;
-}
-
/// Finds the llvm.dbg.declare intrinsic corresponding to this value if any.
/// It looks through pointer casts too.
static const DbgDeclareInst *findDbgDeclare(const Value *V) {
@@ -1646,17 +1629,6 @@
StringRef D = Var.getDisplayName();
if (!D.empty())
- DisplayName = D;
- LineNo = Var.getLineNumber();
- Unit = Var.getCompileUnit();
- TypeD = Var.getType();
- } else if (Function *F = dyn_cast<Function>(const_cast<Value*>(V))){
- Value *DIF = findDbgSubprogramDeclare(F);
- if (!DIF) return false;
- DISubprogram Var(cast<MDNode>(DIF));
-
- StringRef D = Var.getDisplayName();
- if (!D.empty())
DisplayName = D;
LineNo = Var.getLineNumber();
Unit = Var.getCompileUnit();
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
More information about the llvm-bugs
mailing list