[clang] [analyzer] Generalize MemRegion::getDescriptiveName (PR #213991)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 5 05:22:15 PDT 2026
================
@@ -722,8 +722,8 @@ void CXXDerivedObjectRegion::printPrettyAsExpr(raw_ostream &os) const {
superRegion->printPrettyAsExpr(os);
}
-std::string MemRegion::getDescriptiveName(bool UseQuotes) const {
- std::string VariableName;
+std::string MemRegion::getDescriptiveName(bool UseQuotes,
+ bool AllowFallback) const {
----------------
NagyDonat wrote:
The "fallback" provided by this flag is not a single catch-all string (that could have been customized by the user) but fifteen lines of logic that can produce five kinds of fallback descriptions (that do not identify the memory region completely, but describe its kind).
The goal of this commit was that I wanted to place these fifteen lines of logic in a place where they are available for any checker -- letting the checker specify its own fallback name would defeat this goal. (If a checker wants to specify its own fallback name, it can easily use the default `AllowFallback=false` and then say `Description.empty() ? MyOwnFallback : Description`.)
https://github.com/llvm/llvm-project/pull/213991
More information about the cfe-commits
mailing list