[llvm] [polly] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-06 Thread Paulo Matos via cfe-commits

https://github.com/pmatos updated 
https://github.com/llvm/llvm-project/pull/71029

>From fe3ed6bcc6eface6e7bfa3e9b043f8287dd129b0 Mon Sep 17 00:00:00 2001
From: Paulo Matos 
Date: Fri, 3 Nov 2023 12:03:07 +0100
Subject: [PATCH] [NFC] Remove Type::getInt8PtrTy

Replace this with PointerType::getUnqual().
Followup to the opaque pointer transition. Fixes an in-code TODO item.
---
 clang/lib/CodeGen/CGGPUBuiltin.cpp| 13 +--
 clang/lib/CodeGen/CodeGenTypes.cpp|  2 +-
 clang/lib/CodeGen/CoverageMappingGen.cpp  |  2 +-
 .../clang-linker-wrapper/OffloadWrapper.cpp   | 53 ++--
 llvm/examples/BrainF/BrainF.cpp   |  2 +-
 llvm/include/llvm/IR/Type.h   |  5 --
 .../llvm/ProfileData/InstrProfData.inc| 12 +--
 llvm/lib/Analysis/StackSafetyAnalysis.cpp |  4 +-
 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp |  2 +-
 llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp|  2 +-
 llvm/lib/CodeGen/DwarfEHPrepare.cpp   |  8 +-
 llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp  |  8 +-
 llvm/lib/CodeGen/SafeStack.cpp|  2 +-
 llvm/lib/CodeGen/ShadowStackGCLowering.cpp|  2 +-
 llvm/lib/CodeGen/SjLjEHPrepare.cpp|  2 +-
 llvm/lib/CodeGen/StackProtector.cpp   |  4 +-
 llvm/lib/CodeGen/TargetLoweringBase.cpp   | 12 +--
 llvm/lib/ExecutionEngine/ExecutionEngine.cpp  |  2 +-
 llvm/lib/Frontend/Offloading/Utility.cpp  | 10 +--
 llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 85 ++-
 llvm/lib/IR/Type.cpp  |  4 -
 .../Target/AArch64/AArch64ISelLowering.cpp|  9 +-
 .../AMDGPU/AMDGPULowerModuleLDSPass.cpp   |  2 +-
 .../AMDGPUOpenCLEnqueuedBlockLowering.cpp |  6 +-
 llvm/lib/Target/ARM/ARMISelLowering.cpp   |  4 +-
 .../Target/BPF/BPFAbstractMemberAccess.cpp|  3 +-
 llvm/lib/Target/DirectX/DXILOpBuilder.cpp |  3 +-
 llvm/lib/Target/PowerPC/PPCISelLowering.cpp   |  2 +-
 llvm/lib/Target/X86/X86ISelLowering.cpp   |  4 +-
 llvm/lib/Target/X86/X86ISelLoweringCall.cpp   |  4 +-
 llvm/lib/Target/X86/X86WinEHState.cpp | 22 ++---
 llvm/lib/Target/XCore/XCoreISelLowering.cpp   |  2 +-
 llvm/lib/Transforms/CFGuard/CFGuard.cpp   |  5 +-
 llvm/lib/Transforms/Coroutines/CoroElide.cpp  |  2 +-
 llvm/lib/Transforms/Coroutines/CoroInstr.h|  6 +-
 llvm/lib/Transforms/Coroutines/CoroSplit.cpp  |  8 +-
 .../Instrumentation/AddressSanitizer.cpp  |  4 +-
 .../Instrumentation/DataFlowSanitizer.cpp |  8 +-
 .../Instrumentation/GCOVProfiling.cpp |  6 +-
 .../Instrumentation/InstrProfiling.cpp| 10 +--
 .../Instrumentation/PGOInstrumentation.cpp|  2 +-
 .../Transforms/Scalar/LoopDataPrefetch.cpp|  2 +-
 .../Scalar/RewriteStatepointsForGC.cpp|  2 +-
 .../Scalar/StraightLineStrengthReduce.cpp |  2 +-
 llvm/lib/Transforms/Utils/CodeExtractor.cpp   |  2 +-
 .../Utils/EntryExitInstrumenter.cpp   |  6 +-
 .../lib/Transforms/Utils/EscapeEnumerator.cpp |  2 +-
 llvm/lib/Transforms/Utils/InlineFunction.cpp  |  4 +-
 .../lib/Transforms/Utils/LowerGlobalDtors.cpp |  2 +-
 llvm/lib/Transforms/Utils/ModuleUtils.cpp |  2 +-
 llvm/lib/Transforms/Utils/SanitizerStats.cpp  | 11 +--
 llvm/tools/bugpoint/Miscompilation.cpp|  4 +-
 .../Analysis/CGSCCPassManagerTest.cpp | 27 +++---
 llvm/unittests/Analysis/LazyCallGraphTest.cpp | 60 +++--
 .../unittests/Analysis/MemoryBuiltinsTest.cpp |  2 +-
 .../Analysis/ScalarEvolutionTest.cpp  |  2 +-
 .../Frontend/OpenMPIRBuilderTest.cpp  |  4 +-
 llvm/unittests/FuzzMutate/OperationsTest.cpp  |  4 +-
 llvm/unittests/Linker/LinkModulesTest.cpp | 18 ++--
 polly/lib/Analysis/ScopDetection.cpp  |  2 +-
 60 files changed, 281 insertions(+), 225 deletions(-)

diff --git a/clang/lib/CodeGen/CGGPUBuiltin.cpp 
b/clang/lib/CodeGen/CGGPUBuiltin.cpp
index 75fb06de938425d..de4ee68c0da1e79 100644
--- a/clang/lib/CodeGen/CGGPUBuiltin.cpp
+++ b/clang/lib/CodeGen/CGGPUBuiltin.cpp
@@ -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);
 
@@ -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] [polly] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-06 Thread Paulo Matos via cfe-commits

https://github.com/pmatos updated 
https://github.com/llvm/llvm-project/pull/71029

>From fe3ed6bcc6eface6e7bfa3e9b043f8287dd129b0 Mon Sep 17 00:00:00 2001
From: Paulo Matos 
Date: Fri, 3 Nov 2023 12:03:07 +0100
Subject: [PATCH 1/2] [NFC] Remove Type::getInt8PtrTy

Replace this with PointerType::getUnqual().
Followup to the opaque pointer transition. Fixes an in-code TODO item.
---
 clang/lib/CodeGen/CGGPUBuiltin.cpp| 13 +--
 clang/lib/CodeGen/CodeGenTypes.cpp|  2 +-
 clang/lib/CodeGen/CoverageMappingGen.cpp  |  2 +-
 .../clang-linker-wrapper/OffloadWrapper.cpp   | 53 ++--
 llvm/examples/BrainF/BrainF.cpp   |  2 +-
 llvm/include/llvm/IR/Type.h   |  5 --
 .../llvm/ProfileData/InstrProfData.inc| 12 +--
 llvm/lib/Analysis/StackSafetyAnalysis.cpp |  4 +-
 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp |  2 +-
 llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp|  2 +-
 llvm/lib/CodeGen/DwarfEHPrepare.cpp   |  8 +-
 llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp  |  8 +-
 llvm/lib/CodeGen/SafeStack.cpp|  2 +-
 llvm/lib/CodeGen/ShadowStackGCLowering.cpp|  2 +-
 llvm/lib/CodeGen/SjLjEHPrepare.cpp|  2 +-
 llvm/lib/CodeGen/StackProtector.cpp   |  4 +-
 llvm/lib/CodeGen/TargetLoweringBase.cpp   | 12 +--
 llvm/lib/ExecutionEngine/ExecutionEngine.cpp  |  2 +-
 llvm/lib/Frontend/Offloading/Utility.cpp  | 10 +--
 llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 85 ++-
 llvm/lib/IR/Type.cpp  |  4 -
 .../Target/AArch64/AArch64ISelLowering.cpp|  9 +-
 .../AMDGPU/AMDGPULowerModuleLDSPass.cpp   |  2 +-
 .../AMDGPUOpenCLEnqueuedBlockLowering.cpp |  6 +-
 llvm/lib/Target/ARM/ARMISelLowering.cpp   |  4 +-
 .../Target/BPF/BPFAbstractMemberAccess.cpp|  3 +-
 llvm/lib/Target/DirectX/DXILOpBuilder.cpp |  3 +-
 llvm/lib/Target/PowerPC/PPCISelLowering.cpp   |  2 +-
 llvm/lib/Target/X86/X86ISelLowering.cpp   |  4 +-
 llvm/lib/Target/X86/X86ISelLoweringCall.cpp   |  4 +-
 llvm/lib/Target/X86/X86WinEHState.cpp | 22 ++---
 llvm/lib/Target/XCore/XCoreISelLowering.cpp   |  2 +-
 llvm/lib/Transforms/CFGuard/CFGuard.cpp   |  5 +-
 llvm/lib/Transforms/Coroutines/CoroElide.cpp  |  2 +-
 llvm/lib/Transforms/Coroutines/CoroInstr.h|  6 +-
 llvm/lib/Transforms/Coroutines/CoroSplit.cpp  |  8 +-
 .../Instrumentation/AddressSanitizer.cpp  |  4 +-
 .../Instrumentation/DataFlowSanitizer.cpp |  8 +-
 .../Instrumentation/GCOVProfiling.cpp |  6 +-
 .../Instrumentation/InstrProfiling.cpp| 10 +--
 .../Instrumentation/PGOInstrumentation.cpp|  2 +-
 .../Transforms/Scalar/LoopDataPrefetch.cpp|  2 +-
 .../Scalar/RewriteStatepointsForGC.cpp|  2 +-
 .../Scalar/StraightLineStrengthReduce.cpp |  2 +-
 llvm/lib/Transforms/Utils/CodeExtractor.cpp   |  2 +-
 .../Utils/EntryExitInstrumenter.cpp   |  6 +-
 .../lib/Transforms/Utils/EscapeEnumerator.cpp |  2 +-
 llvm/lib/Transforms/Utils/InlineFunction.cpp  |  4 +-
 .../lib/Transforms/Utils/LowerGlobalDtors.cpp |  2 +-
 llvm/lib/Transforms/Utils/ModuleUtils.cpp |  2 +-
 llvm/lib/Transforms/Utils/SanitizerStats.cpp  | 11 +--
 llvm/tools/bugpoint/Miscompilation.cpp|  4 +-
 .../Analysis/CGSCCPassManagerTest.cpp | 27 +++---
 llvm/unittests/Analysis/LazyCallGraphTest.cpp | 60 +++--
 .../unittests/Analysis/MemoryBuiltinsTest.cpp |  2 +-
 .../Analysis/ScalarEvolutionTest.cpp  |  2 +-
 .../Frontend/OpenMPIRBuilderTest.cpp  |  4 +-
 llvm/unittests/FuzzMutate/OperationsTest.cpp  |  4 +-
 llvm/unittests/Linker/LinkModulesTest.cpp | 18 ++--
 polly/lib/Analysis/ScopDetection.cpp  |  2 +-
 60 files changed, 281 insertions(+), 225 deletions(-)

diff --git a/clang/lib/CodeGen/CGGPUBuiltin.cpp 
b/clang/lib/CodeGen/CGGPUBuiltin.cpp
index 75fb06de938425d..de4ee68c0da1e79 100644
--- a/clang/lib/CodeGen/CGGPUBuiltin.cpp
+++ b/clang/lib/CodeGen/CGGPUBuiltin.cpp
@@ -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);
 
@@ -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] [polly] [clang] [NFC] Remove Type::getInt8PtrTy (PR #71029)

2023-11-06 Thread Paulo Matos via cfe-commits

https://github.com/pmatos updated 
https://github.com/llvm/llvm-project/pull/71029

>From fe3ed6bcc6eface6e7bfa3e9b043f8287dd129b0 Mon Sep 17 00:00:00 2001
From: Paulo Matos 
Date: Fri, 3 Nov 2023 12:03:07 +0100
Subject: [PATCH 1/3] [NFC] Remove Type::getInt8PtrTy

Replace this with PointerType::getUnqual().
Followup to the opaque pointer transition. Fixes an in-code TODO item.
---
 clang/lib/CodeGen/CGGPUBuiltin.cpp| 13 +--
 clang/lib/CodeGen/CodeGenTypes.cpp|  2 +-
 clang/lib/CodeGen/CoverageMappingGen.cpp  |  2 +-
 .../clang-linker-wrapper/OffloadWrapper.cpp   | 53 ++--
 llvm/examples/BrainF/BrainF.cpp   |  2 +-
 llvm/include/llvm/IR/Type.h   |  5 --
 .../llvm/ProfileData/InstrProfData.inc| 12 +--
 llvm/lib/Analysis/StackSafetyAnalysis.cpp |  4 +-
 llvm/lib/Bitcode/Writer/BitcodeWriter.cpp |  2 +-
 llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp|  2 +-
 llvm/lib/CodeGen/DwarfEHPrepare.cpp   |  8 +-
 llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp  |  8 +-
 llvm/lib/CodeGen/SafeStack.cpp|  2 +-
 llvm/lib/CodeGen/ShadowStackGCLowering.cpp|  2 +-
 llvm/lib/CodeGen/SjLjEHPrepare.cpp|  2 +-
 llvm/lib/CodeGen/StackProtector.cpp   |  4 +-
 llvm/lib/CodeGen/TargetLoweringBase.cpp   | 12 +--
 llvm/lib/ExecutionEngine/ExecutionEngine.cpp  |  2 +-
 llvm/lib/Frontend/Offloading/Utility.cpp  | 10 +--
 llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp | 85 ++-
 llvm/lib/IR/Type.cpp  |  4 -
 .../Target/AArch64/AArch64ISelLowering.cpp|  9 +-
 .../AMDGPU/AMDGPULowerModuleLDSPass.cpp   |  2 +-
 .../AMDGPUOpenCLEnqueuedBlockLowering.cpp |  6 +-
 llvm/lib/Target/ARM/ARMISelLowering.cpp   |  4 +-
 .../Target/BPF/BPFAbstractMemberAccess.cpp|  3 +-
 llvm/lib/Target/DirectX/DXILOpBuilder.cpp |  3 +-
 llvm/lib/Target/PowerPC/PPCISelLowering.cpp   |  2 +-
 llvm/lib/Target/X86/X86ISelLowering.cpp   |  4 +-
 llvm/lib/Target/X86/X86ISelLoweringCall.cpp   |  4 +-
 llvm/lib/Target/X86/X86WinEHState.cpp | 22 ++---
 llvm/lib/Target/XCore/XCoreISelLowering.cpp   |  2 +-
 llvm/lib/Transforms/CFGuard/CFGuard.cpp   |  5 +-
 llvm/lib/Transforms/Coroutines/CoroElide.cpp  |  2 +-
 llvm/lib/Transforms/Coroutines/CoroInstr.h|  6 +-
 llvm/lib/Transforms/Coroutines/CoroSplit.cpp  |  8 +-
 .../Instrumentation/AddressSanitizer.cpp  |  4 +-
 .../Instrumentation/DataFlowSanitizer.cpp |  8 +-
 .../Instrumentation/GCOVProfiling.cpp |  6 +-
 .../Instrumentation/InstrProfiling.cpp| 10 +--
 .../Instrumentation/PGOInstrumentation.cpp|  2 +-
 .../Transforms/Scalar/LoopDataPrefetch.cpp|  2 +-
 .../Scalar/RewriteStatepointsForGC.cpp|  2 +-
 .../Scalar/StraightLineStrengthReduce.cpp |  2 +-
 llvm/lib/Transforms/Utils/CodeExtractor.cpp   |  2 +-
 .../Utils/EntryExitInstrumenter.cpp   |  6 +-
 .../lib/Transforms/Utils/EscapeEnumerator.cpp |  2 +-
 llvm/lib/Transforms/Utils/InlineFunction.cpp  |  4 +-
 .../lib/Transforms/Utils/LowerGlobalDtors.cpp |  2 +-
 llvm/lib/Transforms/Utils/ModuleUtils.cpp |  2 +-
 llvm/lib/Transforms/Utils/SanitizerStats.cpp  | 11 +--
 llvm/tools/bugpoint/Miscompilation.cpp|  4 +-
 .../Analysis/CGSCCPassManagerTest.cpp | 27 +++---
 llvm/unittests/Analysis/LazyCallGraphTest.cpp | 60 +++--
 .../unittests/Analysis/MemoryBuiltinsTest.cpp |  2 +-
 .../Analysis/ScalarEvolutionTest.cpp  |  2 +-
 .../Frontend/OpenMPIRBuilderTest.cpp  |  4 +-
 llvm/unittests/FuzzMutate/OperationsTest.cpp  |  4 +-
 llvm/unittests/Linker/LinkModulesTest.cpp | 18 ++--
 polly/lib/Analysis/ScopDetection.cpp  |  2 +-
 60 files changed, 281 insertions(+), 225 deletions(-)

diff --git a/clang/lib/CodeGen/CGGPUBuiltin.cpp 
b/clang/lib/CodeGen/CGGPUBuiltin.cpp
index 75fb06de938425d..de4ee68c0da1e79 100644
--- a/clang/lib/CodeGen/CGGPUBuiltin.cpp
+++ b/clang/lib/CodeGen/CGGPUBuiltin.cpp
@@ -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);
 
@@ -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()),
+