summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-07-21 23:30:30 +0000
committerDan Gohman <gohman@apple.com>2008-07-21 23:30:30 +0000
commitd5d24f63fd2096a14aa4aedeaa49d370030a5375 (patch)
tree164ec53e01ba6f90a6c27f8f00540fe04316e84c /llvm/lib/Bitcode/Reader
parentf81bd701779bcc3dcaba11c306afd69715043163 (diff)
downloadbcm5719-llvm-d5d24f63fd2096a14aa4aedeaa49d370030a5375.tar.gz
bcm5719-llvm-d5d24f63fd2096a14aa4aedeaa49d370030a5375.zip
InsertValue and ExtractValue constant expressions are always
folded. Remove code that handled the case where they aren't folded, and remove bitcode reader/writer support for them. llvm-svn: 53887
Diffstat (limited to 'llvm/lib/Bitcode/Reader')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp41
1 files changed, 0 insertions, 41 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index a8c62be88fc..3e2af4f1725 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -770,47 +770,6 @@ bool BitcodeReader::ParseConstants() {
V = ConstantExpr::getGetElementPtr(Elts[0], &Elts[1], Elts.size()-1);
break;
}
- case bitc::CST_CODE_CE_EXTRACTVAL: {
- // CE_EXTRACTVAL: [opty, opval, n x indices]
- const Type *AggTy = getTypeByID(Record[0]);
- if (!AggTy || !AggTy->isAggregateType())
- return Error("Invalid CE_EXTRACTVAL record");
- Constant *Agg = ValueList.getConstantFwdRef(Record[1], AggTy);
- SmallVector<unsigned, 4> Indices;
- for (unsigned i = 2, e = Record.size(); i != e; ++i) {
- uint64_t Index = Record[i];
- if ((unsigned)Index != Index)
- return Error("Invalid CE_EXTRACTVAL record");
- Indices.push_back((unsigned)Index);
- }
- if (!ExtractValueInst::getIndexedType(AggTy,
- Indices.begin(), Indices.end()))
- return Error("Invalid CE_EXTRACTVAL record");
- V = ConstantExpr::getExtractValue(Agg, &Indices[0], Indices.size());
- break;
- }
- case bitc::CST_CODE_CE_INSERTVAL: {
- // CE_INSERTVAL: [opty, opval, opty, opval, n x indices]
- const Type *AggTy = getTypeByID(Record[0]);
- if (!AggTy || !AggTy->isAggregateType())
- return Error("Invalid CE_INSERTVAL record");
- Constant *Agg = ValueList.getConstantFwdRef(Record[1], AggTy);
- const Type *ValTy = getTypeByID(Record[2]);
- Constant *Val = ValueList.getConstantFwdRef(Record[3], ValTy);
- SmallVector<unsigned, 4> Indices;
- for (unsigned i = 4, e = Record.size(); i != e; ++i) {
- uint64_t Index = Record[i];
- if ((unsigned)Index != Index)
- return Error("Invalid CE_INSERTVAL record");
- Indices.push_back((unsigned)Index);
- }
- if (ExtractValueInst::getIndexedType(AggTy,
- Indices.begin(),
- Indices.end()) != ValTy)
- return Error("Invalid CE_INSERTVAL record");
- V = ConstantExpr::getInsertValue(Agg, Val, &Indices[0], Indices.size());
- break;
- }
case bitc::CST_CODE_CE_SELECT: // CE_SELECT: [opval#, opval#, opval#]
if (Record.size() < 3) return Error("Invalid CE_SELECT record");
V = ConstantExpr::getSelect(ValueList.getConstantFwdRef(Record[0],
OpenPOWER on IntegriCloud