]> granicus.if.org Git - clang/commitdiff
Don't mark include guard macros as implicitly private. This isn't
authorDouglas Gregor <dgregor@apple.com>
Mon, 12 Dec 2011 18:47:39 +0000 (18:47 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 12 Dec 2011 18:47:39 +0000 (18:47 +0000)
actually a terribly good heuristic, and the world is too horrible for
it to work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146393 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPLexerChange.cpp
test/Modules/Inputs/Module.framework/Frameworks/SubFramework.framework/Headers/SubFramework.h

index 37b62a6d0251a4112bfed4873d0cffb4f3e3bd64..24dda4f84c893eede720cd3f5c4dafcca57d74de 100644 (file)
@@ -212,28 +212,8 @@ bool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {
           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());
-          }
-        }
-      }
     }
   }
 
index 438fc9c516e9a2b1174d47e1b7fbf1d9fb0adb42..a7b33f346e1659d857f138108bdd1e9bffbf5938 100644 (file)
@@ -1,4 +1,5 @@
 #ifndef MODULE_SUBFRAMEWORK_H
 #define MODULE_SUBFRAMEWORK_H
+#__private_macro__ MODULE_SUBFRAMEWORK_H
 char *module_subframework;
 #endif