HomePhabricator

[analyzer] Treat more const variables and fields as known contants.

Description

[analyzer] Treat more const variables and fields as known contants.

When loading from a variable or a field that is declared as constant,
the analyzer will try to inspect its initializer and constant-fold it.
Upon success, the analyzer would skip normal load and return the respective
constant.

The new behavior also applies to fields/elements of brace-initialized structures
and arrays.

Patch by Rafael Stahl!

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

Details

Committed
NoQMay 4 2018, 1:52 PM
Differential Revision
D45774: [analyzer] cover more cases where a Loc can be bound to constants
Parents
rL331555: [ELF][MIPS] Reorganize isMipsPIC routine. NFC
Branches
Unknown
Tags
Unknown