annotate bin/ldmd2 @ 1650:40bd4a0d4870

Update to work with LLVM 2.7. Removed use of dyn_cast, llvm no compiles without exceptions and rtti by default. We do need exceptions for the libconfig stuff, but rtti isn't necessary (anymore). Debug info needs to be rewritten, as in LLVM 2.7 the format has completely changed. To have something to look at while rewriting, the old code has been wrapped inside #ifndef DISABLE_DEBUG_INFO , this means that you have to define this to compile at the moment. Updated tango 0.99.9 patch to include updated EH runtime code, which is needed for LLVM 2.7 as well.
author Tomas Lindquist Olsen
date Wed, 19 May 2010 12:42:32 +0200
parents 593f99fddd2f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1453
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
1 #! /usr/bin/env bash
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
2
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
3 # Default to 'ldc' next to this file
1583
593f99fddd2f basename => dirname, thanks Hxal
Moritz Warning <moritzwarning@web.de>
parents: 1453
diff changeset
4 LDC=`dirname "$0"`/ldc2
1453
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
5 if [ ! -x "$LDC" ]; then
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
6 # If that doesn't work, assume this script was called via $PATH
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
7 # and do the same for ldc
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
8 if which ldc2 &> /dev/null; then
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
9 LDC=ldc2
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
10 else
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
11 echo 'ldc not found, check your installation' >/dev/stderr
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
12 exit 1
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
13 fi
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
14 fi
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
15
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
16 declare -a ARGS
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
17 IDX=0
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
18 for arg; do
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
19 case "$arg" in
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
20 -C*)
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
21 # turn -Cfoo into -foo.
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
22 # Useful for passing -inline to ldc, for instance.
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
23 arg="-${arg:2}"
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
24 ;;
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
25 -debug|-debug=*|-version=*)
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
26 arg="-d$arg"
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
27 ;;
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
28 -inline)
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
29 arg="-enable-inlining"
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
30 ;;
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
31 -fPIC)
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
32 arg="-relocation-model=pic"
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
33 ;;
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
34 --a|--b|--c|--f|--r|--w|--x|--y)
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
35 # "Hidden debug switches"
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
36 # Are these ever used?
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
37 arg="-hidden-debug${arg:1}"
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
38 ;;
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
39 esac
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
40 ARGS[IDX++]="$arg"
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
41 done
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
42
f35a9a77d256 More tweaks.
Robert Clipsham <robert@octarineparrot.com>
parents:
diff changeset
43 exec "$LDC" "${ARGS[@]}"