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 <tokazerkje@outlook.com>
This commit is contained in:
parent
48c9fed2da
commit
88f3ff4a28
20
.github/workflows/build_and_test.yml
vendored
20
.github/workflows/build_and_test.yml
vendored
@ -92,7 +92,7 @@ jobs:
|
|||||||
- name: Remove existing clang and LLVM
|
- name: Remove existing clang and LLVM
|
||||||
run: sudo apt purge llvm* clang* lld* lldb* opt*
|
run: sudo apt purge llvm* clang* lld* lldb* opt*
|
||||||
- name: Install and cache deps
|
- 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
|
- name: Add nightly rustfmt and clippy
|
||||||
run: rustup toolchain install nightly --component rustfmt --component clippy --component miri --allow-downgrade
|
run: rustup toolchain install nightly --component rustfmt --component clippy --component miri --allow-downgrade
|
||||||
- name: Install ucd-generate
|
- name: Install ucd-generate
|
||||||
@ -103,7 +103,7 @@ jobs:
|
|||||||
uses: KyleMayes/install-llvm-action@v1
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
with:
|
with:
|
||||||
directory: ${{ runner.temp }}/llvm
|
directory: ${{ runner.temp }}/llvm
|
||||||
version: 16
|
version: 17
|
||||||
# ---- format check ----
|
# ---- format check ----
|
||||||
# pcguard edges and pcguard hitcounts are not compatible and we need to build them seperately
|
# pcguard edges and pcguard hitcounts are not compatible and we need to build them seperately
|
||||||
- name: Check pcguard edges
|
- name: Check pcguard edges
|
||||||
@ -113,7 +113,7 @@ jobs:
|
|||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
run: cargo clean
|
run: cargo clean
|
||||||
- name: Run clang-format style check for C/C++ programs.
|
- 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
|
- name: run shellcheck
|
||||||
run: shellcheck ./scripts/*.sh
|
run: shellcheck ./scripts/*.sh
|
||||||
|
|
||||||
@ -143,7 +143,7 @@ jobs:
|
|||||||
toolchain: stable
|
toolchain: stable
|
||||||
|
|
||||||
- name: Install and cache deps
|
- 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
|
- name: Add nightly rustfmt and clippy
|
||||||
run: rustup toolchain install nightly --component clippy --allow-downgrade && rustup default nightly
|
run: rustup toolchain install nightly --component clippy --allow-downgrade && rustup default nightly
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
@ -152,7 +152,7 @@ jobs:
|
|||||||
uses: KyleMayes/install-llvm-action@v1
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
with:
|
with:
|
||||||
directory: ${{ runner.temp }}/llvm
|
directory: ${{ runner.temp }}/llvm
|
||||||
version: 16
|
version: 17
|
||||||
- name: Run clippy
|
- name: Run clippy
|
||||||
run: ./scripts/clippy.sh
|
run: ./scripts/clippy.sh
|
||||||
|
|
||||||
@ -178,7 +178,7 @@ jobs:
|
|||||||
- name: Remove existing clang and LLVM
|
- name: Remove existing clang and LLVM
|
||||||
run: sudo apt purge llvm* clang*
|
run: sudo apt purge llvm* clang*
|
||||||
- name: Install and cache deps
|
- 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
|
- 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
|
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
|
- name: Install ucd-generate
|
||||||
@ -191,7 +191,7 @@ jobs:
|
|||||||
uses: KyleMayes/install-llvm-action@v1
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
with:
|
with:
|
||||||
directory: ${{ runner.temp }}/llvm
|
directory: ${{ runner.temp }}/llvm
|
||||||
version: 16
|
version: 17
|
||||||
# ---- build and feature check ----
|
# ---- build and feature check ----
|
||||||
# cargo-hack's --feature-powerset would be nice here but libafl has a too many knobs
|
# cargo-hack's --feature-powerset would be nice here but libafl has a too many knobs
|
||||||
- name: Check each feature
|
- name: Check each feature
|
||||||
@ -229,7 +229,7 @@ jobs:
|
|||||||
uses: KyleMayes/install-llvm-action@v1
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
with:
|
with:
|
||||||
directory: ${{ runner.temp }}/llvm
|
directory: ${{ runner.temp }}/llvm
|
||||||
version: 16
|
version: 17
|
||||||
- name: Install deps
|
- name: Install deps
|
||||||
run: sudo apt-get install -y ninja-build python3-dev python3-pip python3-venv libz3-dev
|
run: sudo apt-get install -y ninja-build python3-dev python3-pip python3-venv libz3-dev
|
||||||
- name: Install maturin
|
- name: Install maturin
|
||||||
@ -280,7 +280,7 @@ jobs:
|
|||||||
uses: KyleMayes/install-llvm-action@v1
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
with:
|
with:
|
||||||
directory: ${{ runner.temp }}/llvm
|
directory: ${{ runner.temp }}/llvm
|
||||||
version: 16
|
version: 17
|
||||||
- name: Install deps
|
- 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
|
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
|
- name: pip install
|
||||||
@ -354,7 +354,7 @@ jobs:
|
|||||||
uses: KyleMayes/install-llvm-action@v1
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
with:
|
with:
|
||||||
directory: ${{ runner.temp }}/llvm
|
directory: ${{ runner.temp }}/llvm
|
||||||
version: 16
|
version: 17
|
||||||
- name: Install deps
|
- 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
|
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
|
- name: pip install
|
||||||
|
@ -72,7 +72,7 @@ class CmpLogInstructions : public ModulePass {
|
|||||||
#if USE_NEW_PM
|
#if USE_NEW_PM
|
||||||
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
|
PreservedAnalyses run(Module &M, ModuleAnalysisManager &MAM);
|
||||||
#else
|
#else
|
||||||
bool runOnModule(Module &M) override;
|
bool runOnModule(Module &M) override;
|
||||||
|
|
||||||
#if LLVM_VERSION_MAJOR < 4
|
#if LLVM_VERSION_MAJOR < 4
|
||||||
const char *getPassName() const override {
|
const char *getPassName() const override {
|
||||||
|
@ -392,7 +392,7 @@ bool CmpLogRoutines::hookRtns(Module &M) {
|
|||||||
Value *v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy);
|
Value *v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy);
|
||||||
Value *v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy);
|
Value *v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy);
|
||||||
Value *v3Pbitcast = IRB.CreateBitCast(
|
Value *v3Pbitcast = IRB.CreateBitCast(
|
||||||
v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits()));
|
v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits()));
|
||||||
Value *v3Pcasted =
|
Value *v3Pcasted =
|
||||||
IRB.CreateIntCast(v3Pbitcast, IntegerType::get(C, 64), false);
|
IRB.CreateIntCast(v3Pbitcast, IntegerType::get(C, 64), false);
|
||||||
args.push_back(v1Pcasted);
|
args.push_back(v1Pcasted);
|
||||||
@ -430,7 +430,7 @@ bool CmpLogRoutines::hookRtns(Module &M) {
|
|||||||
Value *v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy);
|
Value *v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy);
|
||||||
Value *v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy);
|
Value *v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy);
|
||||||
Value *v3Pbitcast = IRB.CreateBitCast(
|
Value *v3Pbitcast = IRB.CreateBitCast(
|
||||||
v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits()));
|
v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits()));
|
||||||
Value *v3Pcasted =
|
Value *v3Pcasted =
|
||||||
IRB.CreateIntCast(v3Pbitcast, IntegerType::get(C, 64), false);
|
IRB.CreateIntCast(v3Pbitcast, IntegerType::get(C, 64), false);
|
||||||
args.push_back(v1Pcasted);
|
args.push_back(v1Pcasted);
|
||||||
|
@ -84,8 +84,8 @@ static unsigned char __tmp_alloc_zone[TMP_ZONE_SIZE];
|
|||||||
#else
|
#else
|
||||||
|
|
||||||
// From dlmalloc.c
|
// From dlmalloc.c
|
||||||
void *dlmalloc(size_t);
|
void *dlmalloc(size_t);
|
||||||
void dlfree(void *);
|
void dlfree(void *);
|
||||||
#define backend_malloc dlmalloc
|
#define backend_malloc dlmalloc
|
||||||
#define backend_free dlfree
|
#define backend_free dlfree
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ cargo +nightly fmt
|
|||||||
|
|
||||||
echo "[*] Formatting C(pp) files"
|
echo "[*] Formatting C(pp) files"
|
||||||
# shellcheck disable=SC2046
|
# 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')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user