diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-05-01 01:53:09 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-05-01 01:53:09 +0000 |
commit | a7e2cc684fee41abe367205521bf225dd3d582c0 (patch) | |
tree | 181a89be83c538a615bd2a1cf9200826c848960a /clang/lib/Lex/PPMacroExpansion.cpp | |
parent | 65ace9daa36051aeeb8140bce8e154c61374938f (diff) | |
download | bcm5719-llvm-a7e2cc684fee41abe367205521bf225dd3d582c0.tar.gz bcm5719-llvm-a7e2cc684fee41abe367205521bf225dd3d582c0.zip |
[modules] Start moving the module visibility information off the Module itself.
It has no place there; it's not a property of the Module, and it makes
restoring the visibility set when we leave a submodule more difficult.
llvm-svn: 236300
Diffstat (limited to 'clang/lib/Lex/PPMacroExpansion.cpp')
-rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index fca3f8b97ce..edeed42c17e 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -124,9 +124,9 @@ ModuleMacro *Preprocessor::getModuleMacro(Module *Mod, IdentifierInfo *II) { void Preprocessor::updateModuleMacroInfo(const IdentifierInfo *II, ModuleMacroInfo &Info) { - assert(Info.ActiveModuleMacrosGeneration != MacroVisibilityGeneration && + assert(Info.ActiveModuleMacrosGeneration != VisibleModules.getGeneration() && "don't need to update this macro name info"); - Info.ActiveModuleMacrosGeneration = MacroVisibilityGeneration; + Info.ActiveModuleMacrosGeneration = VisibleModules.getGeneration(); auto Leaf = LeafModuleMacros.find(II); if (Leaf == LeafModuleMacros.end()) { @@ -146,7 +146,7 @@ void Preprocessor::updateModuleMacroInfo(const IdentifierInfo *II, Leaf->second.end()); while (!Worklist.empty()) { auto *MM = Worklist.pop_back_val(); - if (MM->getOwningModule()->NameVisibility >= Module::MacrosVisible) { + if (VisibleModules.isVisible(MM->getOwningModule())) { // We only care about collecting definitions; undefinitions only act // to override other definitions. if (MM->getMacroInfo()) @@ -236,7 +236,7 @@ void Preprocessor::dumpMacroInfo(const IdentifierInfo *II) { if (Active.count(MM)) llvm::errs() << " active"; - else if (MM->getOwningModule()->NameVisibility < Module::MacrosVisible) + else if (!VisibleModules.isVisible(MM->getOwningModule())) llvm::errs() << " hidden"; else llvm::errs() << " overridden"; |