No need to call setIdentifierInfo() after LookUpIdentifierInfo() which LookUpIdentifierInfo() will automatically do
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98435 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/CacheTokens.cpp b/lib/Frontend/CacheTokens.cpp
index c845d56..ab5465a 100644
--- a/lib/Frontend/CacheTokens.cpp
+++ b/lib/Frontend/CacheTokens.cpp
@@ -295,7 +295,7 @@
}
if (Tok.is(tok::identifier)) {
- Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
+ PP.LookUpIdentifierInfo(Tok);
EmitToken(Tok);
continue;
}
@@ -321,7 +321,6 @@
}
IdentifierInfo* II = PP.LookUpIdentifierInfo(Tok);
- Tok.setIdentifierInfo(II);
tok::PPKeywordKind K = II->getPPKeywordID();
ParsingPreprocessorDirective = true;
@@ -344,7 +343,7 @@
L.setParsingPreprocessorDirective(false);
assert(!Tok.isAtStartOfLine());
if (Tok.is(tok::identifier))
- Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
+ PP.LookUpIdentifierInfo(Tok);
break;
}
diff --git a/lib/Frontend/RewriteMacros.cpp b/lib/Frontend/RewriteMacros.cpp
index 0bcbd4f..954e8e2 100644
--- a/lib/Frontend/RewriteMacros.cpp
+++ b/lib/Frontend/RewriteMacros.cpp
@@ -79,7 +79,7 @@
// up the indentifier info. This is important for equality comparison of
// identifier tokens.
if (RawTok.is(tok::identifier) && !RawTok.getIdentifierInfo())
- RawTok.setIdentifierInfo(PP.LookUpIdentifierInfo(RawTok));
+ PP.LookUpIdentifierInfo(RawTok);
RawTokens.push_back(RawTok);
} while (RawTok.isNot(tok::eof));