[cfe-commits] r147469 - in /cfe/trunk: include/clang/Basic/TokenKinds.def lib/Basic/IdentifierTable.cpp lib/Lex/PPDirectives.cpp test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h test/Modules/Inputs/Module.framework/Headers/Module.h test/Modules/Inputs/macros.h test/Modules/macros.c

Douglas Gregor dgregor at apple.com
Tue Jan 3 11:48:17 PST 2012


Author: dgregor
Date: Tue Jan  3 13:48:16 2012
New Revision: 147469

URL: http://llvm.org/viewvc/llvm-project?rev=147469&view=rev
Log:
Re-uglify #public and #private to #__public_macro and #__private_macro.

Modified:
    cfe/trunk/include/clang/Basic/TokenKinds.def
    cfe/trunk/lib/Basic/IdentifierTable.cpp
    cfe/trunk/lib/Lex/PPDirectives.cpp
    cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h
    cfe/trunk/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h
    cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h
    cfe/trunk/test/Modules/Inputs/macros.h
    cfe/trunk/test/Modules/macros.c

Modified: cfe/trunk/include/clang/Basic/TokenKinds.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/TokenKinds.def?rev=147469&r1=147468&r2=147469&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/TokenKinds.def (original)
+++ cfe/trunk/include/clang/Basic/TokenKinds.def Tue Jan  3 13:48:16 2012
@@ -90,8 +90,8 @@
 PPKEYWORD(unassert)
 
 // Clang extensions
-PPKEYWORD(public)
-PPKEYWORD(private)
+PPKEYWORD(__public_macro)
+PPKEYWORD(__private_macro)
 
 //===----------------------------------------------------------------------===//
 // Language keywords.

Modified: cfe/trunk/lib/Basic/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/IdentifierTable.cpp?rev=147469&r1=147468&r2=147469&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/IdentifierTable.cpp (original)
+++ cfe/trunk/lib/Basic/IdentifierTable.cpp Tue Jan  3 13:48:16 2012
@@ -217,16 +217,18 @@
   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(14, '_', 'p', __public_macro);
+      
+  CASE(15, '_', 'p', __private_macro);
+
   CASE(16, '_', 'i', __include_macros);
 #undef CASE
 #undef HASH

Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=147469&r1=147468&r2=147469&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Tue Jan  3 13:48:16 2012
@@ -682,12 +682,12 @@
       //isExtension = true;  // FIXME: implement #unassert
       break;
         
-    case tok::pp_public:
+    case tok::pp___public_macro:
       if (getLangOptions().Modules)
         return HandleMacroPublicDirective(Result);
       break;
         
-    case tok::pp_private:
+    case tok::pp___private_macro:
       if (getLangOptions().Modules)
         return HandleMacroPrivateDirective(Result);
       break;
@@ -1052,8 +1052,8 @@
   if (MacroNameTok.is(tok::eod))
     return;
 
-  // Check to see if this is the last token on the #public line.
-  CheckEndOfDirective("public");
+  // Check to see if this is the last token on the #__public_macro line.
+  CheckEndOfDirective("__public_macro");
 
   // Okay, we finally have a valid identifier to undef.
   MacroInfo *MI = getMacroInfo(MacroNameTok.getIdentifierInfo());
@@ -1083,8 +1083,8 @@
   if (MacroNameTok.is(tok::eod))
     return;
   
-  // Check to see if this is the last token on the #private line.
-  CheckEndOfDirective("private");
+  // Check to see if this is the last token on the #__private_macro line.
+  CheckEndOfDirective("__private_macro");
   
   // Okay, we finally have a valid identifier to undef.
   MacroInfo *MI = getMacroInfo(MacroNameTok.getIdentifierInfo());

Modified: cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h?rev=147469&r1=147468&r2=147469&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h (original)
+++ cfe/trunk/test/Modules/Inputs/DependsOnModule.framework/Headers/DependsOnModule.h Tue Jan  3 13:48:16 2012
@@ -1,5 +1,5 @@
 #include <Module/Module.h> //expected-warning{{treating #include as an import of module 'Module'}}
 
 #define DEPENDS_ON_MODULE 1
-#private DEPENDS_ON_MODULE
+#__private_macro DEPENDS_ON_MODULE
 

Modified: cfe/trunk/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h?rev=147469&r1=147468&r2=147469&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h (original)
+++ cfe/trunk/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h Tue Jan  3 13:48:16 2012
@@ -1,5 +1,5 @@
 #ifndef MODULE_SUBFRAMEWORK_H
 #define MODULE_SUBFRAMEWORK_H
-#private MODULE_SUBFRAMEWORK_H
+#__private_macro MODULE_SUBFRAMEWORK_H
 char *module_subframework;
 #endif

Modified: cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h?rev=147469&r1=147468&r2=147469&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h (original)
+++ cfe/trunk/test/Modules/Inputs/Module.framework/Headers/Module.h Tue Jan  3 13:48:16 2012
@@ -14,7 +14,7 @@
 @end
 
 #define MODULE_H_MACRO 1
-#private MODULE_H_MACRO
+#__private_macro MODULE_H_MACRO
 
 #include <Module/Sub.h>
 #include <Module/Buried/Treasure.h>

Modified: cfe/trunk/test/Modules/Inputs/macros.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/macros.h?rev=147469&r1=147468&r2=147469&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/macros.h (original)
+++ cfe/trunk/test/Modules/Inputs/macros.h Tue Jan  3 13:48:16 2012
@@ -3,8 +3,8 @@
 #define FLOAT float
 #define DOUBLE double
 
-#public INTEGER
-#private FLOAT
-#private MODULE
+#__public_macro INTEGER
+#__private_macro FLOAT
+#__private_macro MODULE
 
 int (INTEGER);

Modified: cfe/trunk/test/Modules/macros.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/macros.c?rev=147469&r1=147468&r2=147469&view=diff
==============================================================================
--- cfe/trunk/test/Modules/macros.c (original)
+++ cfe/trunk/test/Modules/macros.c Tue Jan  3 13:48:16 2012
@@ -22,7 +22,7 @@
 double d;
 DOUBLE *dp = &d;
 
-#public WIBBLE // expected-error{{no macro named 'WIBBLE'}}
+#__public_macro WIBBLE // expected-error{{no macro named 'WIBBLE'}}
 
 void f() {
   // CHECK-PREPROCESSED: int i = INTEGER;





More information about the cfe-commits mailing list