diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-10-18 17:58:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-10-18 17:58:09 +0000 |
commit | ee097c1a3f5e02605dd585c0a9bf22976f09ccc2 (patch) | |
tree | a1815e179cd8e8d74f2285221b15c6aad8456ddf /lib/Serialization/ASTWriter.cpp | |
parent | b1502bcd67fb593a95cbf73ec3814f4015666da0 (diff) |
Split the target options out into their own record within the AST
file's control block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166195 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | lib/Serialization/ASTWriter.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/Serialization/ASTWriter.cpp b/lib/Serialization/ASTWriter.cpp index b6f302605b..13c88b85d3 100644 --- a/lib/Serialization/ASTWriter.cpp +++ b/lib/Serialization/ASTWriter.cpp @@ -994,19 +994,6 @@ void ASTWriter::WriteControlBlock(ASTContext &Context, StringRef isysroot, Record.push_back(CLANG_VERSION_MINOR); Record.push_back(!isysroot.empty()); Record.push_back(ASTHasCompilerErrors); - AddString(TargetOpts.Triple, Record); - AddString(TargetOpts.CPU, Record); - AddString(TargetOpts.ABI, Record); - AddString(TargetOpts.CXXABI, Record); - AddString(TargetOpts.LinkerVersion, Record); - Record.push_back(TargetOpts.FeaturesAsWritten.size()); - for (unsigned I = 0, N = TargetOpts.FeaturesAsWritten.size(); I != N; ++I) { - AddString(TargetOpts.FeaturesAsWritten[I], Record); - } - Record.push_back(TargetOpts.Features.size()); - for (unsigned I = 0, N = TargetOpts.Features.size(); I != N; ++I) { - AddString(TargetOpts.Features[I], Record); - } Stream.EmitRecord(METADATA, Record); // Imports @@ -1047,6 +1034,23 @@ void ASTWriter::WriteControlBlock(ASTContext &Context, StringRef isysroot, Record.append(LangOpts.CurrentModule.begin(), LangOpts.CurrentModule.end()); Stream.EmitRecord(LANGUAGE_OPTIONS, Record); + // Target options. + Record.clear(); + AddString(TargetOpts.Triple, Record); + AddString(TargetOpts.CPU, Record); + AddString(TargetOpts.ABI, Record); + AddString(TargetOpts.CXXABI, Record); + AddString(TargetOpts.LinkerVersion, Record); + Record.push_back(TargetOpts.FeaturesAsWritten.size()); + for (unsigned I = 0, N = TargetOpts.FeaturesAsWritten.size(); I != N; ++I) { + AddString(TargetOpts.FeaturesAsWritten[I], Record); + } + Record.push_back(TargetOpts.Features.size()); + for (unsigned I = 0, N = TargetOpts.Features.size(); I != N; ++I) { + AddString(TargetOpts.Features[I], Record); + } + Stream.EmitRecord(TARGET_OPTIONS, Record); + // Original file name and file ID SourceManager &SM = Context.getSourceManager(); if (const FileEntry *MainFile = SM.getFileEntryForID(SM.getMainFileID())) { |