Use new predicates for some type equality tests.

llvm-svn: 83303
This commit is contained in:
Benjamin Kramer
2009-10-05 13:47:21 +00:00
parent e7178953f9
commit dde0fee82e
3 changed files with 4 additions and 5 deletions

View File

@@ -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()) {

View File

@@ -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)));

View File

@@ -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());