summaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2009-10-06 15:40:36 +0000
committerDuncan Sands <baldrick@free.fr>2009-10-06 15:40:36 +0000
commitac53a0b272452013124bfc70480aea5e41b60f40 (patch)
tree13cacd7f4cf35222c87f5021354fd8944756b1e0 /lib/CodeGen
parent6e214805b1163c0e3cd218963c9e66ea244956b2 (diff)
downloadllvm-ac53a0b272452013124bfc70480aea5e41b60f40.tar.gz
llvm-ac53a0b272452013124bfc70480aea5e41b60f40.tar.bz2
llvm-ac53a0b272452013124bfc70480aea5e41b60f40.tar.xz
Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/DwarfEHPrepare.cpp2
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp16
-rw-r--r--lib/CodeGen/PseudoSourceValue.cpp2
-rw-r--r--lib/CodeGen/ShadowStackGC.cpp2
-rw-r--r--lib/CodeGen/SjLjEHPrepare.cpp8
5 files changed, 15 insertions, 15 deletions
diff --git a/lib/CodeGen/DwarfEHPrepare.cpp b/lib/CodeGen/DwarfEHPrepare.cpp
index 0ae7b35cc3..72b3f92d32 100644
--- a/lib/CodeGen/DwarfEHPrepare.cpp
+++ b/lib/CodeGen/DwarfEHPrepare.cpp
@@ -236,7 +236,7 @@ bool DwarfEHPrepare::LowerUnwinds() {
if (!RewindFunction) {
LLVMContext &Ctx = UnwindInsts[0]->getContext();
std::vector<const Type*>
- Params(1, PointerType::getUnqual(Type::getInt8Ty(Ctx)));
+ Params(1, Type::getInt8PtrTy(Ctx));
FunctionType *FTy = FunctionType::get(Type::getVoidTy(Ctx),
Params, false);
const char *RewindName = TLI->getLibcallName(RTLIB::UNWIND_RESUME);
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp
index e3bbdb26ea..9336b973c0 100644
--- a/lib/CodeGen/IntrinsicLowering.cpp
+++ b/lib/CodeGen/IntrinsicLowering.cpp
@@ -103,22 +103,22 @@ void IntrinsicLowering::AddPrototypes(Module &M) {
break;
case Intrinsic::memcpy:
M.getOrInsertFunction("memcpy",
- PointerType::getUnqual(Type::getInt8Ty(Context)),
- PointerType::getUnqual(Type::getInt8Ty(Context)),
- PointerType::getUnqual(Type::getInt8Ty(Context)),
+ Type::getInt8PtrTy(Context),
+ Type::getInt8PtrTy(Context),
+ Type::getInt8PtrTy(Context),
TD.getIntPtrType(Context), (Type *)0);
break;
case Intrinsic::memmove:
M.getOrInsertFunction("memmove",
- PointerType::getUnqual(Type::getInt8Ty(Context)),
- PointerType::getUnqual(Type::getInt8Ty(Context)),
- PointerType::getUnqual(Type::getInt8Ty(Context)),
+ Type::getInt8PtrTy(Context),
+ Type::getInt8PtrTy(Context),
+ Type::getInt8PtrTy(Context),
TD.getIntPtrType(Context), (Type *)0);
break;
case Intrinsic::memset:
M.getOrInsertFunction("memset",
- PointerType::getUnqual(Type::getInt8Ty(Context)),
- PointerType::getUnqual(Type::getInt8Ty(Context)),
+ Type::getInt8PtrTy(Context),
+ Type::getInt8PtrTy(Context),
Type::getInt32Ty(M.getContext()),
TD.getIntPtrType(Context), (Type *)0);
break;
diff --git a/lib/CodeGen/PseudoSourceValue.cpp b/lib/CodeGen/PseudoSourceValue.cpp
index 3728b7fe44..00c5d46d21 100644
--- a/lib/CodeGen/PseudoSourceValue.cpp
+++ b/lib/CodeGen/PseudoSourceValue.cpp
@@ -44,7 +44,7 @@ static const char *const PSVNames[] = {
// static. For now, we can safely use the global context for the time being to
// squeak by.
PseudoSourceValue::PseudoSourceValue() :
- Value(PointerType::getUnqual(Type::getInt8Ty(getGlobalContext())),
+ Value(Type::getInt8PtrTy(getGlobalContext()),
PseudoSourceValueVal) {}
void PseudoSourceValue::printCustom(raw_ostream &O) const {
diff --git a/lib/CodeGen/ShadowStackGC.cpp b/lib/CodeGen/ShadowStackGC.cpp
index 541ab9a417..25a499b889 100644
--- a/lib/CodeGen/ShadowStackGC.cpp
+++ b/lib/CodeGen/ShadowStackGC.cpp
@@ -189,7 +189,7 @@ ShadowStackGC::ShadowStackGC() : Head(0), StackEntryTy(0) {
Constant *ShadowStackGC::GetFrameMap(Function &F) {
// doInitialization creates the abstract type of this value.
- Type *VoidPtr = PointerType::getUnqual(Type::getInt8Ty(F.getContext()));
+ const Type *VoidPtr = Type::getInt8PtrTy(F.getContext());
// Truncate the ShadowStackDescriptor if some metadata is null.
unsigned NumMeta = 0;
diff --git a/lib/CodeGen/SjLjEHPrepare.cpp b/lib/CodeGen/SjLjEHPrepare.cpp
index 38996ff6cd..04bc6cf892 100644
--- a/lib/CodeGen/SjLjEHPrepare.cpp
+++ b/lib/CodeGen/SjLjEHPrepare.cpp
@@ -88,7 +88,7 @@ bool SjLjEHPass::doInitialization(Module &M) {
// Build the function context structure.
// builtin_setjmp uses a five word jbuf
const Type *VoidPtrTy =
- PointerType::getUnqual(Type::getInt8Ty(M.getContext()));
+ Type::getInt8PtrTy(M.getContext());
const Type *Int32Ty = Type::getInt32Ty(M.getContext());
FunctionContextTy =
StructType::get(M.getContext(),
@@ -378,7 +378,7 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
// the instruction hasn't already been removed.
if (!I->getParent()) continue;
Value *Val = new LoadInst(ExceptionAddr, "exception", true, I);
- Type *Ty = PointerType::getUnqual(Type::getInt8Ty(F.getContext()));
+ const Type *Ty = Type::getInt8PtrTy(F.getContext());
Val = CastInst::Create(Instruction::IntToPtr, Val, Ty, "", I);
I->replaceAllUsesWith(Val);
@@ -455,8 +455,8 @@ bool SjLjEHPass::insertSjLjEHSupport(Function &F) {
// Call the setjmp instrinsic. It fills in the rest of the jmpbuf
Value *SetjmpArg =
CastInst::Create(Instruction::BitCast, FieldPtr,
- Type::getInt8Ty(F.getContext())->getPointerTo(), "",
- EntryBB->getTerminator());
+ Type::getInt8PtrTy(F.getContext()), "",
+ EntryBB->getTerminator());
Value *DispatchVal = CallInst::Create(BuiltinSetjmpFn, SetjmpArg,
"dispatch",
EntryBB->getTerminator());