diff options
| author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-17 14:52:42 +0000 |
|---|---|---|
| committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-01-17 14:52:42 +0000 |
| commit | 0a80cbc68172a9f8664394d6def4c37ac287fd89 (patch) | |
| tree | 450c67c91976dd6284e71bcd8f1ebefe6a30474e /gcc | |
| parent | 42ddf4db7948fbbd6b405e47788063434a552072 (diff) | |
| download | ppe42-gcc-0a80cbc68172a9f8664394d6def4c37ac287fd89.tar.gz ppe42-gcc-0a80cbc68172a9f8664394d6def4c37ac287fd89.zip | |
* gospec.c (lang_specific_driver): If we see -S without -o, add -o
BASE.s rather than -o BASE.o.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183248 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/go/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/go/gospec.c | 20 |
2 files changed, 20 insertions, 5 deletions
diff --git a/gcc/go/ChangeLog b/gcc/go/ChangeLog index a0962b71cbc..662b50ed486 100644 --- a/gcc/go/ChangeLog +++ b/gcc/go/ChangeLog @@ -1,3 +1,8 @@ +2012-01-17 Ian Lance Taylor <iant@google.com> + + * gospec.c (lang_specific_driver): If we see -S without -o, add -o + BASE.s rather than -o BASE.o. + 2012-01-11 Ian Lance Taylor <iant@google.com> * go-lang.c (go_langhook_init): Initialize void_list_node before diff --git a/gcc/go/gospec.c b/gcc/go/gospec.c index 55a3bcd5bb7..8e8aa2dd2de 100644 --- a/gcc/go/gospec.c +++ b/gcc/go/gospec.c @@ -1,5 +1,5 @@ /* gospec.c -- Specific flags and argument handling of the gcc Go front end. - Copyright (C) 2009, 2010, 2011 Free Software Foundation, Inc. + Copyright (C) 2009, 2010, 2011, 2012 Free Software Foundation, Inc. This file is part of GCC. @@ -109,6 +109,9 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, /* Whether the -o option was used. */ bool saw_opt_o = false; + /* Whether the -S option was used. */ + bool saw_opt_S = false; + /* The first input file with an extension of .go. */ const char *first_go_file = NULL; @@ -163,7 +166,6 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, break; case OPT_c: - case OPT_S: case OPT_E: case OPT_M: case OPT_MM: @@ -173,6 +175,11 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, library = -1; break; + case OPT_S: + saw_opt_S = true; + library = -1; + break; + case OPT_o: saw_opt_o = true; break; @@ -280,10 +287,13 @@ lang_specific_driver (struct cl_decoded_option **in_decoded_options, alen = baselen + 3; out = XNEWVEC (char, alen); memcpy (out, base, baselen); - /* The driver will convert .o to some other suffix if - appropriate. */ + /* The driver will convert .o to some other suffix (e.g., .obj) + if appropriate. */ out[baselen] = '.'; - out[baselen + 1] = 'o'; + if (saw_opt_S) + out[baselen + 1] = 's'; + else + out[baselen + 1] = 'o'; out[baselen + 2] = '\0'; generate_option (OPT_o, out, 1, CL_DRIVER, &new_decoded_options[j]); |

