Age | Commit message (Collapse) | Author | Files | Lines |
|
This adds support for handling static lambda invokers.
|
|
This adds support for lambda operators and lambda calls. This does not
include support for static lambda invoke, which will be added in a later
change.
|
|
This adds basic support for eliding copy constructors. In order to make
this possible, it also adds support for returning structures. This
support does not include setting an NRVO flag when the class whose copy
is being elided has a non-trivial destructor.
|
|
A recent change introduced a new dtor kind, which caused a build warning
in the CIR code where this dtor kind wasn't handled in a switch. This
fixes the problem.
|
|
This adds the support for implicit VTT arguments in constructors.
|
|
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.
|
|
Depends on #153625
This patch adds support for statement expressions. It also changes
emitCompoundStmt and emitCompoundStmtWithoutScope to accept an Address
that the optional result is written to. This allows the creation of the
alloca ahead of the creation of the scope which saves us from hoisting
the alloca to its parent scope.
|
|
Part of #153286
|
|
This patchs adds a symbol table to CIRGenFunction plus scopes and
insertions to the table where we were missing them previously.
|
|
representation (#152846)
After AST representation, new modifications landed in
(https://github.com/llvm/llvm-project/pull/147835). ClangIR requires
some changes in how we use Clang AST to be compatible with the new
changes
|
|
This patch upstreams CIRGen and LLVM lowering support for the
`__builtin_assume_aligned` builtin function.
|
|
|
|
When the cleanup handling code was initially upstreamed, a SmallVector
was used to simplify the handling of the stack of cleanup objects.
However, that mechanism won't scale well enough for the rate at which
cleanup handlers are going to be pushed and popped while compiling a
large program. This change introduces the custom memory allocator which
is used in classic codegen and the CIR incubator.
Thiis does not otherwise change the cleanup handling implementation and
many parts of the infrastructure are still missing.
This is not intended to have any observable effect on the generated CIR,
but it does change the internal implementation significantly, so it's
not exactly an NFC change. The functionality is covered by existing
tests.
|
|
This change adds support for Plus & Minus CompoundAssignment for
ComplexType
https://github.com/llvm/llvm-project/issues/141365
|
|
|
|
(NFC) (#151217)
This applies similar changes to llvm/llvm-project#150428
|
|
This adds code to handle expressions with cleanup, including
materializing a temporary object for the expression.
|
|
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 fixes a warning about an unannotated fallthrough.
|
|
This change adds support for LValueBitcast for ComplexType
https://github.com/llvm/llvm-project/issues/141365
|
|
This change adds basic handling for normal cleanups. This is a very
minimal implemention. In particular, it uses a naive substitute for the
rich cleanup and EH stack handling that is present in classic codegen
and the CIR incubator. This is intended as a temporary implementation to
allow incremental progress. It is not expected to scale well enough to
be used in a production environment. It will be replaced with the full
EHScopeStack handling when such an implementation is needed.
|
|
This patch upstreams support for creating arrays of classes that require
calling a constructor.
* Adds the ArrayCtor operation
* New lowering pass for lowering ArrayCtor to a loop
---------
Co-authored-by: Andy Kaylor <akaylor@nvidia.com>
Co-authored-by: Henrich Lauko <xlauko@mail.muni.cz>
|
|
The initial implementation for emitting destructors emitted the complete
destructor body for both D1 and D2 destructors. This change updates the
code to have the D1 destructor call the D2 destructor.
|
|
Upstream CompoundLiteralExpr for Scalar as a prerequisite for
CompoundLiteralExpr for ComplexType
|
|
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.
|
|
This adds support for assignment operators, including implicit operator
definitions.
|
|
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 patch updates cir.call operation and allows function calls with
aggregate arguments and return values.
It seems that C++ class support is still at a minimum now. I tried to
make a call to a C++ function with an argument of aggregate type but it
failed because the initialization of C++ class / struct is NYI. I also
tried to inline this part of support into this patch, but the mixed
patch quickly blows in size and becomes unsuitable for review. Thus,
tests for calling functions with aggregate arguments are added only for
C for now.
|
|
This change adds the necessary support for handling delegating
constructors in ClangIR. The implementation is kept as small as possible
by not handling any other sort of initialization (members, base classes,
etc.). That will be added in a future commit.
|
|
This change upstreams the code to emit simple constructor defintions.
|
|
This change adds the support for accessing a member of a base class from
a derived class object.
|
|
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 fixes a warning about an unhandled type in a switch
statement in CIRGenFunction::getEvaluationKind. It also moves two types
that were marked as NYI to the appropriate group.
|
|
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 handling for C++ member operator calls, implicit no-op
casts, and l-value call expressions. Together, these changes enable
handling of range for loops based on iterators.
|
|
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 fixes a warning where a variable assigned in 'if' statement wasn't
referenced again.
|
|
Compound assignment in C++ goes through a different path than the binary
assignment operators that were already handled for C. This change adds
the necessary handler to get this working with C++.
|
|
This adds ClangIR support for accessing structure members. Access to
union members is deferred to a later change.
|
|
This change adds support for handling ParenExpr in scalar expressions. A
few more places will need to be updated after structure assignment and
complex type support is in place.
|
|
This change adds ArraySubscriptExpr for fixed size ArrayType
Issue #130197
|
|
This patch adds support for if statements in the CIR dialect
Additionally, multiple RUN lines were introduced to improve codegen test
coverage
|
|
This change adds local initialization for ArrayType
Issue #130197
|
|
Alloca operations were being emitted into the entry block of the current
function unconditionally, even if the variable they represented was
declared in a different scope. This change upstreams the code for
handling
insertion of the alloca into the proper lexcial scope. It also adds a
CIR-to-CIR transformation to hoist allocas to the function entry block,
which is necessary to produce the expected LLVM IR during lowering.
|
|
This patch adds upstreams support for BinOp including lvalue
assignments. Note that this does not include ternary ops,
BinOpOverflowOp, pointer arithmetic, ShiftOp and SelectOp which are
required for logical binary operators.
---------
Co-authored-by: Morris Hafner <mhafner@nvidia.com>
Co-authored-by: Andy Kaylor <akaylor@nvidia.com>
|
|
Upstream the parts of class `CIRGenFunction::LexicalScope` that
implement function return values. There is a bit of other functionality
in here, such as the implicit `cir.yield` at the end of a non-function
scope, but this is mostly about function returns.
The parts of `LexicalScope` that handle calling destructors, switch
statements, ternary expressions, and exception handling still need to be
upstreamed.
There is a change in the generated ClangIR (which is why many of the
tests needed updating). Return values are stored in the
compiler-generated variable `__retval` rather than being passed to the
`cir.return` op directly. But there should be no change in the behavior
of the generated code.
|
|
This adds support for the cir.unary plus, minus, inc, dec, and not operations for integer, floating point, and boolean types.
|
|
Previous CIR commits have introduced a few warnings. This change fixes
those.
There are still warnings present when building with GCC because GCC
warns about virtual functions being hidden in the mlir::OpConversion
classes. A separate discussion will be required to decide what should be
done about those.
|
|
This change adds support for collecting function arguments and storing
them in alloca memory slots.
|