[clang] [NFC][analyzer] Replace BlockInCriticalSection MutexDescriptor with CallDescriptionMap (PR #224230)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Thu Oct 1 04:27:04 PDT 2026
================
@@ -25,16 +25,43 @@
#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState_Fwd.h"
#include "clang/StaticAnalyzer/Core/PathSensitive/SVals.h"
#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include <iterator>
#include <utility>
-#include <variant>
using namespace clang;
using namespace ento;
+static const MemRegion *getFirstArgRegion(const CallEvent &Call) {
+ return Call.getArgSVal(0).getAsRegion();
+}
+
+static const MemRegion *getCXXThisRegion(const CallEvent &Call) {
+ return cast<CXXMemberCall>(Call).getCXXThisVal().getAsRegion();
+}
+
+static const MemRegion *getObjectUnderConstruction(const CallEvent &Call) {
+ if (std::optional<SVal> Object = Call.getReturnValueUnderConstruction())
+ return Object->getAsRegion();
+ return nullptr;
+}
+
+static const MemRegion *getCXXDestructorThisRegion(const CallEvent &Call) {
+ return cast<CXXDestructorCall>(Call).getCXXThisVal().getAsRegion();
----------------
NagyDonat wrote:
> It is frustrating that explicit dtor calls are not CXXDtorCalls
I also didn't know about this corner case :sweat_smile:
https://github.com/llvm/llvm-project/pull/224230
More information about the cfe-commits
mailing list