[cfe-dev] How to access the CGDebug class for lineNumbers and columnNumber

Phillip Power phillipp at xsmail.com
Tue Mar 29 15:49:54 PDT 2011


> You are looking too far down the compilation chain.  CGDebugInfo is for
> writing debug metadata out to LLVM IR.  You want to get the information
> from the AST.  Every node on the AST has a SourceLocation associated with
> it, which stores its location in the source file.  

Thanks.  I think I see the flow to get the line number from the AST;
using:
clang::CompilerInstance->getASTContext()->getSourceManager()->getInstantiationLineNumber(SourceLocation
Loc)
This takes a SourceLocation.  Can you point in the right direction to
get a SourceLocation for a LLVM bytecode?

Thanks.
Phillip 
-- 
  Phillip Power
  phillipp at xsmail.com




More information about the cfe-dev mailing list