18 lines
528 B
Bash
Executable File
18 lines
528 B
Bash
Executable File
#!/bin/zsh
|
|
|
|
if [ $# -ne 1 ]; then
|
|
echo "usage: $0 filename"
|
|
else
|
|
filename=$(basename "$1")
|
|
# cfi directives is a must; LLVM removed the
|
|
# ability to avoid putting cfi directives in
|
|
# the assembly output.
|
|
clang -Wall -std=c99 -S -O0 -mllvm --x86-asm-syntax=intel ${filename%.*}.c
|
|
|
|
if [[ -n `find . -name ${filename%.*}.S` ]]; then
|
|
echo "Wrote ${filename%.*}.S successfully."
|
|
elif [[ -n `find . -name ${filename%.*}.s` ]]; then
|
|
echo "Wrote ${filename%.*}.s successfully."
|
|
fi
|
|
fi
|