[llvm] r372871 - Add missing ExplicitTy default initialization to ConstantExprKeyType constructors.

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 25 06:38:54 PDT 2019


Author: rksimon
Date: Wed Sep 25 06:38:54 2019
New Revision: 372871

URL: http://llvm.org/viewvc/llvm-project?rev=372871&view=rev
Log:
Add missing ExplicitTy default initialization to ConstantExprKeyType constructors.

Fixes cppcheck uninitialized variable warnings

Modified:
    llvm/trunk/lib/IR/ConstantsContext.h

Modified: llvm/trunk/lib/IR/ConstantsContext.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantsContext.h?rev=372871&r1=372870&r2=372871&view=diff
==============================================================================
--- llvm/trunk/lib/IR/ConstantsContext.h (original)
+++ llvm/trunk/lib/IR/ConstantsContext.h Wed Sep 25 06:38:54 2019
@@ -480,14 +480,16 @@ struct ConstantExprKeyType {
       : Opcode(CE->getOpcode()),
         SubclassOptionalData(CE->getRawSubclassOptionalData()),
         SubclassData(CE->isCompare() ? CE->getPredicate() : 0), Ops(Operands),
-        Indexes(CE->hasIndices() ? CE->getIndices() : ArrayRef<unsigned>()) {}
+        Indexes(CE->hasIndices() ? CE->getIndices() : ArrayRef<unsigned>()),
+        ExplicitTy(nullptr) {}
 
   ConstantExprKeyType(const ConstantExpr *CE,
                       SmallVectorImpl<Constant *> &Storage)
       : Opcode(CE->getOpcode()),
         SubclassOptionalData(CE->getRawSubclassOptionalData()),
         SubclassData(CE->isCompare() ? CE->getPredicate() : 0),
-        Indexes(CE->hasIndices() ? CE->getIndices() : ArrayRef<unsigned>()) {
+        Indexes(CE->hasIndices() ? CE->getIndices() : ArrayRef<unsigned>()),
+        ExplicitTy(nullptr) {
     assert(Storage.empty() && "Expected empty storage");
     for (unsigned I = 0, E = CE->getNumOperands(); I != E; ++I)
       Storage.push_back(CE->getOperand(I));




More information about the llvm-commits mailing list