Reid Spencer | bd70c0b | 2007-02-02 15:50:58 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | ##===- tools/gccas.sh ------------------------------------------*- bash -*-===## |
| 3 | # |
| 4 | # The LLVM Compiler Infrastructure |
| 5 | # |
| 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 | ##===----------------------------------------------------------------------===## |
| 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 | # |
| 21 | TOOLDIR=@TOOLDIR@ |
| 22 | OPTOPTS="-std-compile-opts -f" |
| 23 | ASOPTS="" |
| 24 | lastwasdasho=0 |
| 25 | for option in "$@" ; do |
Reid Spencer | e3770db | 2007-02-02 21:49:27 +0000 | [diff] [blame^] | 26 | option=`echo "$option" | sed 's/^--/-/'` |
Reid Spencer | bd70c0b | 2007-02-02 15:50:58 +0000 | [diff] [blame] | 27 | case "$option" in |
| 28 | -disable-opt) |
| 29 | OPTOPTS="$OPTOPTS $option" |
| 30 | ;; |
| 31 | -disable-inlining) |
| 32 | OPTOPTS="$OPTOPTS $option" |
| 33 | ;; |
| 34 | -verify) |
| 35 | OPTOPTS="$OPTOPTS -verify-each" |
| 36 | ;; |
| 37 | -strip-debug) |
| 38 | OPTOPTS="$OPTOPTS $option" |
| 39 | ;; |
| 40 | -o) |
| 41 | OPTOPTS="$OPTOPTS -o" |
| 42 | lastwasdasho=1 |
| 43 | ;; |
| 44 | -disable-compression) |
| 45 | # ignore |
| 46 | ;; |
| 47 | -traditional-format) |
| 48 | # ignore |
| 49 | ;; |
| 50 | -*) |
Reid Spencer | e3770db | 2007-02-02 21:49:27 +0000 | [diff] [blame^] | 51 | OPTOPTS="$OPTOPTS $option" |
Reid Spencer | bd70c0b | 2007-02-02 15:50:58 +0000 | [diff] [blame] | 52 | ;; |
| 53 | *) |
| 54 | if test $lastwasdasho -eq 1 ; then |
| 55 | OPTOPTS="$OPTOPTS $option" |
| 56 | lastwasdasho=0 |
| 57 | else |
| 58 | ASOPTS="$ASOPTS $option" |
| 59 | fi |
| 60 | ;; |
| 61 | esac |
| 62 | done |
| 63 | ${TOOLDIR}/llvm-as $ASOPTS -o - | ${TOOLDIR}/opt $OPTOPTS |