Provide C API for MLIR standard attributes. Since standard attributes live
under lib/IR in core MLIR, place the C APIs in the IR library as well (standard
ops will go in a separate library).
Affine map and integer set attributes are only exposed as placeholder types
with IsA support due to the lack of C APIs for the corresponding types.
Integer and floating point attribute APIs expecting APInt and APFloat are not
exposed pending decision on how to support APInt and APFloat.
Do we want to make any claims about the lifetime of the pointer passed to the callback? In practice, it is bounded by the containing context.
For these "always return a single chunk" cases that are more about bridging string representations, I do wonder if we should be directly giving access to the backing buffer as in:
// Populates the data buffer and returns its length.
intptr_t mlirStringAttrGetValue(MlirAttribute attr, const char **data);
Practically, with the callback, we aren't restricting that access anyway so maybe go after it more directly?