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)
commite657bbdcbc8e9ed27398068d0f6ae073470043bf
tree536f17d29f9966f1583f3cbad5bb3cc0e98168dd
parentad2e0352f07903de00c2a21b524f40ff3297b861
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. =(

llvm-svn: 213416
12 files changed:
clang/include/clang/Serialization/ASTReader.h
clang/lib/Lex/MacroInfo.cpp
clang/lib/Serialization/ASTReader.cpp
clang/lib/Serialization/ASTWriter.cpp
clang/test/Modules/Inputs/macro-hiding/a1.h [new file with mode: 0644]
clang/test/Modules/Inputs/macro-hiding/a2.h [new file with mode: 0644]
clang/test/Modules/Inputs/macro-hiding/b1.h [new file with mode: 0644]
clang/test/Modules/Inputs/macro-hiding/b2.h [new file with mode: 0644]
clang/test/Modules/Inputs/macro-hiding/c1.h [new file with mode: 0644]
clang/test/Modules/Inputs/macro-hiding/d1.h [new file with mode: 0644]
clang/test/Modules/Inputs/macro-hiding/module.modulemap [new file with mode: 0644]
clang/test/Modules/macro-hiding.cpp [new file with mode: 0644]