summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-01-03 18:24:14 +0000
committerDouglas Gregor <dgregor@apple.com>2012-01-03 18:24:14 +0000
commit0bf886d41a66a1d1c0ee4678257bf38b7e46fae2 (patch)
tree74659669ab71f21c29e7e3c476871939f813af16 /clang/lib/Lex/PPDirectives.cpp
parentbc26b2d162c3376dd27986cdd706e5df8a1d87d4 (diff)
downloadbcm5719-llvm-0bf886d41a66a1d1c0ee4678257bf38b7e46fae2.tar.gz
bcm5719-llvm-0bf886d41a66a1d1c0ee4678257bf38b7e46fae2.zip
Under -fmodules, accept #public <macroname> and #private <macroname>
to make a macro public (the default for headers) or private, respectively. llvm-svn: 147455
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 2dfae872e2f..04d92b8a291 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/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());
OpenPOWER on IntegriCloud