similar to: [LLVMdev] Fwd: Accessing metadata & creating DIVariable

Displaying 20 results from an estimated 1100 matches similar to: "[LLVMdev] Fwd: Accessing metadata & creating DIVariable"

2011 Mar 29
0
[LLVMdev] Accessing metadata & creating DIVariable
On Mar 29, 2011, at 11:18 AM, Vedavyas Duggirala wrote: > Hi, > >> You need to call di.createCompileUnit() once for your translation unit in the beginning. You don't need to keep track of CU yourself. DIBuilder will take care of it. After words, you can call di.createBasicType(..) and it will work. > > Actually it doesn't. But if I call di.createCompileUnit(file, dir,
2011 Mar 29
2
[LLVMdev] Accessing metadata & creating DIVariable
I get the filename and directory from DISubprogram from reading llvm.dbg.sp and use that to DIBuiler::.createCompileUnit. This leads to "duplicate symbol" error from llc. >>> You need to call di.createCompileUnit() once for your translation unit in the beginning. You don't need to keep track of CU yourself. DIBuilder will take care of it. After words, you can call
2011 Mar 29
0
[LLVMdev] Accessing metadata & creating DIVariable
On Mar 29, 2011, at 8:23 AM, Vedavyas Duggirala wrote: >>>> I am adding local var to existing IR with debug info. I am not using >>>> the Pass infrastructure. >>>> >>>> void InsertDbg(AllocaInst *i, StringRef varname, Instruction, inserbefore) >>>> { >>>> >>>> DIBuilder di(*module); >>>> cu =
2011 Mar 29
2
[LLVMdev] Accessing metadata & creating DIVariable
Hi, > You need to call di.createCompileUnit() once for your translation unit in the beginning. You don't need to keep track of CU yourself. DIBuilder will take care of it. After words, you can call di.createBasicType(..) and it will work. Actually it doesn't. But if I call di.createCompileUnit(file, dir, producer, ...) with file or dir different from that of CU already in the file,
2011 Mar 29
0
[LLVMdev] Accessing metadata & creating DIVariable
>>> I get the filename and directory from  DISubprogram from reading >>> llvm.dbg.sp and use >>> that to DIBuiler::.createCompileUnit. This  leads to  "duplicate >>> symbol" error from llc. >> If the llvm::Module already has llvm.dbg.sp then you don't need to use DIBuilder::createCompileUnit(). The point, I am missing is how did you get
2011 Mar 29
1
[LLVMdev] Accessing metadata & creating DIVariable
>>> I am  adding local var to existing IR with debug info. I am not using >>> the Pass infrastructure. >>> >>> void InsertDbg(AllocaInst *i, StringRef varname, Instruction, inserbefore) >>> { >>> >>> DIBuilder di(*module); >>> cu = di.createCU        / * How do I get the MDNode of  already in the >>> IR . Instead of
2011 Mar 28
3
[LLVMdev] Accessing metadata & creating DIVariable
Hi, I am wondering if someone can guide me in adding metadata to IR which already contains some metadata. I am trying to add dbg.declare inst for a local variable I added to a function. I used the DIBuilder to build a DIVariable. When I try to compile llc fails with following message. llc: MCAsmStreamer.cpp:273: virtual void<unnamed>::MCAsmStreamer::EmitLabel(llvm::MCSymbol*): Assertion
2012 Aug 21
1
[LLVMdev] Dwarf debug info misses while clang codegen
I'm trying to write a llvm pass to add debug info into a non-debug-info bitcode file. I have been read http://llvm.org/docs/SourceLevelDebugging.html. And I use DIBuilder to produce the debug metadata. I know I can't get all information form ir code . So I add some manual info as test data. After executing my pass, I can find debug info metadata in my generated bitcode. Those metadata
2010 Nov 26
0
[LLVMdev] Next round of DWARF issues/questions
On Thu, Nov 25, 2010 at 5:55 PM, Talin <viridia at gmail.com> wrote: > On Tue, Nov 9, 2010 at 9:04 AM, Devang Patel <dpatel at apple.com> wrote: > >> >> >> On Nov 8, 2010, at 10:52 PM, Talin <viridia at gmail.com> wrote: >> >> On Mon, Nov 8, 2010 at 9:56 AM, Devang Patel < <dpatel at apple.com> >> dpatel at apple.com> wrote:
2011 Apr 27
1
[LLVMdev] LLVM internal getDirectory() for LexicalBlock debug information returns filename?
Hi, For my project, I am using internal llvm class functions to print the filename and directory associated with an instruction from the debug information. With a recent checkout of llvm and clang (svn revision 129445), the following custom code (e.g. in a pass that prints directory info for all instructions) returns the filename iso. directory whenever Scope refers to a lexical block: if (const
2013 Nov 03
0
[LLVMdev] get function local debug info?
On Sat, Nov 2, 2013 at 4:17 PM, lu zhao <luzhao at cs.utah.edu> wrote: > Hi, > > If I have an instance of DISubprogram, can I get the debug info of local > variables of the function, including parameters? > > I tried to use 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
2013 Nov 02
4
[LLVMdev] get function local debug info?
Hi, If I have an instance of DISubprogram, can I get the debug info of local variables of the function, including parameters? I tried to use 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
2013 Nov 03
0
[LLVMdev] get function local debug info?
+llvmdev because I accidentally dropped it On Nov 3, 2013 6:57 AM, "David Blaikie" <dblaikie at gmail.com> wrote: > You're welcome to provide a patch or I might get to it myself. Also this > should be described in http://llvm.org/docs/SourceLevelDebugging.html if > it isn't already > On Nov 3, 2013 12:11 AM, "lu zhao" <luzhao at cs.utah.edu>
2016 Mar 03
5
[cfe-dev] RFC: CodeView debug info emission in Clang/LLVM
I think it'd be reasonable to at least figure out a good way to do type references consistently across the two schemes, but I'm OK with the idea of having a blob of opaque type information for different debug info formats, created by frontends (& don't mind if the library for building that blob live in LLVM or Clang for now - the DWARF one at least would probably live in LLVM
2012 Aug 01
1
[LLVMdev] How to insert metadata in llvm IR?
As title. I try to write a pass to covert the bitcode with no debug info to the bitcode with debug info. I use DIBuilder as a LLVM API so that I can generate DI(Debug info). Now I have some DIDescriptor , e.g. DIVariable ,DICompileUnit, DISubprogram , I can use some function to insert metadata. 1. LLVM::Instruction::SetDebugLoc(...) => insert the debug info location like DILexicalBlock
2012 Dec 28
2
[LLVMdev] Newbie question(?): How to correctly create debug info, when generating IR
Hello all, Summary & Context: ------------------------------- I am starting to write a front-end for some domain specific programming languages. Code generation seems to be working fine. However, I am having trouble generating debug info, to be used by gdb. The problem: -------------------- I generate a foo.ll file, that is later compiled into an executable foo. The foo.ll file I
2020 Sep 25
2
Why does a DISubprogram need to be distinct?
I saw https://reviews.llvm.org/rGe17f52d623cc146b7d9bf5a2e02965043508b4c4#949392 "Add a verifier check that rejects non-distinct DISubprogram function" (which has currently be reverted) today which made me wonder why a DISubprogram needs to be distinct? David told me the following and encouraged me to ask in the upstream: > May be historical at this point, I'm not quite sure. (I
2018 Jan 12
0
StripDeadDebugInfo for static inline functions.
Just one update: the function causing the segmentation fault is the following: 359 void DwarfDebug::constructAbstractSubprogramScopeDIE(LexicalScope *Scope) { 360 assert(Scope && Scope->getScopeNode()); 361 assert(Scope->isAbstractScope()); 362 assert(!Scope->getInlinedAt()); 363 364 const MDNode *SP = Scope->getScopeNode(); 365 366
2018 Jan 14
0
StripDeadDebugInfo for static inline functions.
Thanks Paul, Hi Adrian and David I would really appreciate any comments, thoughts assumptions. If additional information is needed please let me know. Regards, Arsen On Sat, Jan 13, 2018 at 2:54 AM, Robinson, Paul <paul.robinson at sony.com> wrote: > Hi Arsen, we are beyond what I understand about how metadata operates. > Maybe Adrian or David knows. > > --paulr > >
2018 Jan 12
2
StripDeadDebugInfo for static inline functions.
Hi Paul, Thanks for your response. Let me actually post more details visualizing my case. Assuming that can help. so the IR before the opt tool is running is: ; Function Attrs: nounwind define i16 @main() #0 !dbg !13 { entry: %retval = alloca i16, align 1 ... } ; Function Attrs: inlinehint nounwind define internal void @delay(i16 %d) #4 !dbg !69 { entry: %d.addr = alloca i16,