cor3ntin wrote:

@tbaederr I think you need to use the preprocessor that exists ( which you get 
in `DiagnosticConsumer::BeginSourceFile`, I hope you can plug to 
`TextDiagnosticPrinter::BeginSourceFile` in particular), but you are right that 
you can't reuse the Lexer because of comments (and macros?).

Note that we don't technically need the preprocessor, just the underlying 
`IdentifierTable`. 
Then when Lexing with your custom Lexer, when you get an identifier, you should 
be able to get the identifier as a string, which you can pass to 
`IdentifierInfo *Preprocessor::getIdentifierInfo(StringRef Name)`

At least i think this would work?




https://github.com/llvm/llvm-project/pull/66514
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to