Codegen support (stripped out) for the annotate attribute.
[llvm-complete.git] / tools / gccas / gccas.sh
blob258d9604810a95e8cf8565e33601b8050c2bf630
1 #!/bin/sh
2 ##===- tools/gccas.sh ------------------------------------------*- bash -*-===##
3 #
4 # The LLVM Compiler Infrastructure
6 # This file was developed by Reid Spencer and is distributed under the
7 # University of Illinois Open Source License. See LICENSE.TXT for details.
8 #
9 ##===----------------------------------------------------------------------===##
11 # Synopsis: This shell script is a replacement for the old "gccas" tool that
12 # existed in LLVM versions before 2.0. The functionality of gccas has
13 # now been moved to opt and llvm-as. This shell script provides
14 # backwards compatibility so build environments invoking gccas can
15 # still get the net effect of llvm-as/opt by running gccas.
17 # Syntax: gccas OPTIONS... [asm file]
19 ##===----------------------------------------------------------------------===##
21 echo "gccas: This tool is deprecated, please use opt" 1>&2
22 TOOLDIR=@TOOLDIR@
23 OPTOPTS="-std-compile-opts -f"
24 ASOPTS=""
25 lastwasdasho=0
26 for option in "$@" ; do
27 option=`echo "$option" | sed 's/^--/-/'`
28 case "$option" in
29 -disable-opt)
30 OPTOPTS="$OPTOPTS $option"
32 -disable-inlining)
33 OPTOPTS="$OPTOPTS $option"
35 -verify)
36 OPTOPTS="$OPTOPTS -verify-each"
38 -strip-debug)
39 OPTOPTS="$OPTOPTS $option"
41 -o)
42 OPTOPTS="$OPTOPTS -o"
43 lastwasdasho=1
45 -disable-compression)
46 # ignore
48 -traditional-format)
49 # ignore
51 -*)
52 OPTOPTS="$OPTOPTS $option"
55 if test $lastwasdasho -eq 1 ; then
56 OPTOPTS="$OPTOPTS $option"
57 lastwasdasho=0
58 else
59 ASOPTS="$ASOPTS $option"
62 esac
63 done
64 ${TOOLDIR}/llvm-as $ASOPTS -o - | ${TOOLDIR}/opt $OPTOPTS