From 5e016ae983e1ddc24fca7a04d8399cbd673707c2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 27 Jun 2010 07:15:29 +0000 Subject: finally get around to doing a significant cleanup to irgen: have CGF create and make accessible standard int32,int64 and intptr types. This fixes a ton of 80 column violations introduced by LLVMContextification and cleans up stuff a lot. llvm-svn: 106977 --- clang/lib/CodeGen/CGCall.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'clang/lib/CodeGen/CGCall.cpp') diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 6151fa2ed4c..ec865e58c6d 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -393,14 +393,12 @@ static llvm::Value *CoerceIntOrPtrToIntOrPtr(llvm::Value *Val, return CGF.Builder.CreateBitCast(Val, Ty, "coerce.val"); // Convert the pointer to an integer so we can play with its width. - const llvm::Type *IntPtrTy = llvm::IntegerType::get(Ty->getContext(), - CGF.LLVMPointerWidth); - Val = CGF.Builder.CreatePtrToInt(Val, IntPtrTy, "coerce.val.pi"); + Val = CGF.Builder.CreatePtrToInt(Val, CGF.IntPtrTy, "coerce.val.pi"); } const llvm::Type *DestIntTy = Ty; if (isa(DestIntTy)) - DestIntTy = llvm::IntegerType::get(Ty->getContext(), CGF.LLVMPointerWidth); + DestIntTy = CGF.IntPtrTy; if (Val->getType() != DestIntTy) Val = CGF.Builder.CreateIntCast(Val, DestIntTy, false, "coerce.val.ii"); -- cgit v1.2.3