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
Showing
- include/clang/Serialization/ASTReader.h 3 additions, 2 deletionsinclude/clang/Serialization/ASTReader.h
- lib/Lex/MacroInfo.cpp 1 addition, 0 deletionslib/Lex/MacroInfo.cpp
- lib/Serialization/ASTReader.cpp 12 additions, 7 deletionslib/Serialization/ASTReader.cpp
- lib/Serialization/ASTWriter.cpp 17 additions, 1 deletionlib/Serialization/ASTWriter.cpp
- test/Modules/Inputs/macro-hiding/a1.h 1 addition, 0 deletionstest/Modules/Inputs/macro-hiding/a1.h
- test/Modules/Inputs/macro-hiding/a2.h 0 additions, 0 deletionstest/Modules/Inputs/macro-hiding/a2.h
- test/Modules/Inputs/macro-hiding/b1.h 0 additions, 0 deletionstest/Modules/Inputs/macro-hiding/b1.h
- test/Modules/Inputs/macro-hiding/b2.h 2 additions, 0 deletionstest/Modules/Inputs/macro-hiding/b2.h
- test/Modules/Inputs/macro-hiding/c1.h 2 additions, 0 deletionstest/Modules/Inputs/macro-hiding/c1.h
- test/Modules/Inputs/macro-hiding/d1.h 2 additions, 0 deletionstest/Modules/Inputs/macro-hiding/d1.h
- test/Modules/Inputs/macro-hiding/module.modulemap 14 additions, 0 deletionstest/Modules/Inputs/macro-hiding/module.modulemap
- test/Modules/macro-hiding.cpp 94 additions, 0 deletionstest/Modules/macro-hiding.cpp
Loading
Please register or sign in to comment