]> granicus.if.org Git - clang/commit
[modules] Fix incorrect diagnostic mapping computation when a module changes
authorRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 9 Feb 2018 01:15:13 +0000 (01:15 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Fri, 9 Feb 2018 01:15:13 +0000 (01:15 +0000)
commit945b03408215598c12dbddaa1e826cc796acf3f7
tree899ce9241b3043deefdf2d4e9a7203f33e989090
parent37031df06d0b18c853128a87d7648c625ca3a6e9
[modules] Fix incorrect diagnostic mapping computation when a module changes
diagnostic settings using _Pragma within a macro.

The AST writer had previously been assuming that all diagnostic state
transitions would occur within a FileID corresponding to a file. When a
diagnostic state change occured within a macro, it was unable to form a
location for that state change and would instead corrupt the diagnostic state
of the "root" node (and thus that of the main compilation).

Also introduce a "#pragma clang __debug diag_mapping" debugging utility
that I added to track this issue down.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324695 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/Diagnostic.h
include/clang/Basic/SourceManager.h
lib/Basic/Diagnostic.cpp
lib/Lex/Pragma.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
test/Modules/Inputs/diag_flags.h
test/Modules/diag-flags.cpp