From 01fe52b2cc94c786bc723ca9502bcfaa93252942 Mon Sep 17 00:00:00 2001 From: Rot127 Date: Tue, 19 Mar 2024 04:49:45 -0500 Subject: [PATCH] Fix workflows --- .github/workflows/LLVM-Tblgen-Build.yml | 16 +++++++++++++--- compare_tblgen_output.sh | 8 ++++++-- gen_cs_tables.sh | 0 gen_llvm_tables.sh | 0 4 files changed, 19 insertions(+), 5 deletions(-) mode change 100644 => 100755 gen_cs_tables.sh mode change 100644 => 100755 gen_llvm_tables.sh diff --git a/.github/workflows/LLVM-Tblgen-Build.yml b/.github/workflows/LLVM-Tblgen-Build.yml index cc09ab614eea..d4e5d0aaeffa 100644 --- a/.github/workflows/LLVM-Tblgen-Build.yml +++ b/.github/workflows/LLVM-Tblgen-Build.yml @@ -25,8 +25,10 @@ jobs: build-and-test-llvm-tblgen: runs-on: ubuntu-latest steps: - - name: Checkout llvm-capstone + - name: Checkout llvm-capstone (patched backends) uses: actions/checkout@v4 + with: + clean: false - name: Set up Python uses: actions/setup-python@v4 @@ -46,18 +48,26 @@ jobs: run: | ./gen_cs_tables.sh - - name: Checkout llvm-capstone + - name: Checkout LLVM uses: actions/checkout@v4 - ref: auto-sync-18-base + with: + clean: false + ref: auto-sync-18-base - name: Build LLVM llvm-tblgen run: | + rm -rf build mkdir build cd build cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ../llvm cmake --build . --target llvm-tblgen --config Debug cd .. + - name: Checkout llvm-capstone (patched backends) + uses: actions/checkout@v4 + with: + clean: false + - name: Generate original LLVM tables run: | ./gen_llvm_tables.sh diff --git a/compare_tblgen_output.sh b/compare_tblgen_output.sh index ed997cefbe86..c89e72ae8868 100755 --- a/compare_tblgen_output.sh +++ b/compare_tblgen_output.sh @@ -1,9 +1,13 @@ #!/bin/sh # Compare the generated tables of our refactored TableGen to the original ones. +archs="AArch64 ARM PPC" +file_names="GenAsmWriter GenDisassemblerTables GenInstrInfo GenRegisterInfo GenSubtargetInfo GenSystemOperands" +release="18" +gen_dir="output_tmp" # Requires that LLVM tables were generated before. -echo "Diff LLVM files" +echo "Diff LLVM files (blanks and empty lines are ignored)" for arch in $archs; do for file_name in $file_names; do out_CPP_LLVM="$gen_dir/$arch$file_name""_CPP_LLVM.inc" @@ -15,7 +19,7 @@ for arch in $archs; do diff -w -B "$out_CPP_LLVM" "$out_CPP_CS" > /dev/null if [ $? -ne 0 ]; then - echo "The following files mismatch: $out_CPP_LLVM <-> $out_CPP_CS" + echo "The following files mismatch: $out_CPP_LLVM $out_CPP_CS" mismatch="true" fi done diff --git a/gen_cs_tables.sh b/gen_cs_tables.sh old mode 100644 new mode 100755 diff --git a/gen_llvm_tables.sh b/gen_llvm_tables.sh old mode 100644 new mode 100755