summaryrefslogtreecommitdiffstats
path: root/clang/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2007-12-19 22:29:55 +0000
committerTed Kremenek <kremenek@apple.com>2007-12-19 22:29:55 +0000
commit9a53275918ef130dedc7b09234f42c5db6de8068 (patch)
tree9e727d49a49533b5bcf210d3f92b495a86504b39 /clang/Basic/SourceManager.cpp
parentfa5751f842b17e2a41d7fa1398fa862887fafbf6 (diff)
downloadbcm5719-llvm-9a53275918ef130dedc7b09234f42c5db6de8068.tar.gz
bcm5719-llvm-9a53275918ef130dedc7b09234f42c5db6de8068.zip
Added storage of the FileID of the the main source file of a translation unit
in SourceManager. llvm-svn: 45225
Diffstat (limited to 'clang/Basic/SourceManager.cpp')
-rw-r--r--clang/Basic/SourceManager.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/Basic/SourceManager.cpp b/clang/Basic/SourceManager.cpp
index d7039b3651c..fe213426b9b 100644
--- a/clang/Basic/SourceManager.cpp
+++ b/clang/Basic/SourceManager.cpp
@@ -508,6 +508,7 @@ MacroIDInfo MacroIDInfo::ReadVal(llvm::Deserializer& D) {
void SourceManager::Emit(llvm::Serializer& S) const {
S.EnterBlock();
S.EmitPtr(this);
+ S.EmitInt(MainFileID);
// Emit: FileInfos. Just emit the file name.
S.EnterBlock();
@@ -541,6 +542,9 @@ SourceManager::CreateAndRegister(llvm::Deserializer& D, FileManager& FMgr){
SourceManager *M = new SourceManager();
D.RegisterPtr(M);
+ // Read: the FileID of the main source file of the translation unit.
+ M->MainFileID = D.ReadInt();
+
std::vector<char> Buf;
{ // Read: FileInfos.
OpenPOWER on IntegriCloud