diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Basic/IdentifierTable.cpp | 7 | ||||
-rw-r--r-- | lib/Lex/PPDirectives.cpp | 27 | ||||
-rw-r--r-- | lib/Parse/ParseObjc.cpp | 6 |
3 files changed, 24 insertions, 16 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index 690a1f5a84..4368ff712c 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -216,18 +216,17 @@ tok::PPKeywordKind IdentifierInfo::getPPKeywordID() const { CASE( 6, 'i', 'n', ifndef); CASE( 6, 'i', 'p', import); CASE( 6, 'p', 'a', pragma); - + CASE( 6, 'p', 'b', public); + CASE( 7, 'd', 'f', defined); CASE( 7, 'i', 'c', include); + CASE( 7, 'p', 'i', private); CASE( 7, 'w', 'r', warning); CASE( 8, 'u', 'a', unassert); CASE(12, 'i', 'c', include_next); CASE(16, '_', 'i', __include_macros); - CASE(16, '_', 'e', __export_macro__); - - CASE(17, '_', 'p', __private_macro__); #undef CASE #undef HASH } diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 2dfae872e2..04d92b8a29 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -682,10 +682,15 @@ TryAgain: //isExtension = true; // FIXME: implement #unassert break; - case tok::pp___export_macro__: - return HandleMacroExportDirective(Result); - case tok::pp___private_macro__: - return HandleMacroPrivateDirective(Result); + case tok::pp_public: + if (getLangOptions().Modules) + return HandleMacroPublicDirective(Result); + break; + + case tok::pp_private: + if (getLangOptions().Modules) + return HandleMacroPrivateDirective(Result); + break; } break; } @@ -1038,8 +1043,8 @@ void Preprocessor::HandleIdentSCCSDirective(Token &Tok) { } } -/// \brief Handle a #__export_macro__ directive. -void Preprocessor::HandleMacroExportDirective(Token &Tok) { +/// \brief Handle a #public directive. +void Preprocessor::HandleMacroPublicDirective(Token &Tok) { Token MacroNameTok; ReadMacroName(MacroNameTok, 2); @@ -1047,8 +1052,8 @@ void Preprocessor::HandleMacroExportDirective(Token &Tok) { if (MacroNameTok.is(tok::eod)) return; - // Check to see if this is the last token on the #__export_macro__ line. - CheckEndOfDirective("__export_macro__"); + // Check to see if this is the last token on the #public line. + CheckEndOfDirective("public"); // Okay, we finally have a valid identifier to undef. MacroInfo *MI = getMacroInfo(MacroNameTok.getIdentifierInfo()); @@ -1069,7 +1074,7 @@ void Preprocessor::HandleMacroExportDirective(Token &Tok) { MI->setChangedAfterLoad(); } -/// \brief Handle a #__private_macro__ directive. +/// \brief Handle a #private directive. void Preprocessor::HandleMacroPrivateDirective(Token &Tok) { Token MacroNameTok; ReadMacroName(MacroNameTok, 2); @@ -1078,8 +1083,8 @@ void Preprocessor::HandleMacroPrivateDirective(Token &Tok) { if (MacroNameTok.is(tok::eod)) return; - // Check to see if this is the last token on the #__private_macro__ line. - CheckEndOfDirective("__private_macro__"); + // Check to see if this is the last token on the #private line. + CheckEndOfDirective("private"); // Okay, we finally have a valid identifier to undef. MacroInfo *MI = getMacroInfo(MacroNameTok.getIdentifierInfo()); diff --git a/lib/Parse/ParseObjc.cpp b/lib/Parse/ParseObjc.cpp index a2994a3312..3ecdae2978 100644 --- a/lib/Parse/ParseObjc.cpp +++ b/lib/Parse/ParseObjc.cpp @@ -67,7 +67,11 @@ Parser::DeclGroupPtrTy Parser::ParseObjCAtDirectives() { SingleDecl = ParseObjCPropertyDynamic(AtLoc); break; case tok::objc_import: - return ParseModuleImport(AtLoc); + if (getLang().Modules) + return ParseModuleImport(AtLoc); + + // Fall through + default: Diag(AtLoc, diag::err_unexpected_at); SkipUntil(tok::semi); |