Bump to Clang 18 (#1549)

This commit is contained in:
¥IGA 2024-11-21 11:08:22 +01:00 committed by GitHub
parent 3d04765a3f
commit c83ac654ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 11 additions and 11 deletions

View file

@ -10,7 +10,7 @@ if grep -nrI '\s$' src *.yml *.txt *.md Doxyfile .gitignore .gitmodules .ci* dis
fi fi
# Default clang-format points to default 3.5 version one # Default clang-format points to default 3.5 version one
CLANG_FORMAT=clang-format-17 CLANG_FORMAT=clang-format-18
$CLANG_FORMAT --version $CLANG_FORMAT --version
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then

View file

@ -18,7 +18,7 @@ jobs:
continue-on-error: true continue-on-error: true
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: fsfe/reuse-action@v4 - uses: fsfe/reuse-action@v5
clang-format: clang-format:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -30,9 +30,9 @@ jobs:
- name: Install - name: Install
run: | run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main' sudo add-apt-repository 'deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-18 main'
sudo apt update sudo apt update
sudo apt install clang-format-17 sudo apt install clang-format-18
- name: Build - name: Build
env: env:
COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} COMMIT_RANGE: ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}

View file

@ -929,7 +929,7 @@ struct MemoryEditor {
default: default:
case ImGuiDataType_COUNT: case ImGuiDataType_COUNT:
break; break;
} // Switch } // Switch
IM_ASSERT(0); // Shouldn't reach IM_ASSERT(0); // Shouldn't reach
} }
}; };

View file

@ -22,7 +22,7 @@ public:
EventFlagInternal(const std::string& name, ThreadMode thread_mode, QueueMode queue_mode, EventFlagInternal(const std::string& name, ThreadMode thread_mode, QueueMode queue_mode,
uint64_t bits) uint64_t bits)
: m_name(name), m_thread_mode(thread_mode), m_queue_mode(queue_mode), m_bits(bits){}; : m_name(name), m_thread_mode(thread_mode), m_queue_mode(queue_mode), m_bits(bits) {};
int Wait(u64 bits, WaitMode wait_mode, ClearMode clear_mode, u64* result, u32* ptr_micros); int Wait(u64 bits, WaitMode wait_mode, ClearMode clear_mode, u64* result, u32* ptr_micros);
int Poll(u64 bits, WaitMode wait_mode, ClearMode clear_mode, u64* result); int Poll(u64 bits, WaitMode wait_mode, ClearMode clear_mode, u64* result);

View file

@ -14,8 +14,8 @@ namespace Shader::IR {
// Use typename Instruction so the function can be used to return either const or mutable // Use typename Instruction so the function can be used to return either const or mutable
// Insts depending on the context. // Insts depending on the context.
template <typename Instruction, typename Pred> template <typename Instruction, typename Pred>
auto BreadthFirstSearch(Instruction* inst, Pred&& pred) auto BreadthFirstSearch(Instruction* inst,
-> std::invoke_result_t<Pred, Instruction*> { Pred&& pred) -> std::invoke_result_t<Pred, Instruction*> {
// Most often case the instruction is the desired already. // Most often case the instruction is the desired already.
if (std::optional result = pred(inst)) { if (std::optional result = pred(inst)) {
return result; return result;
@ -53,8 +53,8 @@ auto BreadthFirstSearch(Instruction* inst, Pred&& pred)
} }
template <typename Pred> template <typename Pred>
auto BreadthFirstSearch(const Value& value, Pred&& pred) auto BreadthFirstSearch(const Value& value,
-> std::invoke_result_t<Pred, const Inst*> { Pred&& pred) -> std::invoke_result_t<Pred, const Inst*> {
if (value.IsImmediate()) { if (value.IsImmediate()) {
// Nothing to do with immediates // Nothing to do with immediates
return std::nullopt; return std::nullopt;

View file

@ -53,7 +53,7 @@ constexpr Type F64x3{Type::F64x3};
constexpr Type F64x4{Type::F64x4}; constexpr Type F64x4{Type::F64x4};
constexpr Type StringLiteral{Type::StringLiteral}; constexpr Type StringLiteral{Type::StringLiteral};
constexpr OpcodeMeta META_TABLE[]{ constexpr OpcodeMeta META_TABLE[] {
#define OPCODE(name_token, type_token, ...) \ #define OPCODE(name_token, type_token, ...) \
{ \ { \
.name{#name_token}, \ .name{#name_token}, \