aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LiveDebugVariables.cpp
diff options
context:
space:
mode:
authorHenry Wong <movietravelcode@outlook.com>2018-03-06 12:29:09 +0000
committerHenry Wong <movietravelcode@outlook.com>2018-03-06 12:29:09 +0000
commite47b89d1f866ae78034026c6477638dbcd48f025 (patch)
treeeb998f12bd3a989996925f44263a0de66e31291a /llvm/lib/CodeGen/LiveDebugVariables.cpp
parent5e5dd7067490cd98549a2015b7a521c862e68fd6 (diff)
downloadllvm-e47b89d1f866ae78034026c6477638dbcd48f025.zip
llvm-e47b89d1f866ae78034026c6477638dbcd48f025.tar.gz
llvm-e47b89d1f866ae78034026c6477638dbcd48f025.tar.bz2
[Analyzer] More accurate modeling about the increment operator of the operand with type bool.
Summary: There is a problem with analyzer that a wrong value is given when modeling the increment operator of the operand with type bool. After `rL307604` is applied, a unsigned overflow may occur. Example: ``` void func() { bool b = true; // unsigned overflow occur, 2 -> 0 U1b b++; } ``` The use of an operand of type bool with the ++ operators is deprecated but valid untill C++17. And if the operand of the increment operator is of type bool, it is set to true. This patch includes two parts: - If the operand of the increment operator is of type bool or type _Bool, set to true. - Modify `BasicValueFactory::getTruthValue()`, use `getIntWidth()` instead `getTypeSize()` and use `unsigned` instead `signed`. Reviewers: alexshap, NoQ, dcoughlin, george.karpenkov Reviewed By: NoQ Subscribers: xazax.hun, szepet, a.sidorin, cfe-commits, MTC Differential Revision: https://reviews.llvm.org/D43741 llvm-svn: 326776
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.cpp')
0 files changed, 0 insertions, 0 deletions