]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc.c (struct infile): Update comment for language.
authorEric Christopher <echristo@redhat.com>
Tue, 12 Jul 2005 18:10:32 +0000 (18:10 +0000)
committerEric Christopher <echristo@gcc.gnu.org>
Tue, 12 Jul 2005 18:10:32 +0000 (18:10 +0000)
2005-07-12  Eric Christopher  <echristo@redhat.com>

* gcc.c (struct infile): Update comment for language.
(main): Rewrite input file resetting code.

From-SVN: r101934

gcc/ChangeLog
gcc/gcc.c

index 7064c97019e5c48052d1db9f77c1914aee0a5913..731f4af1a90c3bd99e37677bebdd56ffef689506 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-12  Eric Christopher  <echristo@redhat.com>
+
+       * gcc.c (struct infile): Update comment for language.
+       (main): Rewrite input file resetting code.
+
 2005-07-12  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR tree-opt/22335
index c137ad4f9ce33ccb3d718a90043ddfcf76d7f696..e3b8b496c4606e6f6d976a909b985a1c9c8afff1 100644 (file)
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -2936,6 +2936,13 @@ static struct switchstr *switches;
 
 static int n_switches;
 
+/* Language is one of three things:
+
+   1) The name of a real programming language.
+   2) NULL, indicating that no one has figured out
+   what it is yet.
+   3) '*', indicating that the file should be passed
+   to the linker.  */
 struct infile
 {
   const char *name;
@@ -6553,11 +6560,21 @@ main (int argc, const char **argv)
       clear_failure_queue ();
     }
 
-  /* Reset the output file name to the first input file name, for use
-     with %b in LINK_SPEC on a target that prefers not to emit a.out
-     by default.  */
+  /* Reset the input file name to the first compile/object file name, for use
+     with %b in LINK_SPEC. We use the first input file that we can find
+     a compiler to compile it instead of using infiles.language since for 
+     languages other than C we use aliases that we then lookup later.  */
   if (n_infiles > 0)
-    set_input (infiles[0].name);
+    {
+      int i;
+
+      for (i = 0; i < n_infiles ; i++)
+       if (infiles[i].language && infiles[i].language != '*')
+         {
+           set_input (infiles[i].name);
+           break;
+         }
+    }
 
   if (error_count == 0)
     {