Skip to content

[CodeGen][Hexagon] Replace PointerType::getUnqual(Type) with opaque version (NFC) #126274

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions clang/lib/CodeGen/Targets/Hexagon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,6 @@ Address HexagonABIInfo::EmitVAArgForHexagonLinux(CodeGenFunction &CGF,
// Implement the block where argument is in register saved area
CGF.EmitBlock(InRegBlock);

llvm::Type *PTy = CGF.ConvertType(Ty);
llvm::Value *__saved_reg_area_p = CGF.Builder.CreateBitCast(
__current_saved_reg_area_pointer, llvm::PointerType::getUnqual(PTy));

CGF.Builder.CreateStore(__new_saved_reg_area_pointer,
__current_saved_reg_area_pointer_p);

Expand Down Expand Up @@ -388,22 +384,16 @@ Address HexagonABIInfo::EmitVAArgForHexagonLinux(CodeGenFunction &CGF,
CGF.Builder.CreateStore(__new_overflow_area_pointer,
__current_saved_reg_area_pointer_p);

// Bitcast the overflow area pointer to the type of argument.
llvm::Type *OverflowPTy = CGF.ConvertTypeForMem(Ty);
llvm::Value *__overflow_area_p = CGF.Builder.CreateBitCast(
__overflow_area_pointer, llvm::PointerType::getUnqual(OverflowPTy));

CGF.EmitBranch(ContBlock);

// Get the correct pointer to load the variable argument
// Implement the ContBlock
CGF.EmitBlock(ContBlock);

llvm::Type *MemTy = CGF.ConvertTypeForMem(Ty);
llvm::Type *MemPTy = llvm::PointerType::getUnqual(MemTy);
llvm::PHINode *ArgAddr = CGF.Builder.CreatePHI(MemPTy, 2, "vaarg.addr");
ArgAddr->addIncoming(__saved_reg_area_p, InRegBlock);
ArgAddr->addIncoming(__overflow_area_p, OnStackBlock);
llvm::PHINode *ArgAddr = CGF.Builder.CreatePHI(
llvm::PointerType::getUnqual(MemTy->getContext()), 2, "vaarg.addr");
ArgAddr->addIncoming(__current_saved_reg_area_pointer, InRegBlock);
ArgAddr->addIncoming(__overflow_area_pointer, OnStackBlock);

return Address(ArgAddr, MemTy, CharUnits::fromQuantity(ArgAlign));
}
Expand Down