13 Commits

Author SHA1 Message Date
Amr Hesham
62eea86424
[CIR] Update isSized with upstreamed types (#143960)
Update `isSized` function with the upstreamed types
2025-06-13 19:29:21 +02:00
Andy Kaylor
0e90a846d6
[CIR] Add support for global linkage and visibility (#141973)
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-30 13:36:48 -07:00
Andy Kaylor
b574c811e8
[CIR] Defer declarations and tentative definitions (#141700)
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.
2025-05-28 13:53:30 -07:00
Andy Kaylor
ea3c225786
[CIR] Add alignment support for global, store, and load ops (#141163)
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-23 15:34:59 -07:00
Andy Kaylor
7d71164855
[CIR] Upstream support for name mangling (#137094)
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-24 14:24:19 -07:00
Amr Hesham
30d13e3591
[CIR] Upstream ArraySubscriptExpr from function parameter with pointer base (#135493)
This change adds an ArraySubscriptExpr from the function parameter with
base type as Pointer

Issue https://github.com/llvm/llvm-project/issues/130197
2025-04-15 19:52:26 +02:00
Amr Hesham
93370c4ab3
[CIR] Make LLVM & OGCG variables match the same pattern (#135427)
Follow-up patch to improve variable names in LLVM and OGCG in
https://github.com/llvm/llvm-project/pull/134536
2025-04-11 14:36:00 -07:00
Amr Hesham
78921cd884
[CIR] Upstream ArraySubscriptExpr for fixed size array (#134536)
This change adds ArraySubscriptExpr for fixed size ArrayType

Issue #130197
2025-04-11 00:05:22 +02:00
Amr Hesham
262b9b5153
[CIR][Upstream] Local initialization for ArrayType (#132974)
This change adds local initialization for ArrayType

Issue #130197
2025-04-03 19:25:25 +02:00
Amr Hesham
143c37123b
[CIR] Upstream zero init for global variables (#133100)
This change adds zero initialization for global variables
2025-03-31 19:41:29 +02:00
Andy Kaylor
93afd8f9ac
[CIR] Upstream support for type aliases (#131912)
CIR uses aliases for standard integer types and void. This change adds
upstream support for those aliases and updates existing tests.
2025-03-19 14:13:22 -07:00
Amr Hesham
6aeae62aef
[CIR] Upstream global initialization for ArrayType (#131657)
This change adds global initialization for ArrayType

Issue #130197
2025-03-19 21:29:37 +01:00
Amr Hesham
bd0d28ac25
[CIR] Upstream basic support for ArrayType (#130502)
This change adds the basic support for ArrayType

Issue #130197
2025-03-13 18:46:31 +01:00