[llvm] d44de46 - [OMPIRBuilder] Avoid pointer element type access
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 27 05:34:53 PST 2022
Author: Nikita Popov
Date: 2022-01-27T14:34:46+01:00
New Revision: d44de46254ff02386f261d50a44117ea57f55c09
URL: https://github.com/llvm/llvm-project/commit/d44de46254ff02386f261d50a44117ea57f55c09
DIFF: https://github.com/llvm/llvm-project/commit/d44de46254ff02386f261d50a44117ea57f55c09.diff
LOG: [OMPIRBuilder] Avoid pointer element type access
Use isOpaqueOrPointeeTypeEquals() instead.
Added:
Modified:
llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
index d9b9035a54250..3b8d80c4eeec6 100644
--- a/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
+++ b/llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
@@ -2987,7 +2987,8 @@ Constant *OpenMPIRBuilder::getOrCreateOMPInternalVariable(
StringRef RuntimeName = Out.str();
auto &Elem = *InternalVars.try_emplace(RuntimeName, nullptr).first;
if (Elem.second) {
- assert(Elem.second->getType()->getPointerElementType() == Ty &&
+ assert(cast<PointerType>(Elem.second->getType())
+ ->isOpaqueOrPointeeTypeMatches(Ty) &&
"OMP internal variable has
diff erent type than requested");
} else {
// TODO: investigate the appropriate linkage type used for the global
More information about the llvm-commits
mailing list