aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/Module.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-09-29 01:06:04 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-09-29 01:06:04 +0000
commite2ac16b09ea66ad955752381b82fb8719d003e5e (patch)
tree68730363a36cb06ac3d72cf674dd7212f7eb6c66 /include/clang/Basic/Module.h
parenteb788e9b49d55bbbc661f1a9db8a54525ecdd0bc (diff)
In the Module class, add a reference to the corresponding AST file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164873 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/Module.h')
-rw-r--r--include/clang/Basic/Module.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/clang/Basic/Module.h b/include/clang/Basic/Module.h
index c8027f4702..cdf993cb4a 100644
--- a/include/clang/Basic/Module.h
+++ b/include/clang/Basic/Module.h
@@ -63,6 +63,10 @@ private:
/// \brief A mapping from the submodule name to the index into the
/// \c SubModules vector at which that submodule resides.
llvm::StringMap<unsigned> SubModuleIndex;
+
+ /// \brief The AST file if this is a top-level module which has a
+ /// corresponding serialized AST file, or null otherwise.
+ const FileEntry *ASTFile;
public:
/// \brief The headers that are part of this module.
@@ -158,7 +162,7 @@ public:
/// \brief Construct a top-level module.
explicit Module(StringRef Name, SourceLocation DefinitionLoc,
bool IsFramework)
- : Name(Name), DefinitionLoc(DefinitionLoc), Parent(0), Umbrella(),
+ : Name(Name), DefinitionLoc(DefinitionLoc), Parent(0),Umbrella(),ASTFile(0),
IsAvailable(true), IsFromModuleFile(false), IsFramework(IsFramework),
IsExplicit(false), IsSystem(false),
InferSubmodules(false), InferExplicitSubmodules(false),
@@ -227,7 +231,18 @@ public:
StringRef getTopLevelModuleName() const {
return getTopLevelModule()->Name;
}
-
+
+ /// \brief The serialized AST file for this module, if one was created.
+ const FileEntry *getASTFile() const {
+ return getTopLevelModule()->ASTFile;
+ }
+
+ /// \brief Set the serialized AST file for the top-level module of this module.
+ void setASTFile(const FileEntry *File) {
+ assert((getASTFile() == 0 || getASTFile() == File) && "file path changed");
+ getTopLevelModule()->ASTFile = File;
+ }
+
/// \brief Retrieve the directory for which this module serves as the
/// umbrella.
const DirectoryEntry *getUmbrellaDir() const;