Lines Matching refs:MacroNameTok

222 bool Preprocessor::CheckMacroName(Token &MacroNameTok, MacroUse isDefineUndef,  in CheckMacroName()  argument
225 if (MacroNameTok.is(tok::eod)) in CheckMacroName()
226 return Diag(MacroNameTok, diag::err_pp_missing_macro_name); in CheckMacroName()
228 IdentifierInfo *II = MacroNameTok.getIdentifierInfo(); in CheckMacroName()
231 std::string Spelling = getSpelling(MacroNameTok, &Invalid); in CheckMacroName()
233 return Diag(MacroNameTok, diag::err_pp_macro_not_identifier); in CheckMacroName()
237 return Diag(MacroNameTok, diag::err_pp_macro_not_identifier); in CheckMacroName()
241 Diag(MacroNameTok, getLangOpts().MicrosoftExt in CheckMacroName()
244 << II << MacroNameTok.getKind(); in CheckMacroName()
248 MacroNameTok.setIdentifierInfo(II); in CheckMacroName()
253 return Diag(MacroNameTok, diag::err_defined_macro_name); in CheckMacroName()
261 Diag(MacroNameTok, diag::ext_pp_undef_builtin_macro); in CheckMacroName()
267 SourceLocation MacroNameLoc = MacroNameTok.getLocation(); in CheckMacroName()
286 Diag(MacroNameTok, diag::warn_pp_macro_is_reserved_id); in CheckMacroName()
302 void Preprocessor::ReadMacroName(Token &MacroNameTok, MacroUse isDefineUndef, in ReadMacroName() argument
305 LexUnexpandedToken(MacroNameTok); in ReadMacroName()
307 if (MacroNameTok.is(tok::code_completion)) { in ReadMacroName()
311 LexUnexpandedToken(MacroNameTok); in ReadMacroName()
314 if (!CheckMacroName(MacroNameTok, isDefineUndef, ShadowFlag)) in ReadMacroName()
319 if (MacroNameTok.isNot(tok::eod)) { in ReadMacroName()
320 MacroNameTok.setKind(tok::eod); in ReadMacroName()
1419 Token MacroNameTok; in HandleMacroPublicDirective() local
1420 ReadMacroName(MacroNameTok, MU_Undef); in HandleMacroPublicDirective()
1423 if (MacroNameTok.is(tok::eod)) in HandleMacroPublicDirective()
1429 IdentifierInfo *II = MacroNameTok.getIdentifierInfo(); in HandleMacroPublicDirective()
1435 Diag(MacroNameTok, diag::err_pp_visibility_non_macro) << II; in HandleMacroPublicDirective()
1441 MacroNameTok.getLocation(), /*IsPublic=*/true)); in HandleMacroPublicDirective()
1446 Token MacroNameTok; in HandleMacroPrivateDirective() local
1447 ReadMacroName(MacroNameTok, MU_Undef); in HandleMacroPrivateDirective()
1450 if (MacroNameTok.is(tok::eod)) in HandleMacroPrivateDirective()
1456 IdentifierInfo *II = MacroNameTok.getIdentifierInfo(); in HandleMacroPrivateDirective()
1462 Diag(MacroNameTok, diag::err_pp_visibility_non_macro) << II; in HandleMacroPrivateDirective()
1468 MacroNameTok.getLocation(), /*IsPublic=*/false)); in HandleMacroPrivateDirective()
2266 Token MacroNameTok; in HandleDefineDirective() local
2268 ReadMacroName(MacroNameTok, MU_Define, &MacroShadowsKeyword); in HandleDefineDirective()
2271 if (MacroNameTok.is(tok::eod)) in HandleDefineDirective()
2274 Token LastTok = MacroNameTok; in HandleDefineDirective()
2281 MacroInfo *MI = AllocateMacroInfo(MacroNameTok.getLocation()); in HandleDefineDirective()
2292 CurPPLexer->MIOpt.SetDefinedMacro(MacroNameTok.getIdentifierInfo(), in HandleDefineDirective()
2293 MacroNameTok.getLocation()); in HandleDefineDirective()
2445 !isConfigurationPattern(MacroNameTok, MI, getLangOpts())) { in HandleDefineDirective()
2446 Diag(MacroNameTok, diag::warn_pp_macro_hides_keyword); in HandleDefineDirective()
2470 if (const MacroInfo *OtherMI=getMacroInfo(MacroNameTok.getIdentifierInfo())) { in HandleDefineDirective()
2483 isObjCProtectedMacro(MacroNameTok.getIdentifierInfo())) { in HandleDefineDirective()
2506 Diag(MacroNameTok, diag::ext_pp_redef_builtin_macro); in HandleDefineDirective()
2512 << MacroNameTok.getIdentifierInfo(); in HandleDefineDirective()
2521 appendDefMacroDirective(MacroNameTok.getIdentifierInfo(), MI); in HandleDefineDirective()
2534 Callbacks->MacroDefined(MacroNameTok, MD); in HandleDefineDirective()
2542 Token MacroNameTok; in HandleUndefDirective() local
2543 ReadMacroName(MacroNameTok, MU_Undef); in HandleUndefDirective()
2546 if (MacroNameTok.is(tok::eod)) in HandleUndefDirective()
2553 auto *II = MacroNameTok.getIdentifierInfo(); in HandleUndefDirective()
2559 Callbacks->MacroUndefined(MacroNameTok, MD); in HandleUndefDirective()
2572 appendMacroDirective(MacroNameTok.getIdentifierInfo(), in HandleUndefDirective()
2573 AllocateUndefMacroDirective(MacroNameTok.getLocation())); in HandleUndefDirective()
2590 Token MacroNameTok; in HandleIfdefDirective() local
2591 ReadMacroName(MacroNameTok); in HandleIfdefDirective()
2594 if (MacroNameTok.is(tok::eod)) { in HandleIfdefDirective()
2605 IdentifierInfo *MII = MacroNameTok.getIdentifierInfo(); in HandleIfdefDirective()
2616 CurPPLexer->MIOpt.EnterTopLevelIfndef(MII, MacroNameTok.getLocation()); in HandleIfdefDirective()
2627 Callbacks->Ifndef(DirectiveTok.getLocation(), MacroNameTok, MD); in HandleIfdefDirective()
2629 Callbacks->Ifdef(DirectiveTok.getLocation(), MacroNameTok, MD); in HandleIfdefDirective()