Skip to content

Commit

Permalink
[OMPIRBuilder] Avoid pointer element type access
Browse files Browse the repository at this point in the history
Use isOpaqueOrPointeeTypeEquals() instead.
  • Loading branch information
nikic committed Jan 27, 2022
1 parent 258a0a3 commit d44de46
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llvm/lib/Frontend/OpenMP/OMPIRBuilder.cpp
Expand Up @@ -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 different type than requested");
} else {
// TODO: investigate the appropriate linkage type used for the global
Expand Down

0 comments on commit d44de46

Please sign in to comment.