aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-10-05 13:47:21 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-10-05 13:47:21 +0000
commitffbb15e54a6dc120087003d1e42448b8705bd58a (patch)
tree63e67f95c7d624eea19572b53174e38f842c8578 /lib/CodeGen
parent1bb15a9afa73687225782ca6aa75c8530b4428fb (diff)
Use new predicates for some type equality tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83303 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/CGCall.cpp3
-rw-r--r--lib/CodeGen/CGExprScalar.cpp4
-rw-r--r--lib/CodeGen/CodeGenModule.cpp2
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());