[clang] [StaticAnalyzer] Migrate away from PointerUnion::{is,get} (NFC) (PR #118421)
Balazs Benics via cfe-commits
cfe-commits at lists.llvm.org
Mon Dec 2 23:17:22 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))
----------------
steakhal wrote:
I wonder if the more canonical way would be to use dyn_cast here and return the result.
https://github.com/llvm/llvm-project/pull/118421
More information about the cfe-commits
mailing list