diff options
author | Chris Lattner <sabre@nondot.org> | 2012-02-07 00:39:47 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2012-02-07 00:39:47 +0000 |
commit | 8b418685e9e4f02f4eb2a76e1ec063e07552b68d (patch) | |
tree | 50c93bcea5a0eb377d080632d3df630922262aa8 /lib/CodeGen/CGExprScalar.cpp | |
parent | e91e0ae772004912285ccc3848b27208da8c045b (diff) |
simplify a bunch of code to use the well-known LLVM IR types computed by CodeGenModule.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149943 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprScalar.cpp')
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index 6f0d99f2f5..4047a39287 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -560,7 +560,7 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType, if (SrcType->isHalfType()) { Src = Builder.CreateCall(CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16), Src); SrcType = CGF.getContext().FloatTy; - SrcTy = llvm::Type::getFloatTy(VMContext); + SrcTy = CGF.FloatTy; } // Handle conversions to bool first, they are special: comparisons against 0. @@ -628,7 +628,7 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType, // Cast to half via float if (DstType->isHalfType()) - DstTy = llvm::Type::getFloatTy(VMContext); + DstTy = CGF.FloatTy; if (isa<llvm::IntegerType>(SrcTy)) { bool InputSigned = SrcType->isSignedIntegerOrEnumerationType(); @@ -1898,7 +1898,7 @@ Value *ScalarExprEmitter::EmitOverflowCheckedBinOp(const BinOpInfo &Ops) { Builder.SetInsertPoint(overflowBB); // Get the overflow handler. - llvm::Type *Int8Ty = llvm::Type::getInt8Ty(VMContext); + llvm::Type *Int8Ty = CGF.Int8Ty; llvm::Type *argTypes[] = { CGF.Int64Ty, CGF.Int64Ty, Int8Ty, Int8Ty }; llvm::FunctionType *handlerTy = llvm::FunctionType::get(CGF.Int64Ty, argTypes, true); @@ -2726,8 +2726,7 @@ Value *ScalarExprEmitter::VisitAsTypeExpr(AsTypeExpr *E) { Args.push_back(Builder.getInt32(2)); if (numElementsDst == 4) - Args.push_back(llvm::UndefValue::get( - llvm::Type::getInt32Ty(CGF.getLLVMContext()))); + Args.push_back(llvm::UndefValue::get(CGF.Int32Ty)); llvm::Constant *Mask = llvm::ConstantVector::get(Args); |