This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Disable direct binding from list initialization for constant arrays of local storage duration.
AbandonedPublic

Authored by ASDenysPetrov on Jul 29 2021, 7:03 AM.

Details

Summary

Ignore direct bindings for constant arrays of local storage duration with list initialization. Constant arrays don't change their values during a lifetime. Therefore, we don't have to bind values directly for each array element. Retrieve values from list initialization on-demand as it currently works for arrays of global storage duration (See https://reviews.llvm.org/D106681 for details).

Example: const int arr[42] = {1,2,3,4};.
We can get values directly from list initializaion in any time, no matter whether the array has global or local storage duration. Previously it works only for global arrays.

Diff Detail

Event Timeline

ASDenysPetrov created this revision.Jul 29 2021, 7:03 AM
ASDenysPetrov requested review of this revision.Jul 29 2021, 7:03 AM

Fixed clang-tidy complaints.

Refined code a bit.

Fixed clang-tidy complaints.

ASDenysPetrov abandoned this revision.Sep 3 2021, 4:24 AM

This patch is currently irrelevant after last changes in the parent revision. It's going to be reworked or permanently abandoned.