[llvm-dev] How to set DebugLoc when using IRBuilder's CreateCall ?

PenYiWang via llvm-dev llvm-dev at lists.llvm.org
Thu Feb 27 03:32:59 PST 2020


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 Instruction is wrong ?

would there be any error?

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200227/b7399554/attachment.html>


More information about the llvm-dev mailing list