Skip to content

[CIR] Upstream support for array types #130197

@andykaylor

Description

@andykaylor

Overview

Upstream the basic support for array variable types. The initial change should just add support for declaring and initializing global variables that are arrays of existing scalar types. Follow-up patches can add support for local variables, including dynamic-size arrays, and accessing arrays using the cir.ptr_stride operation.

Suggested minimal test case

// Global
int a[10];
int b[10] = {};
int c[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };

Existing incubator tests

clang/test/CIR/CodeGen/array.c (struct test case will need to be deferred)

Metadata

Metadata

Assignees

Labels

ClangIRAnything related to the ClangIR project

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions