summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
authorBen Langmuir <blangmuir@apple.com>2014-08-09 00:57:23 +0000
committerBen Langmuir <blangmuir@apple.com>2014-08-09 00:57:23 +0000
commit9d6448b1370ad67afcdcf90699f9ffddf2d582a9 (patch)
tree3e1e589597c0444135260451b25d397ca391343b /clang/lib/Serialization/ASTWriter.cpp
parentffbabb792532c7af61335347a30a7c657aac6c0a (diff)
downloadbcm5719-llvm-9d6448b1370ad67afcdcf90699f9ffddf2d582a9.tar.gz
bcm5719-llvm-9d6448b1370ad67afcdcf90699f9ffddf2d582a9.zip
Refactor the module map file used for uniquing a module name out of
class Module. It's almost always going to be the same as getContainingModule() for top-level modules, so just add a map to cover the remaining cases. This lets us do less bookkeeping to keep the ModuleMap fields up to date. llvm-svn: 215268
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index baed95ebf84..0a11cf21185 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -1139,8 +1139,9 @@ void ASTWriter::WriteControlBlock(Preprocessor &PP, ASTContext &Context,
Abbrev->Add(BitCodeAbbrevOp(BitCodeAbbrevOp::Blob)); // Filename
unsigned AbbrevCode = Stream.EmitAbbrev(Abbrev);
- assert(WritingModule->ModuleMap && "missing module map");
- SmallString<128> ModuleMap(WritingModule->ModuleMap->getName());
+ const FileEntry *ModMapFile = PP.getHeaderSearchInfo().getModuleMap().
+ getModuleMapFileForUniquing(WritingModule);
+ SmallString<128> ModuleMap(ModMapFile->getName());
llvm::sys::fs::make_absolute(ModuleMap);
RecordData Record;
Record.push_back(MODULE_MAP_FILE);
OpenPOWER on IntegriCloud