[llvm-dev] DebugInfo, Metadata usage

Adrian Prantl via llvm-dev llvm-dev at lists.llvm.org
Mon May 22 10:45:56 PDT 2017


> On May 22, 2017, at 6:14 AM, DES via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> What way can I get  DIBasicType for ConstantDataSequential?
> Literally, I want to know is there any way to get the relationship
> between constant, globals and related debuginfo, metadata information?

To get to the source variables associated with a global you can use code like this (copied from the IR Verifier):

  SmallVector<MDNode *, 1> MDs;
  GV.getMetadata(LLVMContext::MD_dbg, MDs);
  for (auto *MD : MDs) {
    if (auto *GVE = dyn_cast<DIGlobalVariableExpression>(MD))
      // do stuff.

-- adrian

> 
> I would appreciate it for any help.
> In advance, thank you very much.
> 
> -- 
> ----------------------
> the best regards!
> 0x0859549A
> 
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list