Lines Matching refs:MacroNameTok
240 bool Preprocessor::CheckMacroName(Token &MacroNameTok, MacroUse isDefineUndef, in CheckMacroName() argument
243 if (MacroNameTok.is(tok::eod)) in CheckMacroName()
244 return Diag(MacroNameTok, diag::err_pp_missing_macro_name); in CheckMacroName()
246 IdentifierInfo *II = MacroNameTok.getIdentifierInfo(); in CheckMacroName()
248 return Diag(MacroNameTok, diag::err_pp_macro_not_identifier); in CheckMacroName()
253 Diag(MacroNameTok, getLangOpts().MicrosoftExt in CheckMacroName()
256 << II << MacroNameTok.getKind(); in CheckMacroName()
263 return Diag(MacroNameTok, diag::err_defined_macro_name); in CheckMacroName()
271 Diag(MacroNameTok, diag::ext_pp_undef_builtin_macro); in CheckMacroName()
277 SourceLocation MacroNameLoc = MacroNameTok.getLocation(); in CheckMacroName()
296 Diag(MacroNameTok, diag::warn_pp_macro_is_reserved_id); in CheckMacroName()
312 void Preprocessor::ReadMacroName(Token &MacroNameTok, MacroUse isDefineUndef, in ReadMacroName() argument
315 LexUnexpandedToken(MacroNameTok); in ReadMacroName()
317 if (MacroNameTok.is(tok::code_completion)) { in ReadMacroName()
321 LexUnexpandedToken(MacroNameTok); in ReadMacroName()
324 if (!CheckMacroName(MacroNameTok, isDefineUndef, ShadowFlag)) in ReadMacroName()
329 if (MacroNameTok.isNot(tok::eod)) { in ReadMacroName()
330 MacroNameTok.setKind(tok::eod); in ReadMacroName()
1439 Token MacroNameTok; in HandleMacroPublicDirective() local
1440 ReadMacroName(MacroNameTok, MU_Undef); in HandleMacroPublicDirective()
1443 if (MacroNameTok.is(tok::eod)) in HandleMacroPublicDirective()
1449 IdentifierInfo *II = MacroNameTok.getIdentifierInfo(); in HandleMacroPublicDirective()
1455 Diag(MacroNameTok, diag::err_pp_visibility_non_macro) << II; in HandleMacroPublicDirective()
1461 MacroNameTok.getLocation(), /*isPublic=*/true)); in HandleMacroPublicDirective()
1466 Token MacroNameTok; in HandleMacroPrivateDirective() local
1467 ReadMacroName(MacroNameTok, MU_Undef); in HandleMacroPrivateDirective()
1470 if (MacroNameTok.is(tok::eod)) in HandleMacroPrivateDirective()
1476 IdentifierInfo *II = MacroNameTok.getIdentifierInfo(); in HandleMacroPrivateDirective()
1482 Diag(MacroNameTok, diag::err_pp_visibility_non_macro) << II; in HandleMacroPrivateDirective()
1488 MacroNameTok.getLocation(), /*isPublic=*/false)); in HandleMacroPrivateDirective()
2523 const Token &MacroNameTok, const bool ImmediatelyAfterHeaderGuard) { in ReadOptionalMacroParameterListAndBody() argument
2525 Token LastTok = MacroNameTok; in ReadOptionalMacroParameterListAndBody()
2527 MacroInfo *const MI = AllocateMacroInfo(MacroNameTok.getLocation()); in ReadOptionalMacroParameterListAndBody()
2549 CurPPLexer->MIOpt.SetDefinedMacro(MacroNameTok.getIdentifierInfo(), in ReadOptionalMacroParameterListAndBody()
2550 MacroNameTok.getLocation()); in ReadOptionalMacroParameterListAndBody()
2755 Token MacroNameTok; in HandleDefineDirective() local
2757 ReadMacroName(MacroNameTok, MU_Define, &MacroShadowsKeyword); in HandleDefineDirective()
2760 if (MacroNameTok.is(tok::eod)) in HandleDefineDirective()
2768 MacroNameTok, ImmediatelyAfterHeaderGuard); in HandleDefineDirective()
2773 !isConfigurationPattern(MacroNameTok, MI, getLangOpts())) { in HandleDefineDirective()
2774 Diag(MacroNameTok, diag::warn_pp_macro_hides_keyword); in HandleDefineDirective()
2792 const MacroInfo *OtherMI = getMacroInfo(MacroNameTok.getIdentifierInfo()); in HandleDefineDirective()
2796 << MacroNameTok.getIdentifierInfo(); in HandleDefineDirective()
2804 if (const MacroInfo *OtherMI=getMacroInfo(MacroNameTok.getIdentifierInfo())) { in HandleDefineDirective()
2817 isObjCProtectedMacro(MacroNameTok.getIdentifierInfo())) { in HandleDefineDirective()
2840 Diag(MacroNameTok, diag::ext_pp_redef_builtin_macro); in HandleDefineDirective()
2846 << MacroNameTok.getIdentifierInfo(); in HandleDefineDirective()
2855 appendDefMacroDirective(MacroNameTok.getIdentifierInfo(), MI); in HandleDefineDirective()
2871 Callbacks->MacroDefined(MacroNameTok, MD); in HandleDefineDirective()
2879 Token MacroNameTok; in HandleUndefDirective() local
2880 ReadMacroName(MacroNameTok, MU_Undef); in HandleUndefDirective()
2883 if (MacroNameTok.is(tok::eod)) in HandleUndefDirective()
2890 auto *II = MacroNameTok.getIdentifierInfo(); in HandleUndefDirective()
2902 Undef = AllocateUndefMacroDirective(MacroNameTok.getLocation()); in HandleUndefDirective()
2908 Callbacks->MacroUndefined(MacroNameTok, MD, Undef); in HandleUndefDirective()
2930 Token MacroNameTok; in HandleIfdefDirective() local
2931 ReadMacroName(MacroNameTok); in HandleIfdefDirective()
2934 if (MacroNameTok.is(tok::eod)) { in HandleIfdefDirective()
2946 IdentifierInfo *MII = MacroNameTok.getIdentifierInfo(); in HandleIfdefDirective()
2957 CurPPLexer->MIOpt.EnterTopLevelIfndef(MII, MacroNameTok.getLocation()); in HandleIfdefDirective()
2968 Callbacks->Ifndef(DirectiveTok.getLocation(), MacroNameTok, MD); in HandleIfdefDirective()
2970 Callbacks->Ifdef(DirectiveTok.getLocation(), MacroNameTok, MD); in HandleIfdefDirective()