This patch adds the constant attribute to cir.global, the appropriate
lowering to LLVM constant and updates the tests.
---------
Co-authored-by: Andy Kaylor <akaylor@nvidia.com>
This patch adds extra function attributes to the `cir.call` operation.
The extra attributes now may contain a single `cir.nothrow` attribute
that indicates whether the callee throws.
This change adds support for function linkage and visibility and related
attributes. Most of the test changes are generalizations to allow
'dso_local' to be accepted where we aren't specifically testing for it.
Some tests based on CIR inputs have been updated to add 'private' to
function declarations where required by newly supported interfaces.
The dso-local.c test has been updated to add specific tests for
dso_local being set correctly, and a new test, func-linkage.cpp tests
other linkage settings.
This change sets `comdat` correctly in CIR, but it is not yet applied to
functions when lowering to LLVM IR. That will be handled in a later
change.
The CIR handling of `dso_local` for globals was upstreamed without the
underscore, making it inconsistent with the incubator and LLVM IR. This
change restores the underscore.
This patch upstreams support for builtins that map to a standard library
function. Examples would be abort() and printf().
It also fixes a minor issue with the errorNYI for all remaining
unimplemented builtins using the mlir::Location instead of the clang AST
SourceLocation.