Skip to content

Commit d0613ac

Browse files
committed
[CodeGen][Hexagon] Replace of PointerType::get(Type) with opaque version (NFC)
1 parent 27598ab commit d0613ac

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

clang/lib/CodeGen/Targets/Hexagon.cpp

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include "ABIInfoImpl.h"
1010
#include "TargetInfo.h"
11+
#include "llvm/IR/DerivedTypes.h"
1112

1213
using namespace clang;
1314
using namespace clang::CodeGen;
@@ -336,10 +337,6 @@ Address HexagonABIInfo::EmitVAArgForHexagonLinux(CodeGenFunction &CGF,
336337
// Implement the block where argument is in register saved area
337338
CGF.EmitBlock(InRegBlock);
338339

339-
llvm::Type *PTy = CGF.ConvertType(Ty);
340-
llvm::Value *__saved_reg_area_p = CGF.Builder.CreateBitCast(
341-
__current_saved_reg_area_pointer, llvm::PointerType::getUnqual(PTy));
342-
343340
CGF.Builder.CreateStore(__new_saved_reg_area_pointer,
344341
__current_saved_reg_area_pointer_p);
345342

@@ -388,22 +385,16 @@ Address HexagonABIInfo::EmitVAArgForHexagonLinux(CodeGenFunction &CGF,
388385
CGF.Builder.CreateStore(__new_overflow_area_pointer,
389386
__current_saved_reg_area_pointer_p);
390387

391-
// Bitcast the overflow area pointer to the type of argument.
392-
llvm::Type *OverflowPTy = CGF.ConvertTypeForMem(Ty);
393-
llvm::Value *__overflow_area_p = CGF.Builder.CreateBitCast(
394-
__overflow_area_pointer, llvm::PointerType::getUnqual(OverflowPTy));
395-
396388
CGF.EmitBranch(ContBlock);
397-
398389
// Get the correct pointer to load the variable argument
399390
// Implement the ContBlock
400391
CGF.EmitBlock(ContBlock);
401392

402393
llvm::Type *MemTy = CGF.ConvertTypeForMem(Ty);
403-
llvm::Type *MemPTy = llvm::PointerType::getUnqual(MemTy);
404-
llvm::PHINode *ArgAddr = CGF.Builder.CreatePHI(MemPTy, 2, "vaarg.addr");
405-
ArgAddr->addIncoming(__saved_reg_area_p, InRegBlock);
406-
ArgAddr->addIncoming(__overflow_area_p, OnStackBlock);
394+
llvm::PHINode *ArgAddr = CGF.Builder.CreatePHI(
395+
llvm::PointerType::getUnqual(MemTy->getContext()), 2, "vaarg.addr");
396+
ArgAddr->addIncoming(__new_saved_reg_area_pointer, InRegBlock);
397+
ArgAddr->addIncoming(__overflow_area_pointer, OnStackBlock);
407398

408399
return Address(ArgAddr, MemTy, CharUnits::fromQuantity(ArgAlign));
409400
}

0 commit comments

Comments
 (0)