aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-10-17 15:32:29 +0000
committerDouglas Gregor <dgregor@apple.com>2011-10-17 15:32:29 +0000
commitaa93a875605536d72a10359a0098396192b7d4ec (patch)
treee4f0f3e94714c6fe029f52e9e96f7e779ba26b30 /lib/Sema/Sema.cpp
parent05edf668f0984bfa2994ddc8bb7b78d9fb24cf11 (diff)
For modules, all macros that aren't include guards are implicitly
public. Add a __private_macro__ directive to hide a macro, similar to the __module_private__ declaration specifier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/Sema.cpp')
-rw-r--r--lib/Sema/Sema.cpp28
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp
index 533b21cb43..4a9d8a5efb 100644
--- a/lib/Sema/Sema.cpp
+++ b/lib/Sema/Sema.cpp
@@ -468,34 +468,6 @@ void Sema::ActOnEndOfTranslationUnit() {
}
if (TUKind == TU_Module) {
- // Mark any macros from system headers (in /usr/include) as exported, along
- // with our own Clang headers.
- // FIXME: This is a gross hack to deal with the fact that system headers
- // are #include'd in many places within module headers, but are not
- // themselves modularized. This doesn't actually work, but it lets us
- // focus on other issues for the moment.
- for (Preprocessor::macro_iterator M = PP.macro_begin(false),
- MEnd = PP.macro_end(false);
- M != MEnd; ++M) {
- if (M->second &&
- !M->second->isExported() &&
- !M->second->isBuiltinMacro()) {
- SourceLocation Loc = M->second->getDefinitionLoc();
- if (SourceMgr.isInSystemHeader(Loc)) {
- const FileEntry *File
- = SourceMgr.getFileEntryForID(SourceMgr.getFileID(Loc));
- if (File &&
- ((StringRef(File->getName()).find("lib/clang")
- != StringRef::npos) ||
- (StringRef(File->getName()).find("usr/include")
- != StringRef::npos) ||
- (StringRef(File->getName()).find("usr/local/include")
- != StringRef::npos)))
- M->second->setExportLocation(Loc);
- }
- }
- }
-
// Modules don't need any of the checking below.
TUScope = 0;
return;