search for: setdebugloc

Displaying 20 results from an estimated 29 matches for "setdebugloc".

Did you mean: getdebugloc
2018 Aug 07
3
[RFC] Add DebugLoc parameter in Instruction’s Create() functions
...e culprit instruction is created (https://reviews.llvm.org/D50263). Currently, when you create a new Instruction, in order to give it DL you have to either use an IRBuilder that is previously set to the correct DL or “manually” create the instruction via one of it’s Create() routines and then call `setDebugLoc()` to it. I propose the addition of a DebugLoc parameter in the *::Create() instruction constructors. This could be in the form of a pure DebugLoc variable or possibly an `Instruction *InheritLocationFromInst` one Some pros of this idea are: - Easier to create instructions with debug location....
2010 Sep 02
3
[LLVMdev] Line number information (and other metadata)
I'd like my compiler to emit proper line number information. The docs talk about Instruction::setDebugLoc(), but that method doesn't actually have to be in my 2.7 LLVM Debian package. What's the correct way of doing this? In addition, can anyone point me at an example of how to emit a comment attached to an instruction (or function)? -- ┌─── dg@cowlark.com ───── http://www.cowlark.com ─────...
2010 Sep 02
0
[LLVMdev] Line number information (and other metadata)
On 02/09/10 11:27, David Given wrote: > I'd like my compiler to emit proper line number information. The docs > talk about Instruction::setDebugLoc(), but that method doesn't actually > have to be in my 2.7 LLVM Debian package. What's the correct way of > doing this? Grr stupid typo. > The docs > talk about Instruction::setDebugLoc(), but that method doesn't > actually appear to be in my 2.7 LLVM Debian package. S...
2015 May 13
2
[LLVMdev] Modifying debug information through llvm pass
...binary. So if I use "addr2line" utility on the binary, it will return my modified debug information. I've tried to change by using the following code snippet: MDNode *N = Inst->getMetadata("dbg"); DebugLoc Loc = DebugLoc::get(newLine, newCol, N); Inst->setDebugLoc(Loc); I read the DebugLoc back by using const DebugLoc D = Inst->getDebugLoc(); unsigned Line = D.getLine(); outs() << Line <<"\n"; But I can't set the debug info correctly. How can I change the debug info correctly through llvm pass? Thanks Riyad -----...
2011 Mar 25
2
[LLVMdev] set line number debug info
...ne number can be extracted from the instruction-debug-info using > > getMetadata method and then using getLineNumber method from DILocation > > class. Unfortunately DILocation class does not have any function like > > setLinenumber. > > You may want to check out Instruction::setDebugLoc(). > llvm/Support/DebugLoc.h and llvm/Analysis/DIBuilder.h will likely be > helpful as well. > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110325/4daee7b2/attachment.html>
2011 Sep 22
2
[LLVMdev] How to const char* Value for function argument
...gs.insert(callargs.begin(), callee->getName()); CallInst* newcall = CallInst::Create(launch, callargs, "", call); newcall->takeName(call); newcall->setCallingConv(call->getCallingConv()); newcall->setAttributes(call->getAttributes()); newcall->setDebugLoc(call->getDebugLoc()); call->replaceAllUsesWith(newcall); found = true; break; } The line callargs.insert(callargs.begin(), callee->getName()); is invalid: instead of StringRef I need to supply a Value* for the second argument. How to construct value for const char...
2020 Feb 27
3
How to set DebugLoc when using IRBuilder's CreateCall ?
Hi I want to insert some functions into the llvm bitcode ir files. So I use IRBuilder and CreateCall(). But it how error : inlinable function call in a function with debug info must have a !dbg location. I don't know what DebugLoc should I give the new CallInst to setDebugLoc. I Create this CallInst , so this CallInst doesn't hava so-called "DebugLoc" mapping to the source code , right ? And also I want the compiler can do some inline optimization to my program. So I have to give this CallInst a DebugLoc.... What would happen if the DebugLoc of an Inst...
2010 Sep 02
2
[LLVMdev] Line number information (and other metadata)
On 2 September 2010 11:35, David Given <dg at cowlark.com> wrote: >> The docs >> talk about Instruction::setDebugLoc(), but that method doesn't >> actually appear to be in my 2.7 LLVM Debian package. I suggest you getting the SVN code, since quite a lot has changed since last freeze. -- cheers, --renato http://systemcall.org/ Reclaim your digital rights, eliminate DRM, learn more at http://www.defe...
2014 Jan 25
2
[LLVMdev] clang doesn't set code column in debug info records
This is maybe a minor issue, but it is obvious when one looks at debug info produced by clang. Such records are normally created by the code like this: Instruction->setDebugLoc(llvm::DebugLoc::get(Line, Column, Scope)); and it appears that Column is always zero. Yuri
2019 Jan 14
2
Metadata/DebugInfo in *.ll file
Generally, a good strategy is to look at what Clang generates for similar code and mimic that in your IR generator. -- adrian
2011 Mar 14
0
[LLVMdev] set line number debug info
...e number. Source > line number can be extracted from the instruction-debug-info using > getMetadata method and then using getLineNumber method from DILocation > class. Unfortunately DILocation class does not have any function like > setLinenumber. You may want to check out Instruction::setDebugLoc(). llvm/Support/DebugLoc.h and llvm/Analysis/DIBuilder.h will likely be helpful as well.
2011 Mar 25
0
[LLVMdev] set line number debug info
...racted from the instruction-debug-info using >> > getMetadata method and then using getLineNumber method from DILocation >> > class. Unfortunately DILocation class does not have any function like >> > setLinenumber. >> >> You may want to check out Instruction::setDebugLoc(). >> llvm/Support/DebugLoc.h and llvm/Analysis/DIBuilder.h will likely be >> helpful as well. >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110325/f664d3a0/attachment.html&gt...
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
2011 Sep 22
0
[LLVMdev] How to const char* Value for function argument
...newcall->takeName(call); newcall->setCallingConv(call->getCallingConv()); newcall->setAttributes(call->getAttributes()); newcall->setDebugLoc(call->getDebugLoc()); call->replaceAllUsesWith(newcall); found = true; break; } The line callargs.insert(callargs.begin(), callee->getNa...
2010 Aug 28
2
[LLVMdev] "Cannot fine DIE"
...then why ? Otherwise, the DIE was dropped somewhere after > compiler generated code. > > I've discovered a little bit more, but not enough to solve the problem. Here's what my code looks like for setting the debug location (some details removed for clarity): void CodeGenerator::setDebugLocation(const SourceLocation & loc) { if (loc != dbgLocation_ && dbgContext_.isScope()) { dbgLocation_ = loc; if (loc.file == NULL) { builder_.SetCurrentDebugLocation(llvm::DebugLoc()); } else if (loc.file == module_->moduleSource()) { TokenPosition pos = token...
2010 Sep 07
1
[LLVMdev] help converting llvm metadata into dwarf tags
...into an SDNode in the DAG then later into a MachineInstr. I'd already attached my own MDNodes to IR instructions I was interested in. I wanted to propagate that info to the final binary. I Added a field to the SelectionDAGBuilder holding the current metadata which I update in SelectionDAGISel::SetDebugLoc() for every IR instruction. Next, in SelectionDAGBuilder::visit() i transfer the current instruction's metadata from the DAGBuilder to the instruction's SDNode. In InstrEmitter::EmitNode() I copy the metadata from the SDNode to the MachineInstr. DwarfDebug::endModule() creates my user-def...
2010 Aug 29
0
[LLVMdev] "Cannot fine DIE"
...dropped somewhere after >> compiler generated code. >> >> I've discovered a little bit more, but not enough to solve the problem. > > Here's what my code looks like for setting the debug location (some details > removed for clarity): > > void CodeGenerator::setDebugLocation(const SourceLocation & loc) { > if (loc != dbgLocation_ && dbgContext_.isScope()) { > dbgLocation_ = loc; > if (loc.file == NULL) { > builder_.SetCurrentDebugLocation(llvm::DebugLoc()); > } else if (loc.file == module_->moduleSource()) { >...
2010 Sep 02
0
[LLVMdev] Line number information (and other metadata)
On Sep 2, 2010, at 4:05 AM, Renato Golin wrote: > On 2 September 2010 11:35, David Given <dg at cowlark.com> wrote: >>> The docs >>> talk about Instruction::setDebugLoc(), but that method doesn't >>> actually appear to be in my 2.7 LLVM Debian package. > > I suggest you getting the SVN code, since quite a lot has changed > since last freeze. Vigourously seconded. It's very true in general, but with regards to debug information in partic...
2012 Aug 01
1
[LLVMdev] How to insert metadata in llvm IR?
...e 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 ,and insert !dbg appending an instruction. 2. LLVM::Instruction::setMetadata(...) => insert the metadta and !dbg appending an instruction. 3. DIBuilder::insertDeclare(...) => insert variable declare (like @llvm.dbg.declare) an...
2019 Jan 14
2
Metadata/DebugInfo in *.ll file
Hi list, I found relevant documentation regarding DebugInfo creation in the LLVM IR bytecode. It can be done for compileunits, functions, and other constructs, with the help of DIBuilder class. However I can't save debug information related to individual llvm::Instructions. I tried DebugLoc, DILocation setting directly with setMetadata(). I tried other ways, for e.g.: