From cf49b7f7c9a1a9c6276928a6089f1d22dd3d88bf Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Thu, 9 May 2019 12:21:00 +0000 Subject: [PATCH] Fix uninitialized value warnings in StatepointBase constructors. NFCI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360335 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/IR/Statepoint.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/include/llvm/IR/Statepoint.h b/include/llvm/IR/Statepoint.h index aec0e9b6d87..89f130bc335 100644 --- a/include/llvm/IR/Statepoint.h +++ b/include/llvm/IR/Statepoint.h @@ -76,14 +76,11 @@ class StatepointBase { protected: explicit StatepointBase(InstructionTy *I) { - if (isStatepoint(I)) { - StatepointCall = cast(I); - } + StatepointCall = isStatepoint(I) ? cast(I) : nullptr; } explicit StatepointBase(CallBaseTy *Call) { - if (isStatepoint(Call)) - StatepointCall = Call; + StatepointCall = isStatepoint(Call) ? Call : nullptr; } public: -- 2.40.0