[all-commits] [llvm/llvm-project] ce763b: [analyzer] Fix performance of getTaintedSymbolsImp...
NagyDonat via All-commits
all-commits at lists.llvm.org
Tue Apr 23 01:20:56 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: ce763bff081f8e97c7c3610ed0f15f14d60e875f
https://github.com/llvm/llvm-project/commit/ce763bff081f8e97c7c3610ed0f15f14d60e875f
Author: NagyDonat <donat.nagy at ericsson.com>
Date: 2024-04-23 (Tue, 23 Apr 2024)
Changed paths:
M clang/lib/StaticAnalyzer/Checkers/Taint.cpp
Log Message:
-----------
[analyzer] Fix performance of getTaintedSymbolsImpl() (#89606)
Previously the function
```
std::vector<SymbolRef> taint::getTaintedSymbolsImpl(ProgramStateRef State,
const MemRegion *Reg,
TaintTagType K,
bool returnFirstOnly)
```
(one of the 4 overloaded variants under this name) was handling element
regions in a highly inefficient manner: it performed the "also examine
the super-region" step twice. (Once in the branch for element regions,
and once in the more general branch for all `SubRegion`s -- note that
`ElementRegion` is a subclass of `SubRegion`.)
As pointer arithmetic produces `ElementRegion`s, it's not too difficult
to get a chain of N nested element regions where this inefficient
recursion would produce 2^N calls.
This commit is essentially NFC, apart from the performance improvements
and the removal of (probably irrelevant) duplicate entries from the
return value of `getTaintedSymbols()` calls.
Fixes #89045
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list