aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/clang/lib/Lex/PPLexerChange.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/clang/lib/Lex/PPLexerChange.cpp')
-rw-r--r--contrib/llvm-project/clang/lib/Lex/PPLexerChange.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/llvm-project/clang/lib/Lex/PPLexerChange.cpp b/contrib/llvm-project/clang/lib/Lex/PPLexerChange.cpp
index 3b1b6df1dbae..8221db46e06a 100644
--- a/contrib/llvm-project/clang/lib/Lex/PPLexerChange.cpp
+++ b/contrib/llvm-project/clang/lib/Lex/PPLexerChange.cpp
@@ -368,8 +368,7 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
// Okay, this has a controlling macro, remember in HeaderFileInfo.
if (OptionalFileEntryRef FE = CurPPLexer->getFileEntry()) {
HeaderInfo.SetFileControllingMacro(*FE, ControllingMacro);
- if (MacroInfo *MI =
- getMacroInfo(const_cast<IdentifierInfo*>(ControllingMacro)))
+ if (MacroInfo *MI = getMacroInfo(ControllingMacro))
MI->setUsedForHeaderGuard(true);
if (const IdentifierInfo *DefinedMacro =
CurPPLexer->MIOpt.GetDefinedMacro()) {
@@ -805,7 +804,7 @@ Module *Preprocessor::LeaveSubmodule(bool ForPragma) {
llvm::SmallPtrSet<const IdentifierInfo*, 8> VisitedMacros;
for (unsigned I = Info.OuterPendingModuleMacroNames;
I != PendingModuleMacroNames.size(); ++I) {
- auto *II = const_cast<IdentifierInfo*>(PendingModuleMacroNames[I]);
+ auto *II = PendingModuleMacroNames[I];
if (!VisitedMacros.insert(II).second)
continue;
@@ -855,8 +854,8 @@ Module *Preprocessor::LeaveSubmodule(bool ForPragma) {
// Don't bother creating a module macro if it would represent a #undef
// that doesn't override anything.
if (Def || !Macro.getOverriddenMacros().empty())
- addModuleMacro(LeavingMod, II, Def,
- Macro.getOverriddenMacros(), IsNew);
+ addModuleMacro(LeavingMod, II, Def, Macro.getOverriddenMacros(),
+ IsNew);
if (!getLangOpts().ModulesLocalVisibility) {
// This macro is exposed to the rest of this compilation as a