summaryrefslogtreecommitdiffstats
path: root/include/clang/AST/ExternalASTSource.h
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2015-09-19 00:10:32 +0000
committerAdrian Prantl <aprantl@apple.com>2015-09-19 00:10:32 +0000
commit3fb6a64655ade164b320008cd4fc605de3e13796 (patch)
tree10cd75f16c0ad273ba724b35ddab9ea5383db075 /include/clang/AST/ExternalASTSource.h
parent9083fb296d336494ceed6a1c70146768f7c51d39 (diff)
Refactor ASTReader::getSourceDescriptor(const Module &) into a constructor
of ASTSourceDescriptor. It was effectively a static function. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248069 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/ExternalASTSource.h')
-rw-r--r--include/clang/AST/ExternalASTSource.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/include/clang/AST/ExternalASTSource.h b/include/clang/AST/ExternalASTSource.h
index d5d52e60b1..6be592f0e1 100644
--- a/include/clang/AST/ExternalASTSource.h
+++ b/include/clang/AST/ExternalASTSource.h
@@ -142,19 +142,23 @@ public:
/// \brief Retrieve the module that corresponds to the given module ID.
virtual Module *getModule(unsigned ID) { return nullptr; }
- /// \brief Holds everything needed to generate debug info for an
- /// imported module or precompiled header file.
+ /// Abstracts clang modules and precompiled header files and holds
+ /// everything needed to generate debug info for an imported module
+ /// or PCH.
struct ASTSourceDescriptor {
+ ASTSourceDescriptor(std::string Name, std::string Path, std::string ASTFile,
+ uint64_t Signature)
+ : ModuleName(Name), Path(Path), ASTFile(ASTFile),
+ Signature(Signature){};
+ ASTSourceDescriptor(const Module &M);
std::string ModuleName;
std::string Path;
std::string ASTFile;
- uint64_t Signature;
+ uint64_t Signature = 0;
};
- /// \brief Return a descriptor for the corresponding module, if one exists.
+ /// Return a descriptor for the corresponding module, if one exists.
virtual llvm::Optional<ASTSourceDescriptor> getSourceDescriptor(unsigned ID);
- /// \brief Return a descriptor for the module.
- virtual ASTSourceDescriptor getSourceDescriptor(const Module &M);
/// \brief Finds all declarations lexically contained within the given
/// DeclContext, after applying an optional filter predicate.