mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 10:53:14 +01:00
Now you can run "`ldc test.d -c -mem2reg -simplifycfg`" if you feel the urge. The -O<N> options are still supported, and are inserted in the passes list in the position where they appear on the command line. (so -simplifycfg -O1 -instcombine does the "right thing") One small change: -inline is renamed to -enable-inlining due to a naming conflict with the option to add the -inline pass. -inline now inserts the inlining pass in the position specified, not in the middle of -O<N>. (ldmd has been updated to translate -inline to -enable-inlining)
44 lines
937 B
Bash
Executable File
44 lines
937 B
Bash
Executable File
#! /usr/bin/env bash
|
|
|
|
# Default to 'ldc' next to this file
|
|
LDC=`basename "$0"`/ldc
|
|
if [ ! -x "$LDC" ]; then
|
|
# If that doesn't work, assume this script was called via $PATH
|
|
# and do the same for ldc
|
|
if which ldc &> /dev/null; then
|
|
LDC=ldc
|
|
else
|
|
echo 'ldc not found, check your installation' >/dev/stderr
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
declare -a ARGS
|
|
IDX=0
|
|
for arg; do
|
|
case "$arg" in
|
|
-C*)
|
|
# turn -Cfoo into -foo.
|
|
# Useful for passing -inline to ldc, for instance.
|
|
arg="-${arg:2}"
|
|
;;
|
|
-debug|-debug=*|-version=*)
|
|
arg="-d$arg"
|
|
;;
|
|
-inline)
|
|
arg="-enable-inlining"
|
|
;;
|
|
-fPIC)
|
|
arg="-relocation-model=pic"
|
|
;;
|
|
--a|--b|--c|--f|--r|--w|--x|--y)
|
|
# "Hidden debug switches"
|
|
# Are these ever used?
|
|
arg="-hidden-debug${arg:1}"
|
|
;;
|
|
esac
|
|
ARGS[IDX++]="$arg"
|
|
done
|
|
|
|
exec "$LDC" "${ARGS[@]}"
|