From 054f6dc04de35418296e7efd3d48b850b3cdc284 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Tue, 23 Jun 2020 13:59:59 -0400 Subject: [PATCH] Fail the Jenkins build if there's any unused asm (#222) * Check for unused asm * Deleting some unused asm --- Jenkinsfile | 5 ++++ data/overlays/actors/z_arms_hook.data.s | 32 ------------------------ data/overlays/actors/z_arms_hook.reloc.s | 13 ---------- tools/find_unused_asm.sh | 15 ++++++++--- 4 files changed, 17 insertions(+), 48 deletions(-) delete mode 100644 data/overlays/actors/z_arms_hook.data.s delete mode 100644 data/overlays/actors/z_arms_hook.reloc.s diff --git a/Jenkinsfile b/Jenkinsfile index 4a6388f600..348dda0c37 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,6 +2,11 @@ pipeline { agent any stages { + stage('Check for unused asm') { + steps { + sh './tools/find_unused_asm.sh' + } + } stage('Setup') { steps { echo 'Setting up...' diff --git a/data/overlays/actors/z_arms_hook.data.s b/data/overlays/actors/z_arms_hook.data.s deleted file mode 100644 index e45f30bea0..0000000000 --- a/data/overlays/actors/z_arms_hook.data.s +++ /dev/null @@ -1,32 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purpose registers - -.section .data - -.balign 16 - -glabel Arms_Hook_InitVars - .word 0x00660700, 0x00000030, 0x00140000, 0x00000218 -.word ArmsHook_Init -.word ArmsHook_Destroy -.word ArmsHook_Update -.word ArmsHook_Draw -glabel D_80865B00 - .word 0x0A090000, 0x08030000, 0x02000000, 0x00000080, 0x00010000, 0xFFCFFFFF, 0x00000000, 0x05000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x3F000000, 0x00000000, 0x00000000, 0x3F000000, 0x00000000, 0xFFFF64FF, 0xFF320000 -glabel D_80865B70 - .word 0x00000000, 0x00000000, 0x00000000 -glabel D_80865B7C - .word 0x00000000, 0x00000000, 0x44610000 -glabel D_80865B88 - .word 0x00000000, 0x43FA0000, 0xC53B8000 -glabel D_80865B94 - .word 0x00000000, 0xC3FA0000, 0xC53B8000 -glabel D_80865BA0 - .word 0x00000000, 0x43FA0000, 0x44960000 -glabel D_80865BAC - .word 0x00000000, 0xC3FA0000, 0x44960000, 0x00000000, 0x00000000 - diff --git a/data/overlays/actors/z_arms_hook.reloc.s b/data/overlays/actors/z_arms_hook.reloc.s deleted file mode 100644 index d439138c87..0000000000 --- a/data/overlays/actors/z_arms_hook.reloc.s +++ /dev/null @@ -1,13 +0,0 @@ -.include "macro.inc" - - # assembler directives - .set noat # allow manual use of $at - .set noreorder # don't insert nops after branches - .set gp=64 # allow use of 64-bit general purpose registers - -.section .rodata - -.balign 16 - -glabel D_80865C20 - .incbin "baserom/ovl_Arms_Hook", 0xD20, 0x000000F0 diff --git a/tools/find_unused_asm.sh b/tools/find_unused_asm.sh index 23e480e3bf..56009ed21b 100755 --- a/tools/find_unused_asm.sh +++ b/tools/find_unused_asm.sh @@ -19,13 +19,22 @@ done < data_list.txt comm -3 <(sort old_list.txt) <(sort cur_list.txt) > diff.txt comm -3 <(sort old_data_list.txt) <(sort list.txt) >> diff.txt +rm old_list.txt cur_list.txt old_data_list.txt data_list.txt list.txt + if [ "$1" = "-d" ] then if [ -s diff.txt ] then - git rm $(cat diff.txt) + rm $(cat diff.txt) fi rm diff.txt +else + if [ -s diff.txt ] + then + cat diff.txt + rm diff.txt + exit 55 + else + rm diff.txt + fi fi - -rm old_list.txt cur_list.txt old_data_list.txt data_list.txt list.txt