Age | Commit message (Collapse) | Author | Files | Lines |
|
This sets the MLIR module name to the main filename (according to the
SourceManager), if one is available. The module name gets used when
creating global init functions, so we will need it to be set.
|
|
This patch adds basic support for constant record initializer list
expressions. There's a couple of limitations:
* No zero initialized padding bytes in C mode
* No bitfields
* No designated initializer lists
* Record alignments are not calculated, yet
* ILEs of derived records don't work, yet
* The constant attribute is not propagated to the backend, resulting in
non-constants being emitted in the LLVM IR
|
|
This adds the support for implicit VTT arguments in constructors.
|
|
TagDecls (#155463)
And make use of those.
These changes are split from prior PR #155028, in order to decrease the
size of that PR and facilitate review.
|
|
This changes a bunch of places which use getAs<TagType>, including
derived types, just to obtain the tag definition.
This is preparation for #155028, offloading all the changes that PR used
to introduce which don't depend on any new helpers.
|
|
The getCIRSourceLanguage wasn't returning a value if the source language
was anything other than C or C++. This change updates that function to
return a std::optional value and only adds the source language attribute
if one was returned.
|
|
This adds a simplified version of the code to emit vtables. It does not
yet handle RTTI or cases that require multiple vtables.
|
|
This patch upstreams `SourceLangAttr` and its CodeGen logic in the CGM,
which encodes the source language in CIR.
|
|
|
|
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 handles both implicit and explicit template instantiations of
template class static member variables.
|
|
This change introduces the #cir.global_view attribute and adds support
for using that attribute to handle initializing a global variable with
the address of another global variable.
This does not yet include support for the optional list of indices to
get an offset from the base address. Those will be added in a follow-up
patch.
|
|
This adds support for initializing the vptr member of a dynamic class in
the constructor of that class.
This does not include support for lowering the
`cir.vtable.address_point` operation to the LLVM dialect. That handling
will be added in a follow-up patch.
|
|
|
|
This PR adds a support for file scope assembly in CIR.
|
|
|
|
This fixes a number of warnings in release builds due to variables that
were only being used in asserts. Some of these variables will later be
used in non-debug code, but for now they are unused in release builds.
|
|
This implements support for structured bindings on a function scope
level. It does not add support for global structured bindings.
|
|
This patch adds or completes support for a couple of top level
declaration types that don't emit any code: Most notably these include
Concepts, static_assert and type aliases.
|
|
This fairly simple addition enables codegen for C++ conversion operators
|
|
The Cygwin target is generally very similar to the MinGW target. The
default auto-import behavior, the default calling convention, the
`.dll.a` import library extension, the `__GXX_TYPEINFO_EQUALITY_INLINE`
pre-define by `g++`, and the long double configuration.
Co-authored-by: Mateusz Mikuła <oss@mateuszmikula.dev>
|
|
This adds standard-comforming handling for calls to functions that were
declared in C source in the no prototype form.
|
|
This change adds support for LValueBitcast for ComplexType
https://github.com/llvm/llvm-project/issues/141365
|
|
This patch upstreams support for writing inline and out of line C++
destructor definitions. Calling a destructor implcitly or explicitly is
left for a future patch.
Because of that restriction complete destructors (D2 in Itanium
mangling) do not call into the base (D1) destructors yet but simply
behave like a base destructor. Deleting (D0) destructor support is not
part of this patch.
Destructor aliases aren't supported, either. Because of this compilation
with -mno-constructor-aliases may be required to avoid running into NYI
errors.
|
|
These decl types don't require any code generation, though when debug
info is implemented, we will need to add handling for that. Until then,
we just need to have a handler so they don't generate an NYI error.
|
|
This patch adds the `#cir.opt_info` attribute which holds module-level
optimization information.
|
|
This adds support for assignment operators, including implicit operator
definitions.
|
|
This adds the code to handle operator new expressions in ClangIR.
|
|
This change adds support for handling the -mconstructor-aliases option
in CIR. Aliases are not yet correctly lowered to LLVM IR. That will be
implemented in a future change.
|
|
This fixes a warning where a variable assigned in 'if' statement wasn't
referenced again.
|
|
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.
|
|
Upstream the code to handle member variable initialization in a
constructor. At this point only simple scalar values (including members
of anonymous unions) are handled.
|
|
This change upstreams the code to emit simple constructor defintions.
|
|
This change adds support for calling C++ constructors. The support for
actually defining a constructor is still missing and will be added in a
later change.
|
|
This change adds the support for accessing a member of a base class from
a derived class object.
|
|
This adds the needed handling for completing record types which were
previously declared leading us to create an incomplete record type.
|
|
This change adds the switch case to allow template specialization to
pass through emitTopLevelDecl without issuing an error.
|
|
This adds emitTopLevelDecl "handlers" for Using and UsingShadow. These
don't actually need any handling, but they need to be present in the
switch to avoid hitting the default handler, which issues a diagnostic
about the decl kind not being implemented.
There are several other decl kinds that don't need any handling. Those
will be added when I have test cases for them.
|
|
This change implements deferring function definition emission until
first use.
|
|
This change adds support for deferring global variable definitions until
first use whenever it is possible to do so. Although deferring function
definitions uses much of the same implementation, function deferral will
be added in a follow-up change.
|
|
This change upstreams the code to support emitting inline C++ function
definitions, including the ASTConsumer handler for inline definitions
and the code to load the 'this' pointer.
This necessitates introducing the Itanium CXXABI class. No other CXXABI
subclasses are supported at this time. The Itanium CXXABI is used for
AppleARM64, which will require its own handler for a few special cases
(such as array cookies) later.
|
|
This change adds extra processing of global variable definitions to
correctly set the dso_local and comdat attributes.
|
|
This change adds support for the CIRGlobalValueInterface and attributes
for visibility and comdat to GlobalOp.
The comdat attribute isn't correctly calculated yet, but it was required
for the CIRGlobalValueInterface interface. There are also some cases
where dso_local isn't set correctly, but it is better than it was before
this change. Those issues will be addressed in a future patch.
|
|
This change adds code to defer emitting declarations and tentative
definitions until they are referenced or trigger by a call to
CompleteTentativeDefinition. This is needed to avoid premature handling
of declarations and definitions that might not be referenced in the
current translation unit. It also avoids incorrectly adding an
initializer to external declarations.
This change also updates the way the insertion location for globals is
chosen so that all globals will be emitted together at the top of the
module. This makes no functional difference, but it is very useful for
writing sensible tests.
Some tests are modified in this change to reorder global variables so
that they can be checked in the order in which they will be emitted.
|
|
This adds alignment support for GlobalOp, LoadOp, and StoreOp.
Tests which failed because cir.store/cir.load now print alignment were
updated with wildcard matches, except where the alignment was relevant
to the test. Tests which check for cir.store/cir.load in cases that
don't have explicit alignment were not updated.
New tests for alignment are alignment.c, align-load.c, and
align-store.c.
|
|
This adds the minimal support needed to handle string literals.
|
|
This change adds the support needed to handle a C++ member function
call, including arranging the function type with an argument added for
the 'this' parameter. It was necessary to introduce the class to handle
the CXXABI, but at this time no target-specific subclasses have been
added.
|
|
This change replaces the simplified call that we were previously using
to convert the function type provided by a global declaration to the CIR
function type. We now go through 'arrangeGlobalDeclaration' which builds
the function type in a more complicated manner. This change has no
observable differences for the currently upstreamed CIR support, but it
is necessary to prepare for C++ member function calls, which require the
extra handling.
|
|
This adds basic handling for non-prototype functions in C.
Closes #130200.
|
|
|