[all-commits] [llvm/llvm-project] 44e803: [analyzer][NFCI] Move a block from `getBindingForE...

Denys Petrov via All-commits all-commits at lists.llvm.org
Mon Oct 25 05:14:26 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 44e803ef6d41770adf309960e37bcc6a75dbbe2c
      https://github.com/llvm/llvm-project/commit/44e803ef6d41770adf309960e37bcc6a75dbbe2c
  Author: Denys Petrov <dpetrov at accesssoftek.com>
  Date:   2021-10-25 (Mon, 25 Oct 2021)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/RegionStore.cpp
    M clang/test/Analysis/initialization.c
    M clang/test/Analysis/initialization.cpp

  Log Message:
  -----------
  [analyzer][NFCI] Move a block from `getBindingForElement` to separate functions

Summary:
1. Improve readability by moving deeply nested block of code from RegionStoreManager::getBindingForElement to new separate functions:
- getConstantValFromConstArrayInitializer;
- getSValFromInitListExpr.
2. Handle the case when index is a symbolic value. Write specific test cases.
3. Add test cases when there is no initialization expression presented.
This patch implies to make next patches clearer and easier for review process.

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


  Commit: 3b1165ba3d15de83699be3ff4be3b6adf4d6e977
      https://github.com/llvm/llvm-project/commit/3b1165ba3d15de83699be3ff4be3b6adf4d6e977
  Author: Denys Petrov <dpetrov at accesssoftek.com>
  Date:   2021-10-25 (Mon, 25 Oct 2021)

  Changed paths:
    M clang/lib/StaticAnalyzer/Core/RegionStore.cpp
    M clang/test/Analysis/initialization.c

  Log Message:
  -----------
  [analyzer] Retrieve incomplete array extent from its redeclaration.

Summary: Fix a case when the extent can not be retrieved correctly from incomplete array declaration. Use redeclaration to get the array extent.

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


Compare: https://github.com/llvm/llvm-project/compare/7bce6bb34b70...3b1165ba3d15


More information about the All-commits mailing list