[cfe-commits] r146393 - in /cfe/trunk: lib/Lex/PPLexerChange.cpp test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h

Douglas Gregor dgregor at apple.com
Mon Dec 12 10:47:40 PST 2011


Author: dgregor
Date: Mon Dec 12 12:47:39 2011
New Revision: 146393

URL: http://llvm.org/viewvc/llvm-project?rev=146393&view=rev
Log:
Don't mark include guard macros as implicitly private. This isn't
actually a terribly good heuristic, and the world is too horrible for
it to work.

Modified:
    cfe/trunk/lib/Lex/PPLexerChange.cpp
    cfe/trunk/test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h

Modified: cfe/trunk/lib/Lex/PPLexerChange.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPLexerChange.cpp?rev=146393&r1=146392&r2=146393&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPLexerChange.cpp (original)
+++ cfe/trunk/lib/Lex/PPLexerChange.cpp Mon Dec 12 12:47:39 2011
@@ -212,28 +212,8 @@
           CurPPLexer->MIOpt.GetControllingMacroAtEndOfFile()) {
       // Okay, this has a controlling macro, remember in HeaderFileInfo.
       if (const FileEntry *FE =
-            SourceMgr.getFileEntryForID(CurPPLexer->getFileID())) {
+            SourceMgr.getFileEntryForID(CurPPLexer->getFileID()))
         HeaderInfo.SetFileControllingMacro(FE, ControllingMacro);
-        
-        // Controlling macros are implicitly private.
-        if (MacroInfo *MI = getMacroInfo(
-                             const_cast<IdentifierInfo *>(ControllingMacro))) {
-          if (MI->getVisibilityLocation().isInvalid()) {
-            // FIXME: HACK! Mark controlling macros from system headers as
-            // exported, along with our own Clang headers. This is a gross
-            // hack to deal with the fact that system headers are included in
-            // many places within module headers, but are not themselves
-            // modularized.
-            if ((StringRef(FE->getName()).find("lib/clang") 
-                   == StringRef::npos) &&
-                (StringRef(FE->getName()).find("usr/include") 
-                   == StringRef::npos) &&
-                (StringRef(FE->getName()).find("usr/local/include") 
-                   == StringRef::npos))            
-              MI->setVisibility(false, SourceLocation());
-          }
-        }
-      }
     }
   }
 

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=146393&r1=146392&r2=146393&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 Mon Dec 12 12:47:39 2011
@@ -1,4 +1,5 @@
 #ifndef MODULE_SUBFRAMEWORK_H
 #define MODULE_SUBFRAMEWORK_H
+#__private_macro__ MODULE_SUBFRAMEWORK_H
 char *module_subframework;
 #endif





More information about the cfe-commits mailing list