From ebde75f3506d9ebcfda29918ef4c0706bfb5beef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 4 Sep 2025 15:08:17 +0300 Subject: [PATCH] build-llvm: Simplify handling of the --pgo= option These variable expansions/modifications work the same if the option "--pgo" is specified - so either we can simplify the stripping of the "--pgo=" prefix, or we can just skip the check, similar to the case above with --instrumented. --- build-llvm.sh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/build-llvm.sh b/build-llvm.sh index 6bdbcd0..9386bd5 100755 --- a/build-llvm.sh +++ b/build-llvm.sh @@ -81,12 +81,8 @@ while [ $# -gt 0 ]; do # A fixed BUILDDIR is set at the end for this case. ;; --pgo|--pgo=*) - case "$1" in - --pgo=*) - LLVM_PROFDATA_FILE="${1#--pgo}" - LLVM_PROFDATA_FILE="${LLVM_PROFDATA_FILE#=}" - ;; - esac + LLVM_PROFDATA_FILE="${1#--pgo}" + LLVM_PROFDATA_FILE="${LLVM_PROFDATA_FILE#=}" LLVM_PROFDATA_FILE="${LLVM_PROFDATA_FILE:-profile.profdata}" if [ ! -e "$LLVM_PROFDATA_FILE" ]; then echo Profile \"$LLVM_PROFDATA_FILE\" not found