Files
TheRock/rocm-systems/projects/hip/docs/gen_clang_option_doc.sh
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

88 lines
2.0 KiB
Bash
Executable File

#!/bin/bash
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
#
# SPDX-License-Identifier: MIT
## generates documentation about clang options.
clang=/opt/rocm*/llvm/bin/clang
exec > clang_options.md
echo "# Support of Clang options"
echo " Clang version: $($clang --version | head -1|sed 's:\(.*\) (.* \(.*\)).*:\1 \2:')"
echo
echo "|Option|Support|Description|"
echo "|-------|------|-------|"
declare -A db
while read a b; do
if [[ "$a" != "" && "$b" != "" ]]; then
db[$a]="$b"
#echo "db[$a]=${db[$a]}"
fi
done <clang_options.txt
#for K in "${!db[@]}"; do echo $K; done
tmpf=tmp_clang_option.txt
[[ -f $tmpf ]] && rm $tmpf
$clang --help | sed '1,5d'| while read a b; do
if [[ "$a" != "-"* ]]; then
desc="$a $b"
elif [[ "$b" = *'>'* ]]; then
opt=$(echo $a $b| sed -e 's:\(^-[^ ]*[= ]*<[^<>]*>\) *\(.*\):\1:')
desc=$(echo $a $b| sed -e 's:\(^-[^ ]*[= ]*<[^<>]*>\) *\(.*\):\2:')
if [[ "$opt" == "$desc" ]]; then
opt="$a"
desc="$b"
fi
else
opt="$a"
desc="$b"
fi
supp=
key=$(printf "%s" "$opt" |sed 's:\([^ =<]*\).*:\1:')
if [[ "$key" != "" ]]; then
supp="${db[$key]}"
#echo "opt=$opt supp=${db[$opt]}"
fi
if [[ "$supp" == "" ]]; then
if [[ "$desc" = *AArch* ||\
"$desc" = *MIPS* || \
"$desc" = *ARM* || \
"$desc" = *Arm* || \
"$desc" = *SYCL* || \
"$desc" = *PPC* || \
"$desc" = *RISC-V* || \
"$desc" = *WebAssembly* || \
"$desc" = *Objective-C* || \
"$opt" = *xray* \
]]; then
supp="n"
elif [[ "$opt" = *sanity* ]]; then
supp="h"
else
supp="s"
fi
fi
s=$supp
case $supp in
s) supp="Supported";;
n) supp="Unsupported";;
h) supp="Supported on Host only";;
esac
desc=$(echo "$desc"| sed -e 's:^ *::' -e 's:|:\\|:g')
#echo a=$a
#echo b=$b
#echo opt=$opt
#echo desc=$desc
if [[ "$desc" != "" ]]; then
printf "%s %s\n" "$key" "$s" >>$tmpf
echo '|`'$opt'`|'$supp'|`'$desc'`|'
fi
done