[clang] [StaticAnalyzer] Migrate away from PointerUnion::{is,get} (NFC) (PR #118421)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 3 10:39:21 PST 2024
================
@@ -1068,10 +1068,10 @@ const VarRegion *MemRegionManager::getVarRegion(const VarDecl *D,
llvm::PointerUnion<const StackFrameContext *, const VarRegion *> V =
getStackOrCaptureRegionForDeclContext(LC, DC, D);
- if (V.is<const VarRegion*>())
- return V.get<const VarRegion*>();
+ if (isa<const VarRegion *>(V))
----------------
kazutakahirata wrote:
Switched to `dyn_cast_if_present` because `V` could be null.
https://github.com/llvm/llvm-project/pull/118421
More information about the cfe-commits
mailing list