summaryrefslogtreecommitdiff
path: root/clang/test/CIR/CodeGen/struct.cpp
AgeCommit message (Collapse)Author
2025-11-10[CIR] Re-land: Recognize constant aggregate initialization of auto vars ↵Andy Kaylor
(#167033) This adds code that was previously missing from emitAutoVarAlloca to identify when an aggregate auto var is being emitted with a constant initializer, and the associated code that is called from emitAutoVarInit to store the constant. This allows significantly more efficient initialization. This was previously committed in https://github.com/llvm/llvm-project/pull/166850 but that change contained an unintended modification to an unrelated test.
2025-11-07Revert "[CIR] Recognize constant aggregate initialization of auto vars ↵Aiden Grossman
(#166850)" This reverts commit 5fc1b74af52093cd5229ba0e1c368d41735bb990. This broke premerge (and premerge was failing on the patch itself): 1. https://lab.llvm.org/staging/#/builders/192/builds/10053 2. https://lab.llvm.org/staging/#/builders/21/builds/8268
2025-11-07[CIR] Recognize constant aggregate initialization of auto vars (#166850)Andy Kaylor
This adds code that was previously missing from emitAutoVarAlloca to identify when an aggregate auto var is being emitted with a constant initializer, and the associated code that is called from emitAutoVarInit to store the constant. This allows significantly more efficient initialization.
2025-11-04[CIR] Upstream CXXDefaultArgExpr for AggregateExpr (#165991)Amr Hesham
Upstream the CXXDefaultArgExpr support for AggregateExpr
2025-10-21[CIR] Const member expr for struct type (#164172)Amr Hesham
Upstream support the const member expr for struct type
2025-10-20[CIR] Upstream aggregate binary assign handling (#163877)Andy Kaylor
This upstreams the implementation for handling binary assignment involving aggregate types.
2025-10-05[CIR] Implement DesignatedInitUpdateExpr for AggregateExpr (#161897)Amr Hesham
Implement the DesignatedInitUpdateExpr support for AggregateExpr
2025-10-04[CIR] Implement emitAtomicInit for AggregateExpr (#161826)Amr Hesham
Implement emitAtomicInit support for AggregateExpr
2025-10-04[CIR] Implement UnaryExtension for AggregateExpr (#161820)Amr Hesham
Implement the UnaryExtension support for AggregateExpr
2025-10-04[CIR] Implement BinComma Expr for AggregateExpr (#161823)Amr Hesham
Implement the BinComma Expr support for AggregateExpr
2025-10-01[CIR] Implement GenericSelectionExpr for AggregateExpr (#161003)Amr Hesham
Implement the GenericSelectionExpr for AggregateExpr
2025-09-30[CIR] Implement ChooseExpr for AggregateExpr (#160999)Amr Hesham
Implement the ChooseExpr for aggregate expr
2025-09-30[CIR] Upstream ParenExpr for AggregateExpr (#160998)Amr Hesham
Upstream ParenExpr support for AggregateExpr
2025-06-25[CIR] Add support for function linkage and visibility (#145600)Andy Kaylor
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.
2025-05-30[CIR] Enable support for nested struct members in C++ (#142205)Andy Kaylor
This enables us to compile C++ code with nested structures. The necessary support for this was already in place, but we were hitting an NYI error in a place where the implementation only needed to check for base classes. Base classes really aren't implemented yet, so the error is left in place but it is now behind a check for a non-zero number of bases so that the simple case is unblocked.
2025-05-30[CIR] Add support for global linkage and visibility (#141973)Andy Kaylor
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.
2025-05-23[CIR] Add alignment support for global, store, and load ops (#141163)Andy Kaylor
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.
2025-05-07[CIR] Unblock simple C++ structure support (#138368)Andy Kaylor
This change adds additional checks to a few places where a simple struct in C++ code was triggering `errorNYI` in places where no additional handling was needed, and adds a very small amount of trivial initialization. The code now checks for the conditions that do require extra handling before issuing the diagnostic. New tests are added for declaring and using a simple struct in C++ code.
2025-04-24[CIR] Upstream support for name mangling (#137094)Andy Kaylor
We have been using the default names for global symbols to this point. This change introduces proper name mangling for functions. This requires introducing a CXXABI class in the CIRGenModule. Because only target independent name mangling is handled in this patch, the CXXABI class does not require a target-specific implementation. The general mechanism for selecting an implementation is introduced here, but the actual target-specific subclasses are deferred until needed.
2025-04-23[CIR] Introduce type aliases for records (#136387)Andy Kaylor
This introduces MLIR aliases for ClangIR record types. These are used in the incubator and having skipped over them upstream is causing the tests to diverge.
2025-04-14[CIR] Upstream minimal support for structure types (#135105)Andy Kaylor
This change adds minimal support for structure types. To keep the initial change small, only incomplete declarations are being supported in this patch. More complete support will follow.