aboutsummaryrefslogtreecommitdiff
path: root/Driver/CacheTokens.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-02-11 23:34:32 +0000
committerTed Kremenek <kremenek@apple.com>2009-02-11 23:34:32 +0000
commita4bd8eb4d6d4b625f6bbb62fc180b02eab6433ed (patch)
tree92861ea48582ae6f93d51254eda59f5dcf4d146c /Driver/CacheTokens.cpp
parent1a35fdee6c1c86dc5f56db7738695aad21a3c488 (diff)
PTH: Have meta data be at the beginning of the PTH file, not the end.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64338 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/CacheTokens.cpp')
-rw-r--r--Driver/CacheTokens.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/Driver/CacheTokens.cpp b/Driver/CacheTokens.cpp
index d8a1fe1db1..6b9f96e981 100644
--- a/Driver/CacheTokens.cpp
+++ b/Driver/CacheTokens.cpp
@@ -517,8 +517,10 @@ void PTHWriter::GeneratePTH() {
// Generate the prologue.
Out << "cfe-pth";
Emit32(PTHManager::Version);
- Offset JumpOffset = Out.tell();
- Emit32(0);
+
+ // Leave 4 words for the prologue.
+ Offset PrologueOffset = Out.tell();
+ for (unsigned i = 0; i < 4 * sizeof(uint32_t); ++i) Emit8(0);
// Iterate over all the files in SourceManager. Create a lexer
// for each file and cache the tokens.
@@ -554,16 +556,12 @@ void PTHWriter::GeneratePTH() {
// Write out the file table.
Offset FileTableOff = EmitFileTable();
- // Finally, write out the offset table at the end.
- Offset JumpTargetOffset = Out.tell();
+ // Finally, write the prologue.
+ Out.seek(PrologueOffset);
Emit32(IdTableOff.first);
Emit32(IdTableOff.second);
Emit32(FileTableOff);
Emit32(SpellingOff);
-
- // Now write the offset in the prologue.
- Out.seek(JumpOffset);
- Emit32(JumpTargetOffset);
}
void clang::CacheTokens(Preprocessor& PP, const std::string& OutFile) {