aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTWriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r--lib/Serialization/ASTWriter.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp
index c94b96d18c..14824a0810 100644
--- a/lib/Serialization/ASTWriter.cpp
+++ b/lib/Serialization/ASTWriter.cpp
@@ -969,7 +969,8 @@ void ASTWriter::WriteMetadata(ASTContext &Context, StringRef isysroot,
Record.push_back(CLANG_VERSION_MINOR);
Record.push_back(!isysroot.empty());
// FIXME: This writes the absolute path for chained headers.
- const std::string &BlobStr = Chain ? Chain->getFileName() : Target.getTriple().getTriple();
+ const std::string &BlobStr =
+ Chain ? Chain->getFileName() : Target.getTriple().getTriple();
Stream.EmitRecordWithBlob(MetaAbbrevCode, Record, BlobStr);
// Original file name and file ID
@@ -1548,14 +1549,8 @@ void ASTWriter::WriteSourceManagerBlock(SourceManager &SourceMgr,
// Sorted by offset.
typedef std::pair<uint32_t, StringRef> ModuleOffset;
SmallVector<ModuleOffset, 16> Modules;
- Modules.reserve(Chain->Modules.size());
- for (llvm::StringMap<Module*>::const_iterator
- I = Chain->Modules.begin(), E = Chain->Modules.end();
- I != E; ++I) {
- Modules.push_back(ModuleOffset(I->getValue()->SLocEntryBaseOffset,
- I->getKey()));
- }
- std::sort(Modules.begin(), Modules.end());
+
+ Chain->ModuleMgr.exportLookup(Modules);
Abbrev = new BitCodeAbbrev();
Abbrev->Add(BitCodeAbbrevOp(SOURCE_LOCATION_MAP));