]> granicus.if.org Git - llvm/commitdiff
Fix uninitialized value warnings in StatepointBase constructors. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 9 May 2019 12:21:00 +0000 (12:21 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Thu, 9 May 2019 12:21:00 +0000 (12:21 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@360335 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/Statepoint.h

index aec0e9b6d87bea44b4f865c67b10bb85e74ed99d..89f130bc33517951608d5dc6bf660d2f44c48420 100644 (file)
@@ -76,14 +76,11 @@ class StatepointBase {
 
 protected:
   explicit StatepointBase(InstructionTy *I) {
-    if (isStatepoint(I)) {
-      StatepointCall = cast<CallBaseTy>(I);
-    }
+    StatepointCall = isStatepoint(I) ? cast<CallBaseTy>(I) : nullptr;
   }
 
   explicit StatepointBase(CallBaseTy *Call) {
-    if (isStatepoint(Call))
-      StatepointCall = Call;
+    StatepointCall = isStatepoint(Call) ? Call : nullptr;
   }
 
 public: