blob: 9cacad4b675f3050db71a84dd31108e8e9be1890 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001#!/bin/sh
2##===- tools/gccas.sh ------------------------------------------*- bash -*-===##
3#
4# The LLVM Compiler Infrastructure
5#
Chris Lattner2a068da2007-12-29 20:46:15 +00006# This file is distributed under the University of Illinois Open Source
7# License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00008#
9##===----------------------------------------------------------------------===##
10#
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.
16#
17# Syntax: gccas OPTIONS... [asm file]
18#
19##===----------------------------------------------------------------------===##
20#
21echo "gccas: This tool is deprecated, please use opt" 1>&2
22TOOLDIR=@TOOLDIR@
23OPTOPTS="-std-compile-opts -f"
24ASOPTS=""
25lastwasdasho=0
26for option in "$@" ; do
27 option=`echo "$option" | sed 's/^--/-/'`
28 case "$option" in
29 -disable-opt)
30 OPTOPTS="$OPTOPTS $option"
31 ;;
32 -disable-inlining)
33 OPTOPTS="$OPTOPTS $option"
34 ;;
35 -verify)
36 OPTOPTS="$OPTOPTS -verify-each"
37 ;;
38 -strip-debug)
39 OPTOPTS="$OPTOPTS $option"
40 ;;
41 -o)
42 OPTOPTS="$OPTOPTS -o"
43 lastwasdasho=1
44 ;;
45 -disable-compression)
46 # ignore
47 ;;
48 -traditional-format)
49 # ignore
50 ;;
51 -*)
52 OPTOPTS="$OPTOPTS $option"
53 ;;
54 *)
55 if test $lastwasdasho -eq 1 ; then
56 OPTOPTS="$OPTOPTS $option"
57 lastwasdasho=0
58 else
59 ASOPTS="$ASOPTS $option"
60 fi
61 ;;
62 esac
63done
64${TOOLDIR}/llvm-as $ASOPTS -o - | ${TOOLDIR}/opt $OPTOPTS