[all-commits] [llvm/llvm-project] aef05a: [clang][dataflow][NFC] Eliminate `getStorageLocati...

martinboehme via All-commits all-commits at lists.llvm.org
Mon Aug 28 23:54:06 PDT 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: aef05a12329cf83c0a6fe46b464ab6ac08ee3439
  Author: Martin Braenne <mboehme at google.com>
  Date:   2023-08-29 (Tue, 29 Aug 2023)

  Changed paths:
    M clang/include/clang/Analysis/FlowSensitive/DataflowAnalysisContext.h
    M clang/lib/Analysis/FlowSensitive/DataflowAnalysisContext.cpp

  Log Message:
  [clang][dataflow][NFC] Eliminate `getStorageLocation()` / `setStorageLocation()` in `DataflowAnalysisContext`.

Instead, inline them into the `getStableStorageLocation()` overloads, which is the only place they were called from (and should be called from).

`getStorageLocation()` / `setStorageLocation()` were confusing because neither their name nor their documentation made reference to the fact that the storage location is stable.

It didn't make sense to keep these as private member functions either. The code for the two `getStableStorageLocation()` overloads has become only marginally more complex by inlining these functions, and the `Expr` version is actually more efficient because we only call `ignoreCFGOmittedNodes()` once instead of twice.

Reviewed By: ymandel, xazax.hun

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

More information about the All-commits mailing list