Skip to content

Commit

Permalink
[clang] Replace uses of Type::getPointerType (NFC)
Browse files Browse the repository at this point in the history
Opaque pointer clean-up effort
  • Loading branch information
JOE1994 committed Oct 5, 2023
1 parent 5a36904 commit 6907c3d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions clang/lib/CodeGen/CodeGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4790,7 +4790,8 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, llvm::Type *Ty,
assert(getContext().getTargetAddressSpace(ExpectedAS) == TargetAS);
if (DAddrSpace != ExpectedAS) {
return getTargetCodeGenInfo().performAddrSpaceCast(
*this, GV, DAddrSpace, ExpectedAS, Ty->getPointerTo(TargetAS));
*this, GV, DAddrSpace, ExpectedAS,
llvm::PointerType::get(getLLVMContext(), TargetAS));
}

return GV;
Expand Down Expand Up @@ -5002,7 +5003,8 @@ castStringLiteralToDefaultAddressSpace(CodeGenModule &CGM,
if (AS != LangAS::Default)
Cast = CGM.getTargetCodeGenInfo().performAddrSpaceCast(
CGM, GV, AS, LangAS::Default,
GV->getValueType()->getPointerTo(
llvm::PointerType::get(
CGM.getLLVMContext(),
CGM.getContext().getTargetAddressSpace(LangAS::Default)));
}
return Cast;
Expand Down Expand Up @@ -6377,7 +6379,8 @@ ConstantAddress CodeGenModule::GetAddrOfGlobalTemporary(
if (AddrSpace != LangAS::Default)
CV = getTargetCodeGenInfo().performAddrSpaceCast(
*this, GV, AddrSpace, LangAS::Default,
Type->getPointerTo(
llvm::PointerType::get(
getLLVMContext(),
getContext().getTargetAddressSpace(LangAS::Default)));

// Update the map with the new temporary. If we created a placeholder above,
Expand Down

0 comments on commit 6907c3d

Please sign in to comment.