Initialize the components of this class. Otherwise GCC thinks that Array may be

used uninitialized, since it fails to understand that Array is only used when
SingleValue is not, and outputs a warning.  It also seems generally safer given
that the constructor is non-trivial and has plenty of early exits.

llvm-svn: 173242
This commit is contained in:
Duncan Sands 2013-01-23 09:09:50 +00:00
parent e4e2e59740
commit 5924545c0c
1 changed files with 2 additions and 1 deletions

View File

@ -3382,7 +3382,8 @@ SwitchLookupTable::SwitchLookupTable(Module &M,
ConstantInt *Offset,
const SmallVector<std::pair<ConstantInt*, Constant*>, 4>& Values,
Constant *DefaultValue,
const DataLayout *TD) {
const DataLayout *TD)
: SingleValue(0), BitMap(0), BitMapElementTy(0), Array(0) {
assert(Values.size() && "Can't build lookup table without values!");
assert(TableSize >= Values.size() && "Can't fit values in table!");