Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@ jobs:
run: |
. .venv/bin/activate

cmake . \
-Bbuild \
-DCMAKE_BUILD_TYPE=Release
cmake . -Bbuild -DCMAKE_BUILD_TYPE=Release

cmake --build build
cmake --build build --parallel

- name: Test
working-directory: build
Expand All @@ -40,11 +38,10 @@ jobs:
./build/src/frontend/cxx \
-I src/parser \
-I src/lsp \
-I build/_deps/fmt-src/include \
-I build/_deps/utfcpp-src/source \
-I build/_deps/flatbuffers-src/include \
-I build/_deps/nlohmann_json-src/include \
-I build/src/parser \
-DCXX_NO_FLATBUFFERS \
-DCXX_NO_FILESYSTEM \
-DCXX_NO_THREADS \
$i
Expand All @@ -58,11 +55,10 @@ jobs:
-toolchain linux \
-I src/parser \
-I src/lsp \
-I build/_deps/fmt-src/include \
-I build/_deps/utfcpp-src/source \
-I build/_deps/flatbuffers-src/include \
-I build/_deps/nlohmann_json-src/include \
-I build/src/parser \
-DCXX_NO_FLATBUFFERS \
$i
done

Expand Down Expand Up @@ -95,7 +91,7 @@ jobs:
-DCXX_ENABLE_MLIR=ON \
-DMLIR_DIR=/usr/lib/llvm-18/lib/cmake/mlir

cmake --build build
cmake --build build --parallel

- name: Test
working-directory: build
Expand All @@ -119,7 +115,7 @@ jobs:

cmake . -Bbuild

cmake --build build --config Release
cmake --build build --parallel --config Release

- name: Test
working-directory: build
Expand Down Expand Up @@ -193,7 +189,7 @@ jobs:
-Bbuild \
-DCMAKE_BUILD_TYPE=Release

cmake --build build
cmake --build build --parallel

- name: Test
working-directory: build
Expand All @@ -208,11 +204,10 @@ jobs:
-toolchain macos \
-I src/parser \
-I src/lsp \
-I build/_deps/fmt-src/include \
-I build/_deps/utfcpp-src/source \
-I build/_deps/flatbuffers-src/include \
-I build/_deps/nlohmann_json-src/include \
-I build/src/parser \
-DCXX_NO_FLATBUFFERS \
$i
done

Expand Down Expand Up @@ -259,11 +254,10 @@ jobs:
build.wasi/install/usr/bin/cxx.wasm \
-I src/parser \
-I src/lsp \
-I build.wasi/_deps/fmt-src/include \
-I build.wasi/_deps/utfcpp-src/source \
-I build.wasi/_deps/flatbuffers-src/include \
-I build.wasi/_deps/nlohmann_json-src/include \
-I build.wasi/src/parser \
-DCXX_NO_FLATBUFFERS \
-DCXX_NO_FILESYSTEM \
-DCXX_NO_THREADS \
$i
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ node_modules
.cache
.clangd
*.pch
__pycache__
*.pyc
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ file(READ "${CMAKE_CURRENT_SOURCE_DIR}/package.json" package_json)
# option to install tools
option(CXX_INSTALL_TOOLS "Install tools" ON)
option(CXX_INSTALL_WASI_SYSROOT "Install wasi sysroot" OFF)
option(CXX_ENABLE_FLATBUFFERS "Enable flatbuffers" ON)
option(CXX_ENABLE_FLATBUFFERS "Enable flatbuffers" OFF)
option(CXX_ENABLE_MLIR "Enable MLIR" OFF)
option(CXX_LIBCXX_WITH_CLANG "Link with libc++" OFF)
option(CXX_BUILD_TESTS "Build tests" ON)
Expand Down
5 changes: 5 additions & 0 deletions src/parser/cxx/memory_layout.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ struct AlignmentOf {
return type->symbol()->alignment();
}

auto operator()(const UnboundedArrayType* type) const
-> std::optional<std::size_t> {
return memoryLayout.alignmentOf(type->elementType());
}

auto operator()(auto type) const -> std::optional<std::size_t> {
// ### TODO
if (!type) return std::nullopt;
Expand Down
5 changes: 5 additions & 0 deletions tests/unit_tests/sema/alignof_01.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ static_assert(alignof(long) == 4);
static_assert(alignof(unsigned long) == 4);
static_assert(alignof(long double) == 16);
#endif

static_assert(alignof(char[]) == 1);
static_assert(alignof(int[]) == 4);
static_assert(alignof(double[]) == 8);
static_assert(alignof(__int128_t) == 16);