]> granicus.if.org Git - clang/commitdiff
Change the set of actions built for external gcc tools.
authorEric Christopher <echristo@gmail.com>
Wed, 6 Jan 2016 07:24:45 +0000 (07:24 +0000)
committerEric Christopher <echristo@gmail.com>
Wed, 6 Jan 2016 07:24:45 +0000 (07:24 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256919 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
lib/Driver/Tools.h
test/Driver/fortran.f95

index 7af1899b3839d6e2e612439ee641001fa3093d59..c61445225767df0fb1008715c0ec2c707899e4b2 100644 (file)
@@ -6179,6 +6179,11 @@ void gcc::Compiler::RenderExtraToolArgs(const JobAction &JA,
   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;
index 314315dea006902268582646e670d26490869e58..168662f7e7feeaa1fd1b940f0e59e1d4c70fa9c2 100644 (file)
@@ -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,
index 9334cbec442a1aaf8ce46dae827acd4f029f5f8f..982f4eb5e6dfa8707d35e21d2d4217a56c839dbe 100644 (file)
@@ -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