summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-10-13 10:07:13 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-10-13 10:07:13 +0000
commitabd5b90e4c9529f92621cc37baff8e326930f63f (patch)
treede9c0e4ce2571b100191bef4d2589cb41f74574f /clang/lib/CodeGen/CGBuiltin.cpp
parent1008612b366dca8b6271758ad5f6c7bbbae3ffa3 (diff)
downloadbcm5719-llvm-abd5b90e4c9529f92621cc37baff8e326930f63f.tar.gz
bcm5719-llvm-abd5b90e4c9529f92621cc37baff8e326930f63f.zip
Simplify pointer creation with the new Type::getInt*Ptr methods.
llvm-svn: 83964
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index ffc8ea7daaf..987cd24e2c8 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -77,8 +77,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
case Builtin::BI__builtin_va_start:
case Builtin::BI__builtin_va_end: {
Value *ArgValue = EmitVAListRef(E->getArg(0));
- const llvm::Type *DestType =
- llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(VMContext));
+ const llvm::Type *DestType = llvm::Type::getInt8PtrTy(VMContext);
if (ArgValue->getType() != DestType)
ArgValue = Builder.CreateBitCast(ArgValue, DestType,
ArgValue->getName().data());
@@ -91,8 +90,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
Value *DstPtr = EmitVAListRef(E->getArg(0));
Value *SrcPtr = EmitVAListRef(E->getArg(1));
- const llvm::Type *Type =
- llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(VMContext));
+ const llvm::Type *Type = llvm::Type::getInt8PtrTy(VMContext);
DstPtr = Builder.CreateBitCast(DstPtr, Type);
SrcPtr = Builder.CreateBitCast(SrcPtr, Type);
@@ -349,16 +347,14 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
Builder.CreateStore(FrameAddr, Buf);
// Call the setjmp intrinsic
Value *F = CGM.getIntrinsic(Intrinsic::eh_sjlj_setjmp, 0, 0);
- const llvm::Type *DestType =
- llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(VMContext));
+ const llvm::Type *DestType = llvm::Type::getInt8PtrTy(VMContext);
Buf = Builder.CreateBitCast(Buf, DestType);
return RValue::get(Builder.CreateCall(F, Buf));
}
case Builtin::BI__builtin_longjmp: {
Value *F = CGM.getIntrinsic(Intrinsic::eh_sjlj_longjmp, 0, 0);
Value *Buf = EmitScalarExpr(E->getArg(0));
- const llvm::Type *DestType =
- llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(VMContext));
+ const llvm::Type *DestType = llvm::Type::getInt8PtrTy(VMContext);
Buf = Builder.CreateBitCast(Buf, DestType);
return RValue::get(Builder.CreateCall(F, Buf));
}
@@ -760,7 +756,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
return Builder.CreateCall(F, &Ops[0], &Ops[0] + Ops.size(), "cmpss");
}
case X86::BI__builtin_ia32_ldmxcsr: {
- llvm::Type *PtrTy = llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(VMContext));
+ const llvm::Type *PtrTy = llvm::Type::getInt8PtrTy(VMContext);
Value *One = llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), 1);
Value *Tmp = Builder.CreateAlloca(llvm::Type::getInt32Ty(VMContext), One, "tmp");
Builder.CreateStore(Ops[0], Tmp);
@@ -768,7 +764,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
Builder.CreateBitCast(Tmp, PtrTy));
}
case X86::BI__builtin_ia32_stmxcsr: {
- llvm::Type *PtrTy = llvm::PointerType::getUnqual(llvm::Type::getInt8Ty(VMContext));
+ const llvm::Type *PtrTy = llvm::Type::getInt8PtrTy(VMContext);
Value *One = llvm::ConstantInt::get(llvm::Type::getInt32Ty(VMContext), 1);
Value *Tmp = Builder.CreateAlloca(llvm::Type::getInt32Ty(VMContext), One, "tmp");
One = Builder.CreateCall(CGM.getIntrinsic(Intrinsic::x86_sse_stmxcsr),
OpenPOWER on IntegriCloud