File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
IGC/WrapperLLVM/include/llvmWrapper/IR Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ SPDX-License-Identifier: MIT
15
15
#include " llvm/IR/Module.h"
16
16
#include " common/CommonMacros.h"
17
17
18
+ #include " Type.h"
19
+
18
20
namespace IGCLLVM
19
21
{
20
22
@@ -70,6 +72,23 @@ namespace IGCLLVM
70
72
return EltTy;
71
73
#else
72
74
return Ty->getWithNewBitWidth (NewBitWidth);
75
+ #endif
76
+ }
77
+
78
+ inline llvm::PointerType* getWithSamePointeeType (llvm::PointerType* PT, unsigned AddressSpace) {
79
+ #if LLVM_VERSION_MAJOR < 14
80
+ return llvm::PointerType::get (PT->getElementType (), AddressSpace);
81
+ #else
82
+ return llvm::PointerType::getWithSamePointeeType (PT, AddressSpace);
83
+ #endif
84
+ }
85
+
86
+ inline bool isOpaqueOrPointeeTypeEquals (llvm::Type* tyA, llvm::Type* tyB) {
87
+ #if LLVM_VERSION_MAJOR < 14
88
+ return IGCLLVM::getNonOpaquePtrEltTy (tyA) == IGCLLVM::getNonOpaquePtrEltTy (tyB);
89
+ #else
90
+ llvm::PointerType* pTyA = llvm::dyn_cast<llvm::PointerType>(tyA);
91
+ return pTyA && pTyA->isOpaqueOrPointeeTypeMatches (tyB);
73
92
#endif
74
93
}
75
94
}
You can’t perform that action at this time.
0 commit comments