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
16 changes: 8 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ jobs:
run: |
sudo apt-get install libcppunit-dev

- name: Install Clang 19
- name: Install Clang 20
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main"
sudo add-apt-repository "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-20 main"
sudo apt-get update
sudo apt-get install -y clang-19 clang-tidy-19
sudo apt-get install -y clang-20 clang-tidy-20
if: matrix.compiler == 'clang'

- name: Install Clang Format
run: sudo apt-get install -y clang-format-19
run: sudo apt-get install -y clang-format-20
if: matrix.compiler == 'clang' && matrix.gc == 'GENERATIONAL'

- name: Build SOM VM
run: |
if [ "${{ matrix.compiler }}" = "clang" ]
then
export CC=clang-19
export CXX=clang++-19
export CC=clang-20
export CXX=clang++-20
else
export CC=gcc
export CXX=g++
Expand All @@ -68,12 +68,12 @@ jobs:
- name: Clang Tidy
if: matrix.compiler == 'clang'
run: |
clang-tidy-19 --config-file=.clang-tidy src/**/*.cpp -- -fdiagnostics-absolute-paths -DGC_TYPE=${{ matrix.gc}} ${{ matrix.integers }} -DUNITTESTS
clang-tidy-20 --config-file=.clang-tidy src/**/*.cpp -- -fdiagnostics-absolute-paths -DGC_TYPE=${{ matrix.gc}} ${{ matrix.integers }} -DUNITTESTS

- name: Clang Format
if: matrix.compiler == 'clang' && matrix.gc == 'GENERATIONAL'
run: |
clang-format-19 --dry-run --style=file --Werror src/*.cpp src/**/*.cpp src/**/*.h
clang-format-20 --dry-run --style=file --Werror src/*.cpp src/**/*.cpp src/**/*.h

# Disabled because it's too slow with the sanitizers
# - name: Test SomSom
Expand Down
4 changes: 2 additions & 2 deletions lint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/sh

CLANG_FORMAT="clang-format-mp-19 -i --style=file --Werror src/*.cpp src/**/*.cpp src/**/*.h"
CLANG_FORMAT="clang-format-mp-20 -i --style=file --Werror src/*.cpp src/**/*.cpp src/**/*.h"
$CLANG_FORMAT

## The check --enable-check-profile flag gives an overview of where clang-tidy spends its time
# --enable-check-profile

CLANG_START="clang-tidy-mp-19 --config-file=.clang-tidy"
CLANG_START="clang-tidy-mp-20 --config-file=.clang-tidy"
CLANG_END="--fix \
-- -I/opt/local/include/ -fdiagnostics-absolute-paths \
-DGC_TYPE=GENERATIONAL -DUSE_TAGGING=false -DCACHE_INTEGER=false -DUNITTESTS"
Expand Down
14 changes: 9 additions & 5 deletions src/memory/GarbageCollector.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,20 @@
*/

#include "../misc/defs.h"
#include "../vm/Print.h"
#include "../vmobjects/ObjectFormats.h"

class IGarbageCollector {
public:
virtual ~IGarbageCollector() = default;
virtual void Collect() = 0;
};

template <class HEAP_T>
class GarbageCollector {
class GarbageCollector : public IGarbageCollector {
public:
explicit GarbageCollector(HEAP_T* h) : heap(h) {}
virtual ~GarbageCollector() = default;
virtual void Collect() = 0;
void PrintGCStat() const;
void PrintCollectStat() const;
~GarbageCollector() override = default;

protected:
HEAP_T* const heap;
Expand Down
9 changes: 5 additions & 4 deletions src/vm/Universe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ void Universe::Shutdown() {
}

static void printVmConfig() {
if (GC_TYPE == GENERATIONAL) {
if (GC_TYPE == GENERATIONAL) { // NOLINT(misc-redundant-expression)
cout << "\tgarbage collector: generational\n";
} else if (GC_TYPE == COPYING) {
} else if (GC_TYPE == COPYING) { // NOLINT(misc-redundant-expression)
cout << "\tgarbage collector: copying\n";
} else if (GC_TYPE == MARK_SWEEP) {
} else if (GC_TYPE == MARK_SWEEP) { // NOLINT(misc-redundant-expression)
cout << "\tgarbage collector: mark-sweep\n";
} else if (GC_TYPE == DEBUG_COPYING) {
} else if (GC_TYPE == DEBUG_COPYING) { // NOLINT(misc-redundant-expression)
cout << "\tgarbage collector: debug copying\n";
} else {
cout << "\tgarbage collector: unknown\n";
Expand Down Expand Up @@ -644,6 +644,7 @@ VMArray* Universe::NewArray(size_t size) {
auto* result = new (GetHeap<HEAP_CLS>(),
additionalBytes ALLOC_OUTSIDE_NURSERY(outsideNursery))
VMArray(size, additionalBytes);
// NOLINTNEXTLINE(misc-redundant-expression)
if ((GC_TYPE == GENERATIONAL) && outsideNursery) {
result->SetGCField(MASK_OBJECT_IS_OLD);
}
Expand Down