]> granicus.if.org Git - clang/commit
[analyzer] Refer to macro names in diagnostics for macros representing a literal
authorAnna Zaks <ganna@apple.com>
Thu, 15 Dec 2016 22:55:11 +0000 (22:55 +0000)
committerAnna Zaks <ganna@apple.com>
Thu, 15 Dec 2016 22:55:11 +0000 (22:55 +0000)
commit2c779f3b19a7f69149cd1c8c5d70abcea37f8244
tree487e5c00bae27fabc4c74a34acd0d01c2b5e768d
parent29a3ca1e0e2e5b62c18b662e407399312ec3abce
[analyzer] Refer to macro names in diagnostics for macros representing a literal

When a macro expending to a literal is used in a comparison, use the macro name
in the diagnostic rather than the literal. This improves readability of path
notes.

Added tests for various macro literals that could occur. Only BOOl, Int, and
NULL tests have changed behavior with this patch.

Differential Revision: https://reviews.llvm.org/D27726

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289884 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h
lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
test/Analysis/Inputs/system-header-simulator-objc.h
test/Analysis/Inputs/system-header-simulator.h
test/Analysis/diagnostics/macros.cpp [new file with mode: 0644]
test/Analysis/diagnostics/macros.m [new file with mode: 0644]