aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Basic/SourceManager.h
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-05 21:36:25 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-05 21:36:25 +0000
commitb8c879a5363f36bdae8831112b563333e3c05acb (patch)
treecfd0b285fc1a8ec98b29a7f339d040afc8b7e44d /include/clang/Basic/SourceManager.h
parentcb7709c06027448c754dd03e2e521d82d04818bf (diff)
When loading an AST file, set SourceManager::MainFileID to the main file of the AST file,
as suggested by Tom Honermann. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147612 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r--include/clang/Basic/SourceManager.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index d08d5368d1..b1fb78ea56 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -624,6 +624,12 @@ public:
return MainFileID;
}
+ /// \brief Set the file ID for the main source file.
+ void setMainFileID(FileID FID) {
+ assert(MainFileID.isInvalid() && "MainFileID already set!");
+ MainFileID = FID;
+ }
+
/// \brief Set the file ID for the precompiled preamble.
void setPreambleFileID(FileID Preamble) {
assert(PreambleFileID.isInvalid() && "PreambleFileID already set!");