]> granicus.if.org Git - clang/commit
Reinstate r213348, reverted in r213395, with an additional bug fix and more
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 18 Jul 2014 22:13:40 +0000 (22:13 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 18 Jul 2014 22:13:40 +0000 (22:13 +0000)
commit23f37c4b1d1c4c6e5919ac54d416e98bd8bdda1a
tree72e793d37b07b7d60aea6e7edcc7be821946bf25
parentd098c0238243483b4f463f04730fc3ce492b90ea
Reinstate r213348, reverted in r213395, with an additional bug fix and more
thorough tests.

Original commit message:

[modules] Fix macro hiding bug exposed if:

 * A submodule of module A is imported into module B
 * Another submodule of module A that is not imported into B exports a macro
 * Some submodule of module B also exports a definition of the macro, and
   happens to be the first submodule of B that imports module A.

In this case, we would incorrectly determine that A's macro redefines B's
macro, and so we don't need to re-export B's macro at all.

This happens with the 'assert' macro in an LLVM self-host. =(

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213416 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/Serialization/ASTReader.h
lib/Lex/MacroInfo.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
test/Modules/Inputs/macro-hiding/a1.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/a2.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/b1.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/b2.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/c1.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/d1.h [new file with mode: 0644]
test/Modules/Inputs/macro-hiding/module.modulemap [new file with mode: 0644]
test/Modules/macro-hiding.cpp [new file with mode: 0644]