aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGen.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-05-12 18:56:03 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-05-12 18:56:03 +0000
commitd58e2d951e4a15c757e80fb4bb921752d209f706 (patch)
tree5d1a6dc3426c6b13abda0809a183d966e5c97d58 /llvm/lib/CodeGen/CodeGen.cpp
parent4bdd621e93053e2cf7f9b50f6cabed108b8834ca (diff)
downloadllvm-d58e2d951e4a15c757e80fb4bb921752d209f706.zip
llvm-d58e2d951e4a15c757e80fb4bb921752d209f706.tar.gz
llvm-d58e2d951e4a15c757e80fb4bb921752d209f706.tar.bz2
[modules] Simplify module macro handling in non-local-submodule-visibility mode.
When reaching the end of a module, we used to convert its macros to ModuleMacros but also leave them in the MacroDirective chain for the identifier. This meant that every lookup of such a macro would find two (identical) definitions. It also made it difficult to determine the correct owner for a macro when reaching the end of a module: the most recent MacroDirective in the chain could be from an #included submodule rather than the current module. Simplify this: whenever we convert a MacroDirective to a ModuleMacro when leaving a module, clear out the MacroDirective chain for that identifier, and just rely on the ModuleMacro to provide the macro definition information. (We don't want to do this for local submodule visibility mode, because in that mode we maintain a distinct MacroDirective chain for each submodule, and we need to keep around the prior MacroDirective in case we re-enter the submodule -- for instance, if its header is #included more than once in a module build, we need the include guard directive to stick around. But the problem doesn't arise in this case for the same reason: each submodule has its own MacroDirective chain, so the macros don't leak out of submodules in the first place.) llvm-svn: 302932
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
0 files changed, 0 insertions, 0 deletions