similar to: [LLVMdev] source line number for instruction

Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] source line number for instruction"

2010 Jul 07
0
[LLVMdev] source line number for instruction
On Jul 6, 2010, at 10:44 PM, Guoliang Jin wrote: > I found the following at http://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend > : > if (MDNode *N = I->getMetadata("dbg")) { // Here I is an LLVM > instruction > DILocation Loc(N); // DILocation is in > DebugInfo.h > unsigned Line = Loc.getLineNumber(); > StringRef
2015 Aug 06
2
[LLVMdev] DebugInfo from LLVM Instruction
Hi all, I used to extract the debug information from an LLVM Instruction in the following way: if (MDNode *N = I->getMetadata("dbg")) { // Here I is an LLVM instruction DILocation Loc(N); // DILocation is in DebugInfo.h unsigned Line = Loc.getLineNumber(); StringRef File = Loc.getFilename(); StringRef Dir = Loc.getDirectory(); } As specified also at
2010 Mar 16
2
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
Török Edwin wrote: > On 03/16/2010 05:00 PM, John Criswell wrote: > >> Dear LLVMers, >> >> I'm updating some code to use the new LLVM 2.7 API. One piece of this >> code uses the findStopPoint() function to find the source filename and >> line number information of an instruction. >> >> What is the best way to do this under LLVM 2.7 now that
2010 Mar 16
2
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
Dear LLVMers, I'm updating some code to use the new LLVM 2.7 API. One piece of this code uses the findStopPoint() function to find the source filename and line number information of an instruction. What is the best way to do this under LLVM 2.7 now that the stop point intrinsic has been removed? It appears that the debug information is attached as metadata, but what is the easiest way
2014 Jan 24
2
[LLVMdev] How to read v3.3 dbg metadata using v3.4 LLVM
Thanks Eric, but could you give me a little bit more hints or pointers please? I looked into DebugInfo.h, but I'm still not sure how to start. It sounds like I'd have to somehow manually extract metadata nodes from an instruction. Thanks, JS On Wed, Jan 22, 2014 at 10:14 PM, Eric Christopher <echristo at gmail.com>wrote: > This is likely going to be difficult if possible. I
2010 Jul 07
1
[LLVMdev] source line number for instruction
On 7/7/2010 3:08 PM, Trevor Harmon wrote: > On Jul 6, 2010, at 10:44 PM, Guoliang Jin wrote: > >> I found the following at >> http://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend: >> if (MDNode *N = I->getMetadata("dbg")) { // Here I is an LLVM >> instruction >> DILocation Loc(N); // DILocation is in >>
2010 Mar 16
2
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
Török Edwin wrote: > [snip] >>> Something like this (you can of course cache TheMetadata and MDDbgKind) >>> >>> llvm::MetadataContext *TheMetadata = M->getContext().getMetadata(); >>> MDDbgKind = TheMetadata->getMDKind("dbg"); >>> if (MDDbgKind) { >>> if (MDNode *Dbg = TheMetadata->getMD(MDDbgKind, I)) { >>>
2014 Jan 23
2
[LLVMdev] How to read v3.3 dbg metadata using v3.4 LLVM
Hi, I have bitcode files built by LLVM v3.3 and need to process them using v3.4 tools. While I don't expect a lot of backward compatibility in LLVM, luckily it seems everything's working fine, except for reading source line information attached to instructions. I use this piece of code [0] to get source line information. For v3.4, instruction.getMetadata returns NULL. I used llvm-dis to
2010 Feb 09
3
[LLVMdev] Mapping bitcode to source code
On Feb 8, 2010, at 8:51 PM, Duncan Sands wrote: > this can be done using debug info. Check out > http://llvm.org/docs/SourceLevelDebugging.html Wow, that threw me for a loop. I'm using the 2.6 release, thinking I was up to date, but its debug output doesn't look anything like what's described in the above link. It appears to document the upcoming 2.7 version, which
2010 Mar 16
0
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
On 03/16/2010 05:00 PM, John Criswell wrote: > Dear LLVMers, > > I'm updating some code to use the new LLVM 2.7 API. One piece of this > code uses the findStopPoint() function to find the source filename and > line number information of an instruction. > > What is the best way to do this under LLVM 2.7 now that the stop point > intrinsic has been removed? It
2010 Mar 16
0
[LLVMdev] Replacement for findStopPoint() in LLVM 2.7
On 03/16/2010 05:21 PM, John Criswell wrote: > Török Edwin wrote: >> On 03/16/2010 05:00 PM, John Criswell wrote: >> >>> Dear LLVMers, >>> >>> I'm updating some code to use the new LLVM 2.7 API. One piece of >>> this code uses the findStopPoint() function to find the source >>> filename and line number information of an
2010 Feb 09
0
[LLVMdev] Mapping bitcode to source code
On Feb 9, 2010, at 11:13 AM, Trevor Harmon wrote: > Is there any information about these changes and why they were > necessary? I think I found it: http://nondot.org/~sabre/LLVMNotes/EmbeddedMetadata.txt Still looking for an API to access the metadata... Trevor
2013 Feb 18
1
[LLVMdev] llvm line number of an instruction
Hello everybody, I want to get the line number of an instruction (and also of a variable declaration - alloca and global). The instruction is saved in an array of instructions. I have the function:     Constant* metadata::getLineNumber(Instruction* I){         if (MDNode *N = I->getMetadata("dbg")) { // this if is never executed             DILocation Loc(N);             unsigned
2012 Oct 04
2
[LLVMdev] question
That's because instructions have a location associated with them, not a compile unit. -eric On Thu, Oct 4, 2012 at 12:46 PM, George Baah <georgebaah at gmail.com> wrote: > I used DILocation instead of DICompileUnit and it works. Hmmm, interesting. > > George > > On Thu, Oct 4, 2012 at 1:33 AM, George Baah <georgebaah at gmail.com> wrote: >> >> Here is
2012 Oct 04
2
[LLVMdev] question
Here is the code. I am running on llvm 3.1 on Lion (Mac 10.7.4) *string getFileDirectory*(*const* Instruction &I){ MDNode *MD = I.getMetadata("dbg"); DICompileUnit compileUnit(MD); return compileUnit.getDirectory().str(); } George On Wed, Oct 3, 2012 at 12:40 PM, Eric Christopher <echristo at gmail.com>wrote: > Without knowing the code that you've written
2011 Mar 14
2
[LLVMdev] set line number debug info
Hi, I am new to LLVM infrastructure. Recently I am trying to set the debug info for an instruction. The main aim is to set the source line number of an instruction. Can anyone please show how to do that? I think that setMetadata method in Instruction class is to be used. But how do I create MDNode* consisting of desired source line number. Source line number can be extracted from the
2018 May 15
2
source line number for instruction
Hi, I want to retrieve a function from a source line-number, is this something possible to achieve? I tried the following code snippet with LLVM-7 but it doesn't seem to workhttp://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend <http://llvm.org/docs/SourceLevelDebugging.html#ccxx_frontend:> Is there specific documentation I can refer to implement this? Thanks -- *Rtr. PP
2012 Oct 05
0
[LLVMdev] question
Hmmm, but it has a getDirectory function. -G On Thu, Oct 4, 2012 at 3:50 PM, Eric Christopher <echristo at gmail.com> wrote: > That's because instructions have a location associated with them, not > a compile unit. > > -eric > > On Thu, Oct 4, 2012 at 12:46 PM, George Baah <georgebaah at gmail.com> wrote: > > I used DILocation instead of DICompileUnit and
2012 Oct 04
0
[LLVMdev] question
I used DILocation instead of DICompileUnit and it works. Hmmm, interesting. George On Thu, Oct 4, 2012 at 1:33 AM, George Baah <georgebaah at gmail.com> wrote: > Here is the code. I am running on llvm 3.1 on Lion (Mac 10.7.4) > > *string getFileDirectory*(*const* Instruction &I){ > > MDNode *MD = I.getMetadata("dbg"); > > DICompileUnit
2012 Oct 05
1
[LLVMdev] question
You should probably think of the DIFooBar constructors like reinterpret-casts, not "go find the thing I actually want" functions. If you hand DICompileUnit() a node that is not a compile-unit metadata node, it's not going to tell you that you goofed. If you _did_ have a CU metadata node, then DICompileUnit's getDirectory() would work just fine. But you don't. --paulr