From 3738edc2546febbe1867fda2caf1f881c5a435b4 Mon Sep 17 00:00:00 2001 From: rmrf Date: Mon, 30 Dec 2019 13:57:08 -0500 Subject: [PATCH] Update map to be CXXRecordDecl* => ModuleDecl*. --- src/Matchers.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Matchers.h b/src/Matchers.h index 678cc47aa..8185d3a5c 100644 --- a/src/Matchers.h +++ b/src/Matchers.h @@ -423,8 +423,8 @@ class ModuleDeclarationMatcher : public MatchFinder::MatchCallback { DeclarationsToInstancesMapType; // This will store all the modules as ModuleDecl - typedef std::pair ModulePairType; - typedef std::map ModuleMapType; + //typedef ModuleDecl* ModulePairType; + typedef std::map ModuleMapType; private: std::string top_module_decl_; @@ -524,8 +524,8 @@ class ModuleDeclarationMatcher : public MatchFinder::MatchCallback { // This is the new data structure that uses ModuleDecl internally. // Unpruned auto add_module{new ModuleDecl(name, decl)}; - modules_.insert(std::pair( - decl, ModulePairType(add_module->getName(), add_module))); + modules_.insert(std::pair( + decl, add_module)); // Instances should not be in subtree matching. // @@ -655,12 +655,12 @@ class ModuleDeclarationMatcher : public MatchFinder::MatchCallback { for (const auto &i : modules_) { auto cxx_decl{i.first}; // TODO: really awkward - auto decl_name{i.second.first}; - auto decl{i.second.second}; + auto module_decl{i.second}; + auto decl_name{module_decl->getName()}; llvm::outs() << "CXXRecordDecl* " << cxx_decl << ", module name: " << decl_name << "\n"; - decl->dump(llvm::outs()); + module_decl->dump(llvm::outs()); } // Print the instances.