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
31 changes: 28 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ jobs:
strategy:
matrix:
# Test on the oldest support Ubuntu version in addition to `latest`.
# Build using the oldest support macOS version. For emsdk this is
# currently macos-13, but unfortunately that doesn't exist in github
# actions so we settle for macos-15.
# Build using the oldest macOS runner available on GitHub Actions.
# emsdk CI currently uses Xcode 15.4 (macOS 14), which is unavailable
# here, so we also test Clang 15 + libc++ in `build-clang-15`.
os: [ubuntu-22.04, ubuntu-latest, macos-15, windows-latest, windows-11-arm]
steps:
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -439,3 +439,28 @@ jobs:
cmake -S . -B out -G Ninja -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DBYN_ENABLE_ASSERTIONS=OFF
- name: build
run: cmake --build out -v

# Ensures compatibility with Clang 15 and libc++ 15 (matching Xcode 15.4 in
# emsdk CI, which uses Apple Clang 15).
build-clang-15:
name: clang-15 (libc++)
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-python@v5
with:
python-version: '3.x'
- uses: actions/checkout@v4
with:
submodules: true
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build clang-15 lld libc++-15-dev libc++abi-15-dev

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see clang-15 installable like this.. out of curiosity, are all clang versions generally available in this manner?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For any given ubuntu release I think there will be several such clang versions, and it varies with ubuntu releases.

For example on my machine I can install clang-17 - clang-22, but not earlier versions.

- name: cmake
run: |
mkdir -p out
cmake -S . -B out -G Ninja -DCMAKE_INSTALL_PREFIX=out/install -DCMAKE_C_COMPILER=clang-15 -DCMAKE_CXX_COMPILER=clang++-15 -DCMAKE_CXX_FLAGS="-stdlib=libc++"
- name: build
run: cmake --build out -v
- name: unittest
run: ./out/bin/binaryen-unittests
4 changes: 2 additions & 2 deletions src/dataflow/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ struct Node {
}
}

bool operator==(const Node& other) {
bool operator==(const Node& other) const {
if (type != other.type) {
return false;
}
Expand Down Expand Up @@ -201,7 +201,7 @@ struct Node {
return true;
}

bool operator!=(const Node& other) { return !(*this == other); }
bool operator!=(const Node& other) const { return !(*this == other); }

// As mentioned above, comparisons return i1. This checks
// if an operation is of that sort.
Expand Down
6 changes: 4 additions & 2 deletions src/passes/Unsubtyping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,10 +362,12 @@ struct TypeTree {
// DFS stack of (node index, child index) pairs.
std::vector<std::pair<Index, Index>> stack;

bool operator==(const SubtypeIterator& other) {
bool operator==(const SubtypeIterator& other) const {
return stack == other.stack;
}
bool operator!=(const SubtypeIterator& other) { return !(*this == other); }
bool operator!=(const SubtypeIterator& other) const {
return !(*this == other);
}
const HeapType& operator*() const {
return parent->nodes[stack.back().first].type;
}
Expand Down
7 changes: 7 additions & 0 deletions src/wasm.h
Original file line number Diff line number Diff line change
Expand Up @@ -2468,6 +2468,13 @@ class Function : public Importable {
lineNumber = BinaryLocation(-1),
columnNumber = BinaryLocation(-1);
std::optional<BinaryLocation> symbolNameIndex;
DebugLocation() = default;
DebugLocation(BinaryLocation fileIndex,
BinaryLocation lineNumber,
BinaryLocation columnNumber,
std::optional<BinaryLocation> symbolNameIndex = std::nullopt)
: fileIndex(fileIndex), lineNumber(lineNumber),
columnNumber(columnNumber), symbolNameIndex(symbolNameIndex) {}
bool operator==(const DebugLocation& other) const {
return fileIndex == other.fileIndex && lineNumber == other.lineNumber &&
columnNumber == other.columnNumber &&
Expand Down
Loading