diff options
author | Jonathan D. Turner <jonathan.d.turner@gmail.com> | 2011-07-29 18:09:09 +0000 |
---|---|---|
committer | Jonathan D. Turner <jonathan.d.turner@gmail.com> | 2011-07-29 18:09:09 +0000 |
commit | 10d52011d8fe96278462107867c6c29c02c04b62 (patch) | |
tree | 5e026348ca6434089cc9a4fbbcc50d4c043a9e47 /clang/lib/Serialization | |
parent | 20d38124a2657e9950f102a2986d5704de6631b7 (diff) | |
download | bcm5719-llvm-10d52011d8fe96278462107867c6c29c02c04b62.tar.gz bcm5719-llvm-10d52011d8fe96278462107867c6c29c02c04b62.zip |
Renamed Loaded member to ImportedBy, as it's easier to read. Added another set to represent the modules a module imports.
llvm-svn: 136476
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index f5c2ec39d77..d8f6c6a640b 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -1380,9 +1380,10 @@ ASTReader::ASTReadResult ASTReader::ReadSLocEntryRecord(int ID) { SourceLocation ASTReader::getImportLocation(Module *F) { if (F->ImportLoc.isValid()) return F->ImportLoc; + // Otherwise we have a PCH. It's considered to be "imported" at the first // location of its includer. - if (F->Loaders.empty() || !F->Loaders[0]) { + if (F->ImportedBy.empty() || !F->ImportedBy[0]) { // Main file is the importer. We assume that it is the first entry in the // entry table. We can't ask the manager, because at the time of PCH loading // the main file entry doesn't exist yet. @@ -1390,7 +1391,8 @@ SourceLocation ASTReader::getImportLocation(Module *F) { // offsets 0 and 1. return SourceLocation::getFromRawEncoding(2U); } - return F->Loaders[0]->FirstLoc; + //return F->Loaders[0]->FirstLoc; + return F->ImportedBy[0]->FirstLoc; } /// ReadBlockAbbrevs - Enter a subblock of the specified BlockID with the @@ -5466,8 +5468,11 @@ Module &ModuleManager::addModule(StringRef FileName, ModuleKind Type) { const FileEntry *Entry = FileMgr.getFile(FileName); Modules[Entry] = Current; - Current->Loaders.push_back(Prev); - + if (Prev) { + Current->ImportedBy.insert(Prev); + Prev->Imports.insert(Current); + } + return *Current; } |