[cfe-dev] Obtaining AST Nodes Text
Miklos Vajna via cfe-dev
cfe-dev at lists.llvm.org
Wed Jun 10 01:03:38 PDT 2020
On Tue, Jun 09, 2020 at 09:31:22AM +0300, samins KAlex via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> How can I retreive matched node text to some variable, not dump?
> I have
> MatchResult &R;
> ASTContext *C;
> SourceManager &SM;
> I don't want to get location and re-read source file. Is there other way?
Did you try CharSourceRange::getTokenRange()? That's what clang-tidy
uses at a number of places to refer to source in diagnostics.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: Digital signature
More information about the cfe-dev