From 88f3ff4a282aa1092da7890fa3ae2f4a57d2fb45 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Fri, 5 Jan 2024 23:32:06 +0100 Subject: [PATCH] Clang-format latest (#1651) * Clang-format latest * add * rdm * CHATGPT * CHATDUMB * different action * no * fix * ci * ci * ci * fuck * dir * checkout? * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * ci * don't use shit * ci * ci * ci * FMT --------- Co-authored-by: toka --- .github/workflows/build_and_test.yml | 20 ++++++++++---------- libafl_cc/src/cmplog-instructions-pass.cc | 2 +- libafl_cc/src/cmplog-routines-pass.cc | 4 ++-- libafl_qemu/libqasan/malloc.c | 4 ++-- scripts/fmt_all.sh | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index a97a3d1426..f4b178878d 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -92,7 +92,7 @@ jobs: - name: Remove existing clang and LLVM run: sudo apt purge llvm* clang* lld* lldb* opt* - name: Install and cache deps - run: sudo apt install ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev + run: sudo apt install ninja-build shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev - name: Add nightly rustfmt and clippy run: rustup toolchain install nightly --component rustfmt --component clippy --component miri --allow-downgrade - name: Install ucd-generate @@ -103,7 +103,7 @@ jobs: uses: KyleMayes/install-llvm-action@v1 with: directory: ${{ runner.temp }}/llvm - version: 16 + version: 17 # ---- format check ---- # pcguard edges and pcguard hitcounts are not compatible and we need to build them seperately - name: Check pcguard edges @@ -113,7 +113,7 @@ jobs: - name: Cleanup run: cargo clean - name: Run clang-format style check for C/C++ programs. - run: clang-format-13 -n -Werror --style=file $(find . -type f \( -name '*.cpp' -o -iname '*.hpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.cc' -o -name '*.h' \) | grep -v '/target/' | grep -v 'libpng-1\.6\.37' | grep -v 'stb_image\.h' | grep -v 'dlmalloc\.c' | grep -v 'QEMU-Nyx') + run: clang-format -n -Werror --style=file $(find . -type f \( -name '*.cpp' -o -iname '*.hpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.cc' -o -name '*.h' \) | grep -v '/target/' | grep -v 'libpng-1\.6\.37' | grep -v 'stb_image\.h' | grep -v 'dlmalloc\.c' | grep -v 'QEMU-Nyx') - name: run shellcheck run: shellcheck ./scripts/*.sh @@ -143,7 +143,7 @@ jobs: toolchain: stable - name: Install and cache deps - run: sudo apt install ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev + run: sudo apt install ninja-build shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev - name: Add nightly rustfmt and clippy run: rustup toolchain install nightly --component clippy --allow-downgrade && rustup default nightly - uses: actions/checkout@v3 @@ -152,7 +152,7 @@ jobs: uses: KyleMayes/install-llvm-action@v1 with: directory: ${{ runner.temp }}/llvm - version: 16 + version: 17 - name: Run clippy run: ./scripts/clippy.sh @@ -178,7 +178,7 @@ jobs: - name: Remove existing clang and LLVM run: sudo apt purge llvm* clang* - name: Install and cache deps - run: sudo apt install ninja-build clang-format-13 shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev + run: sudo apt install ninja-build clang-format shellcheck libgtk-3-dev gcc-arm-linux-gnueabi g++-arm-linux-gnueabi libslirp-dev libz3-dev - name: Install cargo-hack run: curl -LsSf https://github.com/taiki-e/cargo-hack/releases/latest/download/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xzf - -C ~/.cargo/bin - name: Install ucd-generate @@ -191,7 +191,7 @@ jobs: uses: KyleMayes/install-llvm-action@v1 with: directory: ${{ runner.temp }}/llvm - version: 16 + version: 17 # ---- build and feature check ---- # cargo-hack's --feature-powerset would be nice here but libafl has a too many knobs - name: Check each feature @@ -229,7 +229,7 @@ jobs: uses: KyleMayes/install-llvm-action@v1 with: directory: ${{ runner.temp }}/llvm - version: 16 + version: 17 - name: Install deps run: sudo apt-get install -y ninja-build python3-dev python3-pip python3-venv libz3-dev - name: Install maturin @@ -280,7 +280,7 @@ jobs: uses: KyleMayes/install-llvm-action@v1 with: directory: ${{ runner.temp }}/llvm - version: 16 + version: 17 - name: Install deps run: sudo apt install nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-mipsel-linux-gnu g++-mipsel-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-i386-cross libc6-dev libc6-dev-i386 lib32gcc-11-dev lib32stdc++-11-dev libgtk-3-dev pax-utils libz3-dev - name: pip install @@ -354,7 +354,7 @@ jobs: uses: KyleMayes/install-llvm-action@v1 with: directory: ${{ runner.temp }}/llvm - version: 16 + version: 17 - name: Install deps run: sudo apt install nasm ninja-build gcc-arm-linux-gnueabi g++-arm-linux-gnueabi gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-mipsel-linux-gnu g++-mipsel-linux-gnu gcc-powerpc-linux-gnu g++-powerpc-linux-gnu libc6-dev-i386-cross libc6-dev libc6-dev-i386 lib32gcc-11-dev lib32stdc++-11-dev libgtk-3-dev pax-utils libz3-dev - name: pip install diff --git a/libafl_cc/src/cmplog-instructions-pass.cc b/libafl_cc/src/cmplog-instructions-pass.cc index 41eb3b0c26..22a641aa2a 100644 --- a/libafl_cc/src/cmplog-instructions-pass.cc +++ b/libafl_cc/src/cmplog-instructions-pass.cc @@ -72,7 +72,7 @@ class CmpLogInstructions : public ModulePass { #if USE_NEW_PM PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM); #else - bool runOnModule(Module &M) override; + bool runOnModule(Module &M) override; #if LLVM_VERSION_MAJOR < 4 const char *getPassName() const override { diff --git a/libafl_cc/src/cmplog-routines-pass.cc b/libafl_cc/src/cmplog-routines-pass.cc index 0a3fdf35bc..25fe1d6e76 100644 --- a/libafl_cc/src/cmplog-routines-pass.cc +++ b/libafl_cc/src/cmplog-routines-pass.cc @@ -392,7 +392,7 @@ bool CmpLogRoutines::hookRtns(Module &M) { Value *v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy); Value *v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy); Value *v3Pbitcast = IRB.CreateBitCast( - v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits())); + v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits())); Value *v3Pcasted = IRB.CreateIntCast(v3Pbitcast, IntegerType::get(C, 64), false); args.push_back(v1Pcasted); @@ -430,7 +430,7 @@ bool CmpLogRoutines::hookRtns(Module &M) { Value *v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy); Value *v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy); Value *v3Pbitcast = IRB.CreateBitCast( - v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits())); + v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits())); Value *v3Pcasted = IRB.CreateIntCast(v3Pbitcast, IntegerType::get(C, 64), false); args.push_back(v1Pcasted); diff --git a/libafl_qemu/libqasan/malloc.c b/libafl_qemu/libqasan/malloc.c index 96afe333f9..afb389bc78 100644 --- a/libafl_qemu/libqasan/malloc.c +++ b/libafl_qemu/libqasan/malloc.c @@ -84,8 +84,8 @@ static unsigned char __tmp_alloc_zone[TMP_ZONE_SIZE]; #else // From dlmalloc.c -void *dlmalloc(size_t); -void dlfree(void *); +void *dlmalloc(size_t); +void dlfree(void *); #define backend_malloc dlmalloc #define backend_free dlfree diff --git a/scripts/fmt_all.sh b/scripts/fmt_all.sh index 959ed9e62e..e73018c042 100755 --- a/scripts/fmt_all.sh +++ b/scripts/fmt_all.sh @@ -11,7 +11,7 @@ cargo +nightly fmt echo "[*] Formatting C(pp) files" # shellcheck disable=SC2046 -clang-format-13 -i --style=file $(find . -type f \( -name '*.cpp' -o -iname '*.hpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.cc' -o -name '*.c' -o -name '*.h' \) | grep -v '/target/' | grep -v 'libpng-1\.6\.37' | grep -v 'stb_image\.h' | grep -v 'dlmalloc\.c') +clang-format-17 -i --style=file $(find . -type f \( -name '*.cpp' -o -iname '*.hpp' -o -name '*.cc' -o -name '*.cxx' -o -name '*.cc' -o -name '*.c' -o -name '*.h' \) | grep -v '/target/' | grep -v 'libpng-1\.6\.37' | grep -v 'stb_image\.h' | grep -v 'dlmalloc\.c')