aboutsummaryrefslogtreecommitdiff
path: root/lib/Bitcode/Reader
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Bitcode/Reader')
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp
index fe0366fb62..50fc78c1c7 100644
--- a/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -342,7 +342,7 @@ Value *BitcodeReaderMDValueList::getValueFwdRef(unsigned Idx) {
resize(Idx + 1);
if (Value *V = MDValuePtrs[Idx]) {
- assert(V->getType() == Type::getMetadataTy(Context) && "Type mismatch in value table!");
+ assert(V->getType()->isMetadataTy() && "Type mismatch in value table!");
return V;
}
@@ -808,7 +808,7 @@ bool BitcodeReader::ParseMetadata() {
SmallVector<Value*, 8> Elts;
for (unsigned i = 0; i != Size; i += 2) {
const Type *Ty = getTypeByID(Record[i], false);
- if (Ty == Type::getMetadataTy(Context))
+ if (Ty->isMetadataTy())
Elts.push_back(MDValueList.getValueFwdRef(Record[i+1]));
else if (Ty != Type::getVoidTy(Context))
Elts.push_back(ValueList.getValueFwdRef(Record[i+1], Ty));
@@ -967,19 +967,19 @@ bool BitcodeReader::ParseConstants() {
case bitc::CST_CODE_FLOAT: { // FLOAT: [fpval]
if (Record.empty())
return Error("Invalid FLOAT record");
- if (CurTy == Type::getFloatTy(Context))
+ if (CurTy->isFloatTy())
V = ConstantFP::get(Context, APFloat(APInt(32, (uint32_t)Record[0])));
- else if (CurTy == Type::getDoubleTy(Context))
+ else if (CurTy->isDoubleTy())
V = ConstantFP::get(Context, APFloat(APInt(64, Record[0])));
- else if (CurTy == Type::getX86_FP80Ty(Context)) {
+ else if (CurTy->isX86_FP80Ty()) {
// Bits are not stored the same way as a normal i80 APInt, compensate.
uint64_t Rearrange[2];
Rearrange[0] = (Record[1] & 0xffffLL) | (Record[0] << 16);
Rearrange[1] = Record[0] >> 48;
V = ConstantFP::get(Context, APFloat(APInt(80, 2, Rearrange)));
- } else if (CurTy == Type::getFP128Ty(Context))
+ } else if (CurTy->isFP128Ty())
V = ConstantFP::get(Context, APFloat(APInt(128, 2, &Record[0]), true));
- else if (CurTy == Type::getPPC_FP128Ty(Context))
+ else if (CurTy->isPPC_FP128Ty())
V = ConstantFP::get(Context, APFloat(APInt(128, 2, &Record[0])));
else
V = UndefValue::get(CurTy);