r256919 - Change the set of actions built for external gcc tools.

Eric Christopher via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 5 23:24:45 PST 2016


Author: echristo
Date: Wed Jan  6 01:24:45 2016
New Revision: 256919

URL: http://llvm.org/viewvc/llvm-project?rev=256919&view=rev
Log:
Change the set of actions built for external gcc tools.

A gcc tool has an "integrated" assembler (usually gas) that it
will call to produce an object. Let it use that assembler so
that we don't have to deal with assembly syntax incompatibilities.

Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/lib/Driver/Tools.h
    cfe/trunk/test/Driver/fortran.f95

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=256919&r1=256918&r2=256919&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jan  6 01:24:45 2016
@@ -6179,6 +6179,11 @@ void gcc::Compiler::RenderExtraToolArgs(
   case types::TY_LTO_BC:
     CmdArgs.push_back("-c");
     break;
+  // We assume we've got an "integrated" assembler in that gcc will produce an
+  // object file itself.
+  case types::TY_Object:
+    CmdArgs.push_back("-c");
+    break;
   case types::TY_PP_Asm:
     CmdArgs.push_back("-S");
     break;

Modified: cfe/trunk/lib/Driver/Tools.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=256919&r1=256918&r2=256919&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.h (original)
+++ cfe/trunk/lib/Driver/Tools.h Wed Jan  6 01:24:45 2016
@@ -149,6 +149,10 @@ public:
   Common(const char *Name, const char *ShortName, const ToolChain &TC)
       : GnuTool(Name, ShortName, TC) {}
 
+  // A gcc tool has an "integrated" assembler that it will call to produce an
+  // object. Let it use that assembler so that we don't have to deal with
+  // assembly syntax incompatibilities.
+  bool hasIntegratedAssembler() const override { return true; }
   void ConstructJob(Compilation &C, const JobAction &JA,
                     const InputInfo &Output, const InputInfoList &Inputs,
                     const llvm::opt::ArgList &TCArgs,

Modified: cfe/trunk/test/Driver/fortran.f95
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/fortran.f95?rev=256919&r1=256918&r2=256919&view=diff
==============================================================================
--- cfe/trunk/test/Driver/fortran.f95 (original)
+++ cfe/trunk/test/Driver/fortran.f95 Wed Jan  6 01:24:45 2016
@@ -1,9 +1,15 @@
 // Check that the clang driver can invoke gcc to compile Fortran.
 
 // RUN: %clang -target x86_64-unknown-linux-gnu -integrated-as -c %s -### 2>&1 \
-// RUN:   | FileCheck %s
-// CHECK: gcc
-// CHECK: "-S"
-// CHECK: "-x" "f95"
-// CHECK: clang
-// CHECK: "-cc1as"
+// RUN:   | FileCheck --check-prefix=CHECK-OBJECT %s
+// CHECK-OBJECT: gcc
+// CHECK-OBJECT: "-c"
+// CHECK-OBJECT: "-x" "f95"
+// CHECK-OBJECT-NOT: cc1as
+
+// RUN: %clang -target x86_64-unknown-linux-gnu -integrated-as -S %s -### 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-ASM %s
+// CHECK-ASM: gcc
+// CHECK-ASM: "-S"
+// CHECK-ASM: "-x" "f95"
+// CHECK-ASM-NOT: cc1




More information about the cfe-commits mailing list