This patch adds initial lowering for DeclareTargetAttr on
GlobalOp's utilising registerTargetGlobalVariable
and getAddrOfDeclareTargetVar from the
OMPIRBuilder.
DeclareTargetAttr encapsulates in MLIR a declare
target declaration applied to a piece of global data
or a function and indicates it should undergo
special handling.
The patch currently does not factor in filtering
based on device_type clauses (e.g. no emission of
globals for device if host specified), this will come in
a future iteration.
If we can assert at this point that mapTypes can only contain IntegerAttr at this point, it's better to do mapTypes[index].cast<IntegerAttr>. Otherwise, we should check the result of the dyn_cast before calling getUInt on it to avoid a crash.