search for: getnamedmetadata

Displaying 17 results from an estimated 17 matches for "getnamedmetadata".

2013 Nov 02
4
[LLVMdev] get function local debug info?
...se the getVariables() function defined in DISubprogram, but it seemed to return an empty DIArray node when I ran my pass alone using opt. Do I need to enable any other analysis passes in order to populate the data? My related snippet of code is like the following: NamedMDNode *M_Nodes = M.getNamedMetadata("llvm.dbg.cu"); for (unsigned i = 0, e = M_Nodes->getNumOperands(); i != e; ++i) { DIArray SPs = CU.getSubprograms(); for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++ i) { DISubprogram SP(SPs.getElement(i)); DIArray Vars = SP.getVariables()...
2013 Nov 03
0
[LLVMdev] get function local debug info?
...nction defined in DISubprogram, but it > seemed to return an empty DIArray node when I ran my pass alone using opt. > Do I need to enable any other analysis passes in order to populate the data? > > My related snippet of code is like the following: > > NamedMDNode *M_Nodes = M.getNamedMetadata("llvm.dbg.cu"); > for (unsigned i = 0, e = M_Nodes->getNumOperands(); i != e; ++i) { > DIArray SPs = CU.getSubprograms(); > for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++ i) { > DISubprogram SP(SPs.getElement(i)); > DIArray Vars...
2011 Jul 08
0
[LLVMdev] How to get line number of a function in a bitcode file?
Hi Chen, On Jul 8, 2011, at 11:56 AM, kobe James wrote: > Hi All, > > I hope to get some information about functions in a bitcode file. Say, if we have a function foo(), and the bitcode file is generated by a single source file, then I want to get the line number foo() locates in that source file. > If the bitcode file is linked by multiple bitcode files, is it possible to also get
2013 Nov 03
0
[LLVMdev] get function local debug info?
...return an empty DIArray node when I ran my pass alone using >>> opt. Do I need to enable any other analysis passes in order to populate the >>> data? >>> >>> My related snippet of code is like the following: >>> >>> NamedMDNode *M_Nodes = M.getNamedMetadata("llvm.dbg.cu"); >>> for (unsigned i = 0, e = M_Nodes->getNumOperands(); i != e; ++i) { >>> DIArray SPs = CU.getSubprograms(); >>> for (unsigned i = 0, e = SPs.getNumElements(); i != e; ++ i) { >>> DISubprogram SP(SPs.getElemen...
2013 Dec 04
2
[LLVMdev] DwarfDebug problems
...;) => " << *FnScope->getScopeNode() << "\n"; auto fn = MF->getFunction(); errs() << " fn => " << fn->getName() << "\n"; MDNode *node = nullptr; auto mod = fn->getParent(); auto dbg = mod->getNamedMetadata("llvm.dbg.cu"); for (unsigned ni = 0; ni < dbg->getNumOperands(); ni++) { DICompileUnit cu(dbg->getOperand(ni)); auto subs = cu.getSubprograms(); for (unsigned si = 0; si < subs.getNumElements(); si++) { DISubprogram sp(subs.getElement(si));...
2018 Mar 23
1
Reviving the DebugIR pass
>> This work could also be used to fix [3]. Although this probably needs >> more though because there's the question of whether we should preserve >> existing debug information in an LLVM IR file or write over it when it >> is given to Clang. > > > If foo.ll contains edited debug info, `clang -g` shouldn't silently drop the > edits. A warning + no-op
2013 Dec 04
2
[LLVMdev] DwarfDebug problems
...;\n"; >> auto fn = MF->getFunction(); >> errs() << " fn => " << fn->getName() << "\n"; >> >> >> >> MDNode *node = nullptr; >> auto mod = fn->getParent(); >> auto dbg = mod->getNamedMetadata("llvm.dbg.cu"); >> for (unsigned ni = 0; ni < dbg->getNumOperands(); ni++) { >> DICompileUnit cu(dbg->getOperand(ni)); >> auto subs = cu.getSubprograms(); >> for (unsigned si = 0; si < subs.getNumElements(); si++) { >>...
2011 Jul 08
7
[LLVMdev] How to get line number of a function in a bitcode file?
Hi All, I hope to get some information about functions in a bitcode file. Say, if we have a function foo(), and the bitcode file is generated by a single source file, then I want to get the line number foo() locates in that source file. If the bitcode file is linked by multiple bitcode files, is it possible to also get which file foo() locates in? Thanks, Chen -------------- next part
2017 Jun 16
2
CloneFunctionInto produces invalid debug info
...trangely formed (but correct) debug info MD that causes duplication of existing DICompileUnit during cloning, but llvm.dbg.cu is not updated. I got around by a quick cleanup pass that detects the situation and simply adds them in… Something like this: > > auto *CUs = F->getParent()->getNamedMetadata("llvm.dbg.cu"); > if (!CUs) > return; > > SmallPtrSet<Metadata *, 2> Listed; > Listed.insert(CUs->op_begin(), CUs->op_end()); > > for (auto *CU : CUVisited) > if (!Listed.count(CU)) { > auto *Op = dyn_cast<MDNode>(CU);...
2013 Dec 04
0
[LLVMdev] DwarfDebug problems
...gt;getScopeNode() << "\n"; > auto fn = MF->getFunction(); > errs() << " fn => " << fn->getName() << "\n"; > > > > MDNode *node = nullptr; > auto mod = fn->getParent(); > auto dbg = mod->getNamedMetadata("llvm.dbg.cu"); > for (unsigned ni = 0; ni < dbg->getNumOperands(); ni++) { > DICompileUnit cu(dbg->getOperand(ni)); > auto subs = cu.getSubprograms(); > for (unsigned si = 0; si < subs.getNumElements(); si++) { > DISubprogram sp(su...
2013 Dec 04
0
[LLVMdev] DwarfDebug problems
...o fn = MF->getFunction(); >>> errs() << " fn => " << fn->getName() << "\n"; >>> >>> >>> >>> MDNode *node = nullptr; >>> auto mod = fn->getParent(); >>> auto dbg = mod->getNamedMetadata("llvm.dbg.cu"); >>> for (unsigned ni = 0; ni < dbg->getNumOperands(); ni++) { >>> DICompileUnit cu(dbg->getOperand(ni)); >>> auto subs = cu.getSubprograms(); >>> for (unsigned si = 0; si < subs.getNumElements(); si++) { &gt...
2017 Jun 19
2
CloneFunctionInto produces invalid debug info
...ed (but correct) debug info MD that causes duplication of existing DICompileUnit during cloning, but llvm.dbg.cu is not updated. I got around by a quick cleanup pass that detects the situation and simply adds them in… Something like this: >>> >>> auto *CUs = F->getParent()->getNamedMetadata("llvm.dbg.cu"); >>> if (!CUs) >>> return; >>> >>> SmallPtrSet<Metadata *, 2> Listed; >>> Listed.insert(CUs->op_begin(), CUs->op_end()); >>> >>> for (auto *CU : CUVisited) >>> if (!Listed.count(CU)) {...
2010 Mar 16
4
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
Török Edwin wrote: > [snip] > > Ah, the method got moved to the instruction itself! > > dbgKind = Context->getMDKindID("dbg"); > if (MDNode *Dbg = I->getMetadata(dbgKind)) { > ... > Thanks! This appears to work. I also have code that looks up debug information for GlobalVariables and regular LLVM Value *'s. For the former, I think I can look up
2017 Jun 20
2
CloneFunctionInto produces invalid debug info
...correct) debug info MD that causes duplication of existing DICompileUnit during cloning, but llvm.dbg.cu is not updated. I got around by a quick cleanup pass that detects the situation and simply adds them in… Something like this: >>>> >>>> auto *CUs = F->getParent()->getNamedMetadata("llvm.dbg.cu"); >>>> if (!CUs) >>>> return; >>>> >>>> SmallPtrSet<Metadata *, 2> Listed; >>>> Listed.insert(CUs->op_begin(), CUs->op_end()); >>>> >>>> for (auto *CU : CUVisited) >>>...
2017 Jun 15
3
CloneFunctionInto produces invalid debug info
Can you send me a patch with instructions to reproduce? I can take a look. -- adrian > On Jun 15, 2017, at 2:23 PM, Sergei Larin <slarin at codeaurora.org> wrote: > > Yes, it does for us. My tree is couple days off the tip, and I see it there. > > Sergei > > From: llvm-dev [mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Keno Fischer via llvm-dev > Sent:
2013 Dec 04
0
[LLVMdev] DwarfDebug problems
On Tue, Dec 3, 2013 at 9:04 PM, Brandon Holt <bholt at cs.washington.edu> wrote: > In a pass I’m working on, I’ve done some manipulation of several functions, replacing them with new copies with different types, etc. > > The LLVM IR passes the verifier, but when I have debug symbols enabled (“-g”), I get the following error when Clang generates the Dwarf info (using a very recent
2013 Dec 04
2
[LLVMdev] DwarfDebug problems
In a pass I’m working on, I’ve done some manipulation of several functions, replacing them with new copies with different types, etc. The LLVM IR passes the verifier, but when I have debug symbols enabled (“-g”), I get the following error when Clang generates the Dwarf info (using a very recent build of LLVM/Clang from Git mirror): > Assertion failed: (TheCU && "Unable to find