[LLVMdev] Obtaining a GlobalVariable from an MDNode

Yaron Keren yaron.keren at gmail.com
Wed Jul 1 20:59:26 PDT 2015


The API was changed. Try cast_or_null<GlobalVarible>(DIGV->getVariable())
where DIGV is DIGlobalVariable.


2015-07-02 0:30 GMT+03:00 Peter Finn <peterdfinn at icloud.com>:

> DebugInstrumentation.cpp.  Line 246 does the following:
>
> if (DIGlobalVariable(*NMD->getOperand(i)).getGlobal() == GV) {
>
> (Where *i* is an unsigned loop variable and NMD is a NamedMDNode.)
>  Apparently, the compiler rejected the cast from an MDNode (the result of
> getOperand(i)) to a DIGlobalVariable.  Also, it appears that getGlobal()
> doesn’t exist anymore in the DIGlobalVariable doxygen.
>
> Peter
>
> On Jul 1, 2015, at 5:26 PM, John Criswell <jtcriswel at gmail.com> wrote:
>
> On 7/1/15 4:13 PM, Peter Finn wrote:
>
> I’m trying to debug SAFECode source code files, and I need to find a way
> to obtain a GlobalVariable from its appropriate MDNode.  How can I do
> this?  I’ve been looking over the doxygen and I can’t seem to find a way to
> do this.
>
>
> Which source file does this?  I don't recall off-hand where SAFECode does
> this and why.
>
> Regards,
>
> John Criswell
>
>
> Thanks,
> Peter Finn
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
> --
> John Criswell
> Assistant Professor
> Department of Computer Science, University of Rochester
> http://www.cs.rochester.edu/u/criswell
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.rochester.edu_u_criswell&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=hqzz4SgnE6Gjjmw2t5FKhhoJbH7PzSg01U2ZBjD19jA&s=-Tx70_ffc2Thj6_wJxl3awls9I1WXpC38zaMfu-0oRg&e=>
>
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150702/19da806f/attachment.html>


More information about the llvm-dev mailing list