Skip to content

Commit

Permalink
[NFC] Remove Type::getInt8PtrTy (#71029)
Browse files Browse the repository at this point in the history
Replace this with PointerType::getUnqual().
Followup to the opaque pointer transition. Fixes an in-code TODO item.
  • Loading branch information
pmatos committed Nov 7, 2023
1 parent 75d6795 commit 7b9d73c
Show file tree
Hide file tree
Showing 63 changed files with 229 additions and 214 deletions.
13 changes: 7 additions & 6 deletions clang/lib/CodeGen/CGGPUBuiltin.cpp
Expand Up @@ -23,8 +23,8 @@ using namespace CodeGen;

namespace {
llvm::Function *GetVprintfDeclaration(llvm::Module &M) {
llvm::Type *ArgTypes[] = {llvm::Type::getInt8PtrTy(M.getContext()),
llvm::Type::getInt8PtrTy(M.getContext())};
llvm::Type *ArgTypes[] = {llvm::PointerType::getUnqual(M.getContext()),
llvm::PointerType::getUnqual(M.getContext())};
llvm::FunctionType *VprintfFuncType = llvm::FunctionType::get(
llvm::Type::getInt32Ty(M.getContext()), ArgTypes, false);

Expand All @@ -45,8 +45,8 @@ llvm::Function *GetVprintfDeclaration(llvm::Module &M) {
llvm::Function *GetOpenMPVprintfDeclaration(CodeGenModule &CGM) {
const char *Name = "__llvm_omp_vprintf";
llvm::Module &M = CGM.getModule();
llvm::Type *ArgTypes[] = {llvm::Type::getInt8PtrTy(M.getContext()),
llvm::Type::getInt8PtrTy(M.getContext()),
llvm::Type *ArgTypes[] = {llvm::PointerType::getUnqual(M.getContext()),
llvm::PointerType::getUnqual(M.getContext()),
llvm::Type::getInt32Ty(M.getContext())};
llvm::FunctionType *VprintfFuncType = llvm::FunctionType::get(
llvm::Type::getInt32Ty(M.getContext()), ArgTypes, false);
Expand Down Expand Up @@ -99,7 +99,8 @@ packArgsIntoNVPTXFormatBuffer(CodeGenFunction *CGF, const CallArgList &Args) {
// Construct and fill the args buffer that we'll pass to vprintf.
if (Args.size() <= 1) {
// If there are no args, pass a null pointer and size 0
llvm::Value * BufferPtr = llvm::ConstantPointerNull::get(llvm::Type::getInt8PtrTy(Ctx));
llvm::Value *BufferPtr =
llvm::ConstantPointerNull::get(llvm::PointerType::getUnqual(Ctx));
return {BufferPtr, llvm::TypeSize::Fixed(0)};
} else {
llvm::SmallVector<llvm::Type *, 8> ArgTypes;
Expand All @@ -120,7 +121,7 @@ packArgsIntoNVPTXFormatBuffer(CodeGenFunction *CGF, const CallArgList &Args) {
Builder.CreateAlignedStore(Arg, P, DL.getPrefTypeAlign(Arg->getType()));
}
llvm::Value *BufferPtr =
Builder.CreatePointerCast(Alloca, llvm::Type::getInt8PtrTy(Ctx));
Builder.CreatePointerCast(Alloca, llvm::PointerType::getUnqual(Ctx));
return {BufferPtr, DL.getTypeAllocSize(AllocaTy)};
}
}
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CodeGenTypes.cpp
Expand Up @@ -422,7 +422,7 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) {

case BuiltinType::NullPtr:
// Model std::nullptr_t as i8*
ResultType = llvm::Type::getInt8PtrTy(getLLVMContext());
ResultType = llvm::PointerType::getUnqual(getLLVMContext());
break;

case BuiltinType::UInt128:
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/CodeGen/CoverageMappingGen.cpp
Expand Up @@ -1820,7 +1820,7 @@ void CoverageMappingModuleGen::emit() {
CGM.addUsedGlobal(CovData);
// Create the deferred function records array
if (!FunctionNames.empty()) {
auto NamesArrTy = llvm::ArrayType::get(llvm::Type::getInt8PtrTy(Ctx),
auto NamesArrTy = llvm::ArrayType::get(llvm::PointerType::getUnqual(Ctx),
FunctionNames.size());
auto NamesArrVal = llvm::ConstantArray::get(NamesArrTy, FunctionNames);
// This variable will *NOT* be emitted to the object file. It is used
Expand Down
53 changes: 27 additions & 26 deletions clang/tools/clang-linker-wrapper/OffloadWrapper.cpp
Expand Up @@ -40,7 +40,7 @@ enum OffloadEntryKindFlag : uint32_t {

IntegerType *getSizeTTy(Module &M) {
LLVMContext &C = M.getContext();
switch (M.getDataLayout().getPointerTypeSize(Type::getInt8PtrTy(C))) {
switch (M.getDataLayout().getPointerTypeSize(PointerType::getUnqual(C))) {
case 4u:
return Type::getInt32Ty(C);
case 8u:
Expand All @@ -60,9 +60,10 @@ StructType *getEntryTy(Module &M) {
LLVMContext &C = M.getContext();
StructType *EntryTy = StructType::getTypeByName(C, "__tgt_offload_entry");
if (!EntryTy)
EntryTy = StructType::create("__tgt_offload_entry", Type::getInt8PtrTy(C),
Type::getInt8PtrTy(C), getSizeTTy(M),
Type::getInt32Ty(C), Type::getInt32Ty(C));
EntryTy =
StructType::create("__tgt_offload_entry", PointerType::getUnqual(C),
PointerType::getUnqual(C), getSizeTTy(M),
Type::getInt32Ty(C), Type::getInt32Ty(C));
return EntryTy;
}

Expand All @@ -80,9 +81,9 @@ StructType *getDeviceImageTy(Module &M) {
LLVMContext &C = M.getContext();
StructType *ImageTy = StructType::getTypeByName(C, "__tgt_device_image");
if (!ImageTy)
ImageTy = StructType::create("__tgt_device_image", Type::getInt8PtrTy(C),
Type::getInt8PtrTy(C), getEntryPtrTy(M),
getEntryPtrTy(M));
ImageTy = StructType::create(
"__tgt_device_image", PointerType::getUnqual(C),
PointerType::getUnqual(C), getEntryPtrTy(M), getEntryPtrTy(M));
return ImageTy;
}

Expand Down Expand Up @@ -284,17 +285,17 @@ StructType *getFatbinWrapperTy(Module &M) {
LLVMContext &C = M.getContext();
StructType *FatbinTy = StructType::getTypeByName(C, "fatbin_wrapper");
if (!FatbinTy)
FatbinTy = StructType::create("fatbin_wrapper", Type::getInt32Ty(C),
Type::getInt32Ty(C), Type::getInt8PtrTy(C),
Type::getInt8PtrTy(C));
FatbinTy = StructType::create(
"fatbin_wrapper", Type::getInt32Ty(C), Type::getInt32Ty(C),
PointerType::getUnqual(C), PointerType::getUnqual(C));
return FatbinTy;
}

/// Embed the image \p Image into the module \p M so it can be found by the
/// runtime.
GlobalVariable *createFatbinDesc(Module &M, ArrayRef<char> Image, bool IsHIP) {
LLVMContext &C = M.getContext();
llvm::Type *Int8PtrTy = Type::getInt8PtrTy(C);
llvm::Type *Int8PtrTy = PointerType::getUnqual(C);
llvm::Triple Triple = llvm::Triple(M.getTargetTriple());

// Create the global string containing the fatbinary.
Expand All @@ -315,7 +316,7 @@ GlobalVariable *createFatbinDesc(Module &M, ArrayRef<char> Image, bool IsHIP) {
ConstantInt::get(Type::getInt32Ty(C), IsHIP ? HIPFatMagic : CudaFatMagic),
ConstantInt::get(Type::getInt32Ty(C), 1),
ConstantExpr::getPointerBitCastOrAddrSpaceCast(Fatbin, Int8PtrTy),
ConstantPointerNull::get(Type::getInt8PtrTy(C))};
ConstantPointerNull::get(PointerType::getUnqual(C))};

Constant *FatbinInitializer =
ConstantStruct::get(getFatbinWrapperTy(M), FatbinWrapper);
Expand Down Expand Up @@ -529,21 +530,21 @@ void createRegisterFatbinFunction(Module &M, GlobalVariable *FatbinDesc,
DtorFunc->setSection(".text.startup");

// Get the __cudaRegisterFatBinary function declaration.
auto *RegFatTy = FunctionType::get(Type::getInt8PtrTy(C)->getPointerTo(),
Type::getInt8PtrTy(C),
auto *RegFatTy = FunctionType::get(PointerType::getUnqual(C)->getPointerTo(),
PointerType::getUnqual(C),
/*isVarArg*/ false);
FunctionCallee RegFatbin = M.getOrInsertFunction(
IsHIP ? "__hipRegisterFatBinary" : "__cudaRegisterFatBinary", RegFatTy);
// Get the __cudaRegisterFatBinaryEnd function declaration.
auto *RegFatEndTy = FunctionType::get(Type::getVoidTy(C),
Type::getInt8PtrTy(C)->getPointerTo(),
/*isVarArg*/ false);
auto *RegFatEndTy = FunctionType::get(
Type::getVoidTy(C), PointerType::getUnqual(C)->getPointerTo(),
/*isVarArg*/ false);
FunctionCallee RegFatbinEnd =
M.getOrInsertFunction("__cudaRegisterFatBinaryEnd", RegFatEndTy);
// Get the __cudaUnregisterFatBinary function declaration.
auto *UnregFatTy = FunctionType::get(Type::getVoidTy(C),
Type::getInt8PtrTy(C)->getPointerTo(),
/*isVarArg*/ false);
auto *UnregFatTy = FunctionType::get(
Type::getVoidTy(C), PointerType::getUnqual(C)->getPointerTo(),
/*isVarArg*/ false);
FunctionCallee UnregFatbin = M.getOrInsertFunction(
IsHIP ? "__hipUnregisterFatBinary" : "__cudaUnregisterFatBinary",
UnregFatTy);
Expand All @@ -554,19 +555,19 @@ void createRegisterFatbinFunction(Module &M, GlobalVariable *FatbinDesc,
FunctionCallee AtExit = M.getOrInsertFunction("atexit", AtExitTy);

auto *BinaryHandleGlobal = new llvm::GlobalVariable(
M, Type::getInt8PtrTy(C)->getPointerTo(), false,
M, PointerType::getUnqual(C)->getPointerTo(), false,
llvm::GlobalValue::InternalLinkage,
llvm::ConstantPointerNull::get(Type::getInt8PtrTy(C)->getPointerTo()),
llvm::ConstantPointerNull::get(PointerType::getUnqual(C)->getPointerTo()),
IsHIP ? ".hip.binary_handle" : ".cuda.binary_handle");

// Create the constructor to register this image with the runtime.
IRBuilder<> CtorBuilder(BasicBlock::Create(C, "entry", CtorFunc));
CallInst *Handle = CtorBuilder.CreateCall(
RegFatbin, ConstantExpr::getPointerBitCastOrAddrSpaceCast(
FatbinDesc, Type::getInt8PtrTy(C)));
FatbinDesc, PointerType::getUnqual(C)));
CtorBuilder.CreateAlignedStore(
Handle, BinaryHandleGlobal,
Align(M.getDataLayout().getPointerTypeSize(Type::getInt8PtrTy(C))));
Align(M.getDataLayout().getPointerTypeSize(PointerType::getUnqual(C))));
CtorBuilder.CreateCall(createRegisterGlobalsFunction(M, IsHIP), Handle);
if (!IsHIP)
CtorBuilder.CreateCall(RegFatbinEnd, Handle);
Expand All @@ -578,8 +579,8 @@ void createRegisterFatbinFunction(Module &M, GlobalVariable *FatbinDesc,
// `atexit()` intead.
IRBuilder<> DtorBuilder(BasicBlock::Create(C, "entry", DtorFunc));
LoadInst *BinaryHandle = DtorBuilder.CreateAlignedLoad(
Type::getInt8PtrTy(C)->getPointerTo(), BinaryHandleGlobal,
Align(M.getDataLayout().getPointerTypeSize(Type::getInt8PtrTy(C))));
PointerType::getUnqual(C)->getPointerTo(), BinaryHandleGlobal,
Align(M.getDataLayout().getPointerTypeSize(PointerType::getUnqual(C))));
DtorBuilder.CreateCall(UnregFatbin, BinaryHandle);
DtorBuilder.CreateRetVoid();

Expand Down
2 changes: 1 addition & 1 deletion llvm/examples/BrainF/BrainF.cpp
Expand Up @@ -67,7 +67,7 @@ void BrainF::header(LLVMContext& C) {
//Function prototypes

//declare void @llvm.memset.p0i8.i32(i8 *, i8, i32, i1)
Type *Tys[] = { Type::getInt8PtrTy(C), Type::getInt32Ty(C) };
Type *Tys[] = {PointerType::getUnqual(C), Type::getInt32Ty(C)};
Function *memset_func = Intrinsic::getDeclaration(module, Intrinsic::memset,
Tys);

Expand Down
5 changes: 0 additions & 5 deletions llvm/include/llvm/IR/Type.h
Expand Up @@ -482,11 +482,6 @@ class Type {
//===--------------------------------------------------------------------===//
// Convenience methods for getting pointer types.
//

// TODO: After opaque pointer transition this can be replaced by simply
// calling PointerType::get(C, AS).
static PointerType *getInt8PtrTy(LLVMContext &C, unsigned AS = 0);

static Type *getWasm_ExternrefTy(LLVMContext &C);
static Type *getWasm_FuncrefTy(LLVMContext &C);

Expand Down
12 changes: 6 additions & 6 deletions llvm/include/llvm/ProfileData/InstrProfData.inc
Expand Up @@ -81,9 +81,9 @@ INSTR_PROF_DATA(const IntPtrT, IntPtrTy, BitmapPtr, RelativeBitmapPtr)
* function name hashes during the conversion from raw to merged profile
* data.
*/
INSTR_PROF_DATA(const IntPtrT, llvm::Type::getInt8PtrTy(Ctx), FunctionPointer, \
INSTR_PROF_DATA(const IntPtrT, llvm::PointerType::getUnqual(Ctx), FunctionPointer, \
FunctionAddr)
INSTR_PROF_DATA(IntPtrT, llvm::Type::getInt8PtrTy(Ctx), Values, \
INSTR_PROF_DATA(IntPtrT, llvm::PointerType::getUnqual(Ctx), Values, \
ValuesPtrExpr)
INSTR_PROF_DATA(const uint32_t, llvm::Type::getInt32Ty(Ctx), NumCounters, \
ConstantInt::get(llvm::Type::getInt32Ty(Ctx), NumCounters))
Expand Down Expand Up @@ -116,7 +116,7 @@ INSTR_PROF_VALUE_NODE(uint64_t, llvm::Type::getInt64Ty(Ctx), Value, \
ConstantInt::get(llvm::Type::GetInt64Ty(Ctx), 0))
INSTR_PROF_VALUE_NODE(uint64_t, llvm::Type::getInt64Ty(Ctx), Count, \
ConstantInt::get(llvm::Type::GetInt64Ty(Ctx), 0))
INSTR_PROF_VALUE_NODE(PtrToNodeT, llvm::Type::getInt8PtrTy(Ctx), Next, \
INSTR_PROF_VALUE_NODE(PtrToNodeT, llvm::PointerType::getUnqual(Ctx), Next, \
ConstantInt::get(llvm::Type::GetInt8PtrTy(Ctx), 0))
#undef INSTR_PROF_VALUE_NODE
/* INSTR_PROF_VALUE_NODE end. */
Expand Down Expand Up @@ -160,7 +160,7 @@ INSTR_PROF_RAW_HEADER(uint64_t, ValueKindLast, IPVK_Last)
#endif
VALUE_PROF_FUNC_PARAM(uint64_t, TargetValue, Type::getInt64Ty(Ctx)) \
INSTR_PROF_COMMA
VALUE_PROF_FUNC_PARAM(void *, Data, Type::getInt8PtrTy(Ctx)) INSTR_PROF_COMMA
VALUE_PROF_FUNC_PARAM(void *, Data, PointerType::getUnqual(Ctx)) INSTR_PROF_COMMA
VALUE_PROF_FUNC_PARAM(uint32_t, CounterIndex, Type::getInt32Ty(Ctx))
#undef VALUE_PROF_FUNC_PARAM
#undef INSTR_PROF_COMMA
Expand Down Expand Up @@ -213,9 +213,9 @@ VALUE_PROF_KIND(IPVK_Last, IPVK_MemOPSize, "last")
#define INSTR_PROF_DATA_DEFINED
#endif
#ifdef COVMAP_V1
COVMAP_FUNC_RECORD(const IntPtrT, llvm::Type::getInt8PtrTy(Ctx), \
COVMAP_FUNC_RECORD(const IntPtrT, llvm::PointerType::getUnqual(Ctx), \
NamePtr, llvm::ConstantExpr::getBitCast(NamePtr, \
llvm::Type::getInt8PtrTy(Ctx)))
llvm::PointerType::getUnqual(Ctx)))
COVMAP_FUNC_RECORD(const uint32_t, llvm::Type::getInt32Ty(Ctx), NameSize, \
llvm::ConstantInt::get(llvm::Type::getInt32Ty(Ctx), \
NameValue.size()))
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Analysis/StackSafetyAnalysis.cpp
Expand Up @@ -272,7 +272,7 @@ ConstantRange StackSafetyLocalAnalysis::offsetFrom(Value *Addr, Value *Base) {
if (!SE.isSCEVable(Addr->getType()) || !SE.isSCEVable(Base->getType()))
return UnknownRange;

auto *PtrTy = IntegerType::getInt8PtrTy(SE.getContext());
auto *PtrTy = PointerType::getUnqual(SE.getContext());
const SCEV *AddrExp = SE.getTruncateOrZeroExtend(SE.getSCEV(Addr), PtrTy);
const SCEV *BaseExp = SE.getTruncateOrZeroExtend(SE.getSCEV(Base), PtrTy);
const SCEV *Diff = SE.getMinusSCEV(AddrExp, BaseExp);
Expand Down Expand Up @@ -363,7 +363,7 @@ bool StackSafetyLocalAnalysis::isSafeAccess(const Use &U, AllocaInst *AI,
const auto *I = cast<Instruction>(U.getUser());

auto ToCharPtr = [&](const SCEV *V) {
auto *PtrTy = IntegerType::getInt8PtrTy(SE.getContext());
auto *PtrTy = PointerType::getUnqual(SE.getContext());
return SE.getTruncateOrZeroExtend(V, PtrTy);
};

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
Expand Up @@ -5178,7 +5178,7 @@ void llvm::embedBitcodeInModule(llvm::Module &M, llvm::MemoryBufferRef Buf,
// Save llvm.compiler.used and remove it.
SmallVector<Constant *, 2> UsedArray;
SmallVector<GlobalValue *, 4> UsedGlobals;
Type *UsedElementType = Type::getInt8PtrTy(M.getContext());
Type *UsedElementType = PointerType::getUnqual(M.getContext());
GlobalVariable *Used = collectUsedGlobalVariables(M, UsedGlobals, true);
for (auto *GV : UsedGlobals) {
if (GV->getName() != "llvm.embedded.module" &&
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Expand Up @@ -2322,7 +2322,7 @@ bool AsmPrinter::doFinalization(Module &M) {
auto SymbolName = "swift_async_extendedFramePointerFlags";
auto Global = M.getGlobalVariable(SymbolName);
if (!Global) {
auto Int8PtrTy = Type::getInt8PtrTy(M.getContext());
auto Int8PtrTy = PointerType::getUnqual(M.getContext());
Global = new GlobalVariable(M, Int8PtrTy, false,
GlobalValue::ExternalWeakLinkage, nullptr,
SymbolName);
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/CodeGen/DwarfEHPrepare.cpp
Expand Up @@ -227,8 +227,8 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
DoesRewindFunctionNeedExceptionObject = false;
} else {
RewindName = TLI.getLibcallName(RTLIB::UNWIND_RESUME);
FTy =
FunctionType::get(Type::getVoidTy(Ctx), Type::getInt8PtrTy(Ctx), false);
FTy = FunctionType::get(Type::getVoidTy(Ctx), PointerType::getUnqual(Ctx),
false);
RewindFunctionCallingConv = TLI.getLibcallCallingConv(RTLIB::UNWIND_RESUME);
DoesRewindFunctionNeedExceptionObject = true;
}
Expand Down Expand Up @@ -269,8 +269,8 @@ bool DwarfEHPrepare::InsertUnwindResumeCalls() {
llvm::SmallVector<Value *, 1> RewindFunctionArgs;

BasicBlock *UnwindBB = BasicBlock::Create(Ctx, "unwind_resume", &F);
PHINode *PN = PHINode::Create(Type::getInt8PtrTy(Ctx), ResumesLeft, "exn.obj",
UnwindBB);
PHINode *PN = PHINode::Create(PointerType::getUnqual(Ctx), ResumesLeft,
"exn.obj", UnwindBB);

// Extract the exception object from the ResumeInst and add it to the PHI node
// that feeds the _Unwind_Resume call.
Expand Down
8 changes: 4 additions & 4 deletions llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp
Expand Up @@ -768,7 +768,7 @@ void IRTranslator::emitJumpTable(SwitchCG::JumpTable &JT,
MIB.setMBB(*MBB);
MIB.setDebugLoc(CurBuilder->getDebugLoc());

Type *PtrIRTy = Type::getInt8PtrTy(MF->getFunction().getContext());
Type *PtrIRTy = PointerType::getUnqual(MF->getFunction().getContext());
const LLT PtrTy = getLLTForType(*PtrIRTy, *DL);

auto Table = MIB.buildJumpTable(PtrTy, JT.JTI);
Expand Down Expand Up @@ -1016,7 +1016,7 @@ void IRTranslator::emitBitTestHeader(SwitchCG::BitTestBlock &B,
Register MinValReg = MIB.buildConstant(SwitchOpTy, B.First).getReg(0);
auto RangeSub = MIB.buildSub(SwitchOpTy, SwitchOpReg, MinValReg);

Type *PtrIRTy = Type::getInt8PtrTy(MF->getFunction().getContext());
Type *PtrIRTy = PointerType::getUnqual(MF->getFunction().getContext());
const LLT PtrTy = getLLTForType(*PtrIRTy, *DL);

LLT MaskTy = SwitchOpTy;
Expand Down Expand Up @@ -3347,7 +3347,7 @@ bool IRTranslator::emitSPDescriptorParent(StackProtectorDescriptor &SPD,
CurBuilder->setInsertPt(*ParentBB, ParentBB->end());
// First create the loads to the guard/stack slot for the comparison.
const TargetLowering &TLI = *MF->getSubtarget().getTargetLowering();
Type *PtrIRTy = Type::getInt8PtrTy(MF->getFunction().getContext());
Type *PtrIRTy = PointerType::getUnqual(MF->getFunction().getContext());
const LLT PtrTy = getLLTForType(*PtrIRTy, *DL);
LLT PtrMemTy = getLLTForMVT(TLI.getPointerMemTy(*DL));

Expand All @@ -3357,7 +3357,7 @@ bool IRTranslator::emitSPDescriptorParent(StackProtectorDescriptor &SPD,
Register Guard;
Register StackSlotPtr = CurBuilder->buildFrameIndex(PtrTy, FI).getReg(0);
const Module &M = *ParentBB->getParent()->getFunction().getParent();
Align Align = DL->getPrefTypeAlign(Type::getInt8PtrTy(M.getContext()));
Align Align = DL->getPrefTypeAlign(PointerType::getUnqual(M.getContext()));

// Generate code to load the content of the guard slot.
Register GuardVal =
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SafeStack.cpp
Expand Up @@ -192,7 +192,7 @@ class SafeStack {
SafeStack(Function &F, const TargetLoweringBase &TL, const DataLayout &DL,
DomTreeUpdater *DTU, ScalarEvolution &SE)
: F(F), TL(TL), DL(DL), DTU(DTU), SE(SE),
StackPtrTy(Type::getInt8PtrTy(F.getContext())),
StackPtrTy(PointerType::getUnqual(F.getContext())),
IntPtrTy(DL.getIntPtrType(F.getContext())),
Int32Ty(Type::getInt32Ty(F.getContext())),
Int8Ty(Type::getInt8Ty(F.getContext())) {}
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/ShadowStackGCLowering.cpp
Expand Up @@ -106,7 +106,7 @@ ShadowStackGCLowering::ShadowStackGCLowering() : FunctionPass(ID) {

Constant *ShadowStackGCLowering::GetFrameMap(Function &F) {
// doInitialization creates the abstract type of this value.
Type *VoidPtr = Type::getInt8PtrTy(F.getContext());
Type *VoidPtr = PointerType::getUnqual(F.getContext());

// Truncate the ShadowStackDescriptor if some metadata is null.
unsigned NumMeta = 0;
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/CodeGen/SjLjEHPrepare.cpp
Expand Up @@ -90,7 +90,7 @@ FunctionPass *llvm::createSjLjEHPreparePass(const TargetMachine *TM) {
bool SjLjEHPrepare::doInitialization(Module &M) {
// Build the function context structure.
// builtin_setjmp uses a five word jbuf
Type *VoidPtrTy = Type::getInt8PtrTy(M.getContext());
Type *VoidPtrTy = PointerType::getUnqual(M.getContext());
unsigned DataBits =
TM ? TM->getSjLjDataSize() : TargetMachine::DefaultSjLjDataSize;
DataTy = Type::getIntNTy(M.getContext(), DataBits);
Expand Down

0 comments on commit 7b9d73c

Please sign in to comment.