[llvm] 2740b2d - Fix uninitialized value clang static analyzer warning. NFC.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 11 08:03:43 PST 2020


Author: Simon Pilgrim
Date: 2020-01-11T16:02:22Z
New Revision: 2740b2d5d5f0f56c87024555bdcae4f91e595ddb

URL: https://github.com/llvm/llvm-project/commit/2740b2d5d5f0f56c87024555bdcae4f91e595ddb
DIFF: https://github.com/llvm/llvm-project/commit/2740b2d5d5f0f56c87024555bdcae4f91e595ddb.diff

LOG: Fix uninitialized value clang static analyzer warning. NFC.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/CodeExtractor.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/CodeExtractor.cpp b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
index 0298ff9a395f..682af4a88d3e 100644
--- a/llvm/lib/Transforms/Utils/CodeExtractor.cpp
+++ b/llvm/lib/Transforms/Utils/CodeExtractor.cpp
@@ -805,7 +805,7 @@ Function *CodeExtractor::constructFunction(const ValueSet &inputs,
     dbgs() << ")\n";
   });
 
-  StructType *StructTy;
+  StructType *StructTy = nullptr;
   if (AggregateArgs && (inputs.size() + outputs.size() > 0)) {
     StructTy = StructType::get(M->getContext(), paramTy);
     paramTy.clear();


        


More information about the llvm-commits mailing list