]> granicus.if.org Git - clang/commitdiff
Use new predicates for some type equality tests.
authorBenjamin Kramer <benny.kra@googlemail.com>
Mon, 5 Oct 2009 13:47:21 +0000 (13:47 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Mon, 5 Oct 2009 13:47:21 +0000 (13:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83303 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGCall.cpp
lib/CodeGen/CGExprScalar.cpp
lib/CodeGen/CodeGenModule.cpp

index 2a1843eb6c6e980367508df67a3e49a047d2729a..bad166f01ef5d78272fb65c224b5fb8db5c56632 100644 (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()) {
index 21b45583e5abcad73ae903cd6b4596553e41ac2a..d0c245369b44bf008a35b968992ffdf41c271568 100644 (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)));
index f93c6048a74eebb13a48da49af556e25d76ac1b1..fdc97409eb4c3e79203d7134aa939d6e70bb048d 100644 (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());