Displaying 20 results from an estimated 2000 matches similar to: "[LLVMdev] Modifying debug information through llvm pass"
2018 Aug 07
3
[RFC] Add DebugLoc parameter in Instruction’s Create() functions
Many DI-related bugs are caused by missing Debug Location
in an instruction created in a transformation. Most of the
time the fix is trivial once you found where the 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
2015 Jun 18
2
[LLVMdev] Do all the debug nodes in LLVM IR also compiles to DWARF?
Hi
As the title says, are all the debug nodes of LLVM IR avaialble in DWARF?
If I add a new custom MDNode in LLVM IR, can I expect the debug data will
be available in DWARF in the binary if I compile in debug mode?
Thanks
Riyad
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2015 Dec 08
3
Get root node of CallGraph
Hi,
There is a "Root" private member in CallGraph
<http://llvm.org/docs/doxygen/html/CallGraph_8h_source.html#l00192> class.
But there is no way to get access to that member. How can I do that? I can
get CallGraphNode of "main" method. But I am curious is there more cleaner
way.
Thanks,
Riyad
-------------- next part --------------
An HTML attachment was scrubbed...
2015 Oct 09
2
Get instance of CallGraph of a module in the pass
Hello,
I want an instance of CallGraph in my pass. By looking at -dot-callgraph
source, I've tried something like this:
CallGraphWrapperPass *CGWP = new CallGraphWrapperPass();
PM.add(CGWP);
CallGraph *CG = &CGWP->getCallGraph();
PM.add(new MyPass(CG));
I get the following error:
/home/riyad/installs/llvm-3.7.0/include/llvm/PassSupport.h:95:38: error: no
matching constructor for
2011 Mar 25
2
[LLVMdev] set line number debug info
Thanks for the help.
I thought I'd solved the problem (setting the line number information in the
instruction metadata) by inserting my own function for setting line number
in llvm/Support/DebugLoc.h. I have added a function setLine(unsigned) in
DebugLoc class. The function simply sets the LineCol variable as needed. But
there is a problem.
Whenever I'm checking the line number(calling
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 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
2011 Mar 14
0
[LLVMdev] set line number debug info
On Mon, Mar 14, 2011 at 8:56 AM, Abhirup Ghosh <abhirupju at gmail.com> wrote:
> 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.
>
2018 Sep 19
2
Obtaining the origin function for a local var after inlining
On Tue, Sep 18, 2018 at 1:56 AM Adrian Prantl <aprantl at apple.com> wrote:
>
>
>
> > On Sep 17, 2018, at 6:59 AM, Alexander Potapenko via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> >
> > (I think I've asked a similar question off-list a couple of times, but
> > never got an answer)
> >
> > Hi folks,
> >
> > For [K]MSAN
2011 Mar 25
0
[LLVMdev] set line number debug info
Oh! I made a mistake by not using setDebugInfo() function present in the
Instruction class. Now it's working fully.
So, the solution is:-
To set the line number for an instruction -
1. Add a function in DebugLoc class located in llvm/Support/DebugLoc.h. Set
the line number there to the private variable called LineCol.
2. Call the added function. And then pass the modified DebugLoc object to
2015 Oct 05
2
Adding mem2reg pass to pass manager
Hi,
I want to add "mem2reg" pass similar to this:
PassManager PM;
PM.add(new LoopInfo());
PM.add(new Mem2Reg()); // What's the class name for this pass
I couldn't find the name of corresponding class and header file of mem2reg
pass except "mem2reg.cpp". So how can I add mem2reg pass into my pass
manager?
Thanks,
Riyad
-------------- next part --------------
An
2018 Sep 17
3
Obtaining the origin function for a local var after inlining
(I think I've asked a similar question off-list a couple of times, but
never got an answer)
Hi folks,
For [K]MSAN we need to figure out which inlined function a local var
originally belonged to in the source file.
E.g. when a local buffer %buf is declared in @bar(), but @bar() is
inlined into @foo(), then there's a local %buf.i in @foo(), but we
need to determine that the local came from
2018 Feb 05
1
Debug info error on bitcode inline modification
> Every inlinable call in a function that has debug info
(F->getSubprogram() returns non-null) must have a DebugLoc associated with
it that has a scope chain that ends in that same DISubprogram.
Thank you for the comment! I don't know if this is a proper way to fix, but
after I add DebugLoc same as inserting position instruction, no error
occurs.
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
2018 Sep 25
1
Obtaining the origin function for a local var after inlining
On Wed, Sep 19, 2018 at 5:18 PM Adrian Prantl <aprantl at apple.com> wrote:
>
>
>
> > On Sep 19, 2018, at 4:08 AM, Alexander Potapenko <glider at google.com> wrote:
> >
> > On Tue, Sep 18, 2018 at 1:56 AM Adrian Prantl <aprantl at apple.com> wrote:
> >>
> >>
> >>
> >>> On Sep 17, 2018, at 6:59 AM, Alexander
2015 Nov 22
2
BuildMI crashes on a certain probability on the exact same test
Dear there,
I'm trying to call BuildMI in my backend to add a machineinstr.
BuildMI(MBB, I, I->getDebugLoc(), TII->get(Vanilla::MOV),
Vanilla::R1).addReg(MI->getOperand(1).getReg());
But it gives me an error like this:
0 clang 0x000000010e61a56e
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 46
1 clang 0x000000010e61c209
2017 Jun 09
2
Get segfault with ModulePass
Hi,
don't know if this is the right list. Please post a better place,
otherwise.
I'm currently writing a LLVM ModulePass and ran into strange segfaults or
endless loops within LLVM. My main question is, if this is a programming error
or API misuse from me or a LLVM bug?
Here is some minimal code, that triggers the bug:
----------------
class DebugPass : public ModulePass {
public:
2011 Sep 22
2
[LLVMdev] How to const char* Value for function argument
Hi,
I'm trying to replace function call with call to
wrapper(function_name, num_args, ...), where varargs hold args of
original call.
Function* launch = Function::Create(
TypeBuilder<int(const char*, int, ...), false>::get(context),
GlobalValue::ExternalLinkage, "kernelgen_launch_", m2);
{
CallInst* call = dyn_cast<CallInst>(cast<Value>(I));
if
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
2018 Feb 02
0
Debug info error on bitcode inline modification
Every inlinable call in a function that has debug info (F->getSubprogram()
returns non-null) must have a DebugLoc associated with it that has a scope
chain that ends in that same DISubprogram.
https://llvm.org/docs/SourceLevelDebugging.html discusses some of the debug
info IR metadata in LLVM.
On Fri, Feb 2, 2018 at 1:03 AM Ku Nanashi via llvm-dev <
llvm-dev at lists.llvm.org> wrote: