mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 19:44:38 +08:00
[clang][ExtractAPI] Don't print locations for anonymous tags
ExtractAPI doesn't care about locations of anonymous TagDecls. Set the printing policy to exclude that from anonymous decl names. Differential Revision: https://reviews.llvm.org/D135295
This commit is contained in:
@@ -850,6 +850,11 @@ ExtractAPIAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
|
||||
CI.getPreprocessor().addPPCallbacks(std::make_unique<MacroCallback>(
|
||||
CI.getSourceManager(), *LCF, *API, CI.getPreprocessor()));
|
||||
|
||||
// Do not include location in anonymous decls.
|
||||
PrintingPolicy Policy = CI.getASTContext().getPrintingPolicy();
|
||||
Policy.AnonymousTagLocations = false;
|
||||
CI.getASTContext().setPrintingPolicy(Policy);
|
||||
|
||||
return std::make_unique<ExtractAPIConsumer>(CI.getASTContext(),
|
||||
std::move(LCF), *API);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user