[cfe-commits] r65148 - /cfe/trunk/Driver/CacheTokens.cpp
Ted Kremenek
kremenek at apple.com
Fri Feb 20 12:32:40 PST 2009
Author: kremenek
Date: Fri Feb 20 14:32:39 2009
New Revision: 65148
URL: http://llvm.org/viewvc/llvm-project?rev=65148&view=rev
Log:
PTH generation: Clear the cleaning bit for literals (whose spellings are cached).
Modified:
cfe/trunk/Driver/CacheTokens.cpp
Modified: cfe/trunk/Driver/CacheTokens.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/CacheTokens.cpp?rev=65148&r1=65147&r2=65148&view=diff
==============================================================================
--- cfe/trunk/Driver/CacheTokens.cpp (original)
+++ cfe/trunk/Driver/CacheTokens.cpp Fri Feb 20 14:32:39 2009
@@ -430,8 +430,12 @@
}
void PTHWriter::EmitToken(const Token& T) {
+ // When writing out the token data for literals, clear the NeedsCleaning flag.
+ uint32_t CleaningMask = T.isLiteral() ? ~((uint32_t)Token::NeedsCleaning):~0U;
+
+ // Emit the token kind, flags, and length.
Emit32(((uint32_t) T.getKind()) |
- (((uint32_t) T.getFlags()) << 8) |
+ ((((uint32_t) T.getFlags()) & CleaningMask) << 8)|
(((uint32_t) T.getLength()) << 16));
// Literals (strings, numbers, characters) get cached spellings.
@@ -443,7 +447,7 @@
// Get the string entry.
llvm::StringMapEntry<OffsetOpt> *E =
- &CachedStrs.GetOrCreateValue(s, s+spelling.size());
+ &CachedStrs.GetOrCreateValue(s, s+spelling.size());
if (!E->getValue().hasOffset()) {
E->getValue().setOffset(CurStrOffset);
More information about the cfe-commits
mailing list