We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d4c9fcc commit 2e2e22cCopy full SHA for 2e2e22c
1 file changed
src/numba/openmp/libs/pass/CGIntrinsicsOpenMP.cpp
@@ -1992,8 +1992,15 @@ void CGIntrinsicsOpenMP::emitOMPOffloadingMappings(
1992
assert(BasePtr && "Expected non-null base pointer");
1993
assert(Ptr && "Expected non-null pointer");
1994
1995
+ Type *ElementType = nullptr;
1996
+ if (FieldTy->isPointerTy())
1997
+ ElementType = FieldInfo.PointeeType;
1998
+ else
1999
+ ElementType = FieldTy;
2000
+ assert(ElementType && "Expected non-null element type");
2001
+
2002
auto ElementSize = ConstantInt::get(
- OMPBuilder.SizeTy, M.getDataLayout().getTypeAllocSize(FieldTy));
2003
+ OMPBuilder.SizeTy, M.getDataLayout().getTypeAllocSize(ElementType));
2004
Value *NumElements = nullptr;
2005
2006
// Load the value of NumElements if it is a pointer.
0 commit comments