================
@@ -43,25 +43,26 @@ class MapExtDefNamesConsumer : public ASTConsumer {
CurrentFileName = astFilePath.str();
}
- ~MapExtDefNamesConsumer() {
- // Flush results to standard output.
- llvm::outs() << createCrossTUIndexString(Index);
- }
-
void HandleTranslationUnit(ASTContext &Context) override {
handleDecl(Context.getTranslationUnitDecl());
}
+ static void printIndex() { llvm::outs() << createCrossTUIndexString(Index); }
+
private:
void handleDecl(const Decl *D);
void addIfInMain(const DeclaratorDecl *DD, SourceLocation defStart);
ASTContext &Ctx;
SourceManager &SM;
- llvm::StringMap<std::string> Index;
+ static llvm::StringMap<std::string> Index;
+ static llvm::StringSet<> WeakNames;
----------------
NagyDonat wrote:
Your commit doesn't actually use `WeakNames`: it inserts some filenames and
erases some, but I don't see any code that checks or prints it.
If you forgot to add some logic, then add it, otherwise you should delete
`WeakNames`.
https://github.com/llvm/llvm-project/pull/222010
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits