diff options
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 2a1843eb6c..bad166f01e 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -892,8 +892,7 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo, } llvm::Instruction *CI = CS.getInstruction(); - if (Builder.isNamePreserving() && - CI->getType() != llvm::Type::getVoidTy(VMContext)) + if (Builder.isNamePreserving() && !CI->getType()->isVoidTy()) CI->setName("call"); switch (RetAI.getKind()) { diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 21b45583e5..d0c245369b 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -818,11 +818,11 @@ Value *ScalarExprEmitter::VisitPrePostIncDec(const UnaryOperator *E, NextVal = Builder.CreateAdd(InVal, NextVal, isInc ? "inc" : "dec"); } else { // Add the inc/dec to the real part. - if (InVal->getType() == llvm::Type::getFloatTy(VMContext)) + if (InVal->getType()->isFloatTy()) NextVal = llvm::ConstantFP::get(VMContext, llvm::APFloat(static_cast<float>(AmountVal))); - else if (InVal->getType() == llvm::Type::getDoubleTy(VMContext)) + else if (InVal->getType()->isDoubleTy()) NextVal = llvm::ConstantFP::get(VMContext, llvm::APFloat(static_cast<double>(AmountVal))); diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index f93c6048a7..fdc97409eb 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1088,7 +1088,7 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old, llvm::CallInst *NewCall = llvm::CallInst::Create(NewFn, ArgList.begin(), ArgList.end(), "", CI); ArgList.clear(); - if (NewCall->getType() != llvm::Type::getVoidTy(Old->getContext())) + if (!NewCall->getType()->isVoidTy()) NewCall->takeName(CI); NewCall->setAttributes(CI->getAttributes()); NewCall->setCallingConv(CI->getCallingConv()); |