diff options
| author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-21 10:49:05 +0000 | 
|---|---|---|
| committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-21 10:49:05 +0000 | 
| commit | 2f12f10af369d468b14617276446166383d692ed (patch) | |
| tree | 2caca31db4facdc95c23930c0c745c8ef0dee97d /lib/Bitcode/Reader/BitcodeReader.cpp | |
| parent | c69102774f9739c81ae1285ed9ae62405071c63c (diff) | |
Notes
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp')
| -rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index a32883720be3..b9453c90b583 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -293,6 +293,8 @@ void BitcodeReaderValueList::ResolveConstantForwardRefs() {        } else if (ConstantStruct *UserCS = dyn_cast<ConstantStruct>(UserC)) {          NewC = ConstantStruct::get(Context, &NewOps[0], NewOps.size(),                                           UserCS->getType()->isPacked()); +      } else if (ConstantUnion *UserCU = dyn_cast<ConstantUnion>(UserC)) { +        NewC = ConstantUnion::get(UserCU->getType(), NewOps[0]);        } else if (isa<ConstantVector>(UserC)) {          NewC = ConstantVector::get(&NewOps[0], NewOps.size());        } else { @@ -1015,6 +1017,11 @@ bool BitcodeReader::ParseConstants() {            Elts.push_back(ValueList.getConstantFwdRef(Record[i],                                                       STy->getElementType(i)));          V = ConstantStruct::get(STy, Elts); +      } else if (const UnionType *UnTy = dyn_cast<UnionType>(CurTy)) { +        uint64_t Index = Record[0]; +        Constant *Val = ValueList.getConstantFwdRef(Record[1], +                                        UnTy->getElementType(Index)); +        V = ConstantUnion::get(UnTy, Val);        } else if (const ArrayType *ATy = dyn_cast<ArrayType>(CurTy)) {          const Type *EltTy = ATy->getElementType();          for (unsigned i = 0; i != Size; ++i)  | 
