[clang] [clang][dataflow] Add `Environment::get<>()`. (PR #76027)

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 20 06:43:59 PST 2023


================
@@ -489,8 +489,7 @@ Environment Environment::pushCall(const CallExpr *Call) const {
   if (const auto *MethodCall = dyn_cast<CXXMemberCallExpr>(Call)) {
     if (const Expr *Arg = MethodCall->getImplicitObjectArgument()) {
       if (!isa<CXXThisExpr>(Arg))
-          Env.ThisPointeeLoc =
-              cast<RecordStorageLocation>(getStorageLocation(*Arg));
+        Env.ThisPointeeLoc = get<RecordStorageLocation>(*Arg);
----------------
ymand wrote:

should we check the result here, since the original code had a plain cast?

https://github.com/llvm/llvm-project/pull/76027


More information about the cfe-commits mailing list