From 367df1ebbc9e2a9d7922cf81630552dcd0323734 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Wed, 25 Sep 2019 13:38:54 +0000 Subject: [PATCH] Add missing ExplicitTy default initialization to ConstantExprKeyType constructors. Fixes cppcheck uninitialized variable warnings llvm-svn: 372871 --- llvm/lib/IR/ConstantsContext.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/llvm/lib/IR/ConstantsContext.h b/llvm/lib/IR/ConstantsContext.h index 7614dab..75c6f83 100644 --- a/llvm/lib/IR/ConstantsContext.h +++ b/llvm/lib/IR/ConstantsContext.h @@ -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()) {} + Indexes(CE->hasIndices() ? CE->getIndices() : ArrayRef()), + ExplicitTy(nullptr) {} ConstantExprKeyType(const ConstantExpr *CE, SmallVectorImpl &Storage) : Opcode(CE->getOpcode()), SubclassOptionalData(CE->getRawSubclassOptionalData()), SubclassData(CE->isCompare() ? CE->getPredicate() : 0), - Indexes(CE->hasIndices() ? CE->getIndices() : ArrayRef()) { + Indexes(CE->hasIndices() ? CE->getIndices() : ArrayRef()), + ExplicitTy(nullptr) { assert(Storage.empty() && "Expected empty storage"); for (unsigned I = 0, E = CE->getNumOperands(); I != E; ++I) Storage.push_back(CE->getOperand(I)); -- 2.7.4