r195554 - Don't use the gcc driver for assembling.

Rafael Espindola rafael.espindola at gmail.com
Sat Nov 23 08:40:57 PST 2013


Author: rafael
Date: Sat Nov 23 10:40:57 2013
New Revision: 195554

URL: http://llvm.org/viewvc/llvm-project?rev=195554&view=rev
Log:
Don't use the gcc driver for assembling.

Clang knows how to use the gnu assembler directly from doing so on linux and
hurd. The existing support worked out of the box on cygwin and mingw and I was
able to bootstrap clang with it in both systems (with pending patches for the
new mingw abi, but that is independent of the assembler).

Modified:
    cfe/trunk/lib/Driver/ToolChains.cpp
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/lib/Driver/Tools.h
    cfe/trunk/test/Driver/bindings.c
    cfe/trunk/test/Driver/gcc_forward.c
    cfe/trunk/test/Driver/target.c
    cfe/trunk/test/Driver/unknown-gcc-arch.c

Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=195554&r1=195553&r2=195554&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Sat Nov 23 10:40:57 2013
@@ -1594,7 +1594,7 @@ Tool *Generic_GCC::getTool(Action::Actio
 }
 
 Tool *Generic_GCC::buildAssembler() const {
-  return new tools::gcc::Assemble(*this);
+  return new tools::gnutools::Assemble(*this);
 }
 
 Tool *Generic_GCC::buildLinker() const {

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=195554&r1=195553&r2=195554&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Sat Nov 23 10:40:57 2013
@@ -4285,11 +4285,6 @@ void gcc::Compile::RenderExtraToolArgs(c
   }
 }
 
-void gcc::Assemble::RenderExtraToolArgs(const JobAction &JA,
-                                        ArgStringList &CmdArgs) const {
-  CmdArgs.push_back("-c");
-}
-
 void gcc::Link::RenderExtraToolArgs(const JobAction &JA,
                                     ArgStringList &CmdArgs) const {
   // The types are (hopefully) good enough.

Modified: cfe/trunk/lib/Driver/Tools.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.h?rev=195554&r1=195553&r2=195554&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.h (original)
+++ cfe/trunk/lib/Driver/Tools.h Sat Nov 23 10:40:57 2013
@@ -163,17 +163,6 @@ namespace gcc {
                                      llvm::opt::ArgStringList &CmdArgs) const;
   };
 
-  class LLVM_LIBRARY_VISIBILITY Assemble : public Common  {
-  public:
-    Assemble(const ToolChain &TC) : Common("gcc::Assemble",
-                                           "assembler (via gcc)", TC) {}
-
-    virtual bool hasIntegratedCPP() const { return false; }
-
-    virtual void RenderExtraToolArgs(const JobAction &JA,
-                                     llvm::opt::ArgStringList &CmdArgs) const;
-  };
-
   class LLVM_LIBRARY_VISIBILITY Link : public Common  {
   public:
     Link(const ToolChain &TC) : Common("gcc::Link",

Modified: cfe/trunk/test/Driver/bindings.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/bindings.c?rev=195554&r1=195553&r2=195554&view=diff
==============================================================================
--- cfe/trunk/test/Driver/bindings.c (original)
+++ cfe/trunk/test/Driver/bindings.c Sat Nov 23 10:40:57 2013
@@ -1,7 +1,7 @@
 // Basic binding.
 // RUN: %clang -target i386-unknown-unknown -ccc-print-bindings %s 2>&1 | FileCheck %s --check-prefix=CHECK01
 // CHECK01: "clang", inputs: ["{{.*}}bindings.c"], output: "{{.*}}.s"
-// CHECK01: "gcc::Assemble", inputs: ["{{.*}}.s"], output: "{{.*}}.o"
+// CHECK01: "GNU::Assemble", inputs: ["{{.*}}.s"], output: "{{.*}}.o"
 // CHECK01: "gcc::Link", inputs: ["{{.*}}.o"], output: "a.out"
 
 // Clang control options

Modified: cfe/trunk/test/Driver/gcc_forward.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/gcc_forward.c?rev=195554&r1=195553&r2=195554&view=diff
==============================================================================
--- cfe/trunk/test/Driver/gcc_forward.c (original)
+++ cfe/trunk/test/Driver/gcc_forward.c Sat Nov 23 10:40:57 2013
@@ -13,19 +13,8 @@
 // CHECK: "-Wall" "-Wdocumentation"
 // CHECK: "-o" "{{[^"]+}}.s"
 //
-// gcc-as
-// CHECK: gcc{{[^"]*}}"
-// CHECK-NOT: "-mlinker-version=10"
-// CHECK-NOT: "-Xclang"
-// CHECK-NOT: "foo-bar"
-// CHECK-NOT: "-Wall"
-// CHECK-NOT: "-Wdocumentation"
-// CHECK: -march
-// CHECK-NOT: "-mlinker-version=10"
-// CHECK-NOT: "-Xclang"
-// CHECK-NOT: "foo-bar"
-// CHECK-NOT: "-Wall"
-// CHECK-NOT: "-Wdocumentation"
+// gnu-as
+// CHECK: as{{[^"]*}}"
 // CHECK: "-o" "{{[^"]+}}.o"
 //
 // gcc-ld

Modified: cfe/trunk/test/Driver/target.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/target.c?rev=195554&r1=195553&r2=195554&view=diff
==============================================================================
--- cfe/trunk/test/Driver/target.c (original)
+++ cfe/trunk/test/Driver/target.c Sat Nov 23 10:40:57 2013
@@ -4,12 +4,6 @@
 // Ensure we get a crazy triple here as we asked for one.
 // CHECK: Target: unknown-unknown-unknown
 //
-// Also, ensure we don't blindly hand our target selection logic down to GCC.
-// CHECK: "{{.*gcc(\.[Ee][Xx][Ee])?}}"
-// CHECK-NOT: "-target"
-// CHECK-NOT: "unknown-unknown-unknown"
-// CHECK: "-x" "assembler"
-//
 // Also check that the legacy spelling works.
 // RUN: %clang -no-canonical-prefixes -target unknown-unknown-unknown -c %s \
 // RUN:   -o %t.o -### 2>&1 | FileCheck %s

Modified: cfe/trunk/test/Driver/unknown-gcc-arch.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/unknown-gcc-arch.c?rev=195554&r1=195553&r2=195554&view=diff
==============================================================================
--- cfe/trunk/test/Driver/unknown-gcc-arch.c (original)
+++ cfe/trunk/test/Driver/unknown-gcc-arch.c Sat Nov 23 10:40:57 2013
@@ -1,32 +1,32 @@
 // RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### 2>&1 \
 // RUN:   | FileCheck -check-prefix=X86_64 %s
-// X86_64: {{.*gcc.*-m64}}
+// X86_64: {{.*as.*--64}}
 
 // RUN: %clang -target x86_64-unknown-unknown -c -x assembler %s -### -m32 2>&1 \
 // RUN:   | FileCheck -check-prefix=X86_64-M32 %s
-// X86_64-M32: {{.*gcc.*-m32}}
+// X86_64-M32: {{.*as.*--32}}
 
 // RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### 2>&1 \
 // RUN:   | FileCheck -check-prefix=I386 %s
-// I386: {{.*gcc.*-m32}}
+// I386: {{.*as.*--32}}
 
 // RUN: %clang -target i386-unknown-unknown -c -x assembler %s -### -m64 2>&1 \
 // RUN:   | FileCheck -check-prefix=I386-M64 %s
-// I386-M64: {{.*gcc.*-m64}}
+// I386-M64: {{.*as.*--64}}
 
 
 // RUN: %clang -target powerpc64-unknown-unknown -c -x assembler %s -### 2>&1 \
 // RUN:   | FileCheck -check-prefix=PPC64 %s
-// PPC64: {{.*gcc.*-m64}}
+// PPC64: {{.*as.*-a64}}
 
 // RUN: %clang -target powerpc64-unknown-unknown -c -x assembler %s -### -m32 2>&1 \
 // RUN:   | FileCheck -check-prefix=PPC64-M32 %s
-// PPC64-M32: {{.*gcc.*-m32}}
+// PPC64-M32: {{.*as.*-a32}}
 
 // RUN: %clang -target powerpc-unknown-unknown -c -x assembler %s -### 2>&1 \
 // RUN:   | FileCheck -check-prefix=PPC %s
-// PPC: {{.*gcc.*-m32}}
+// PPC: {{.*as.*-a32}}
 
 // RUN: %clang -target powerpc-unknown-unknown -c -x assembler %s -### -m64 2>&1 \
 // RUN:   | FileCheck -check-prefix=PPC-M64 %s
-// PPC-M64: {{.*gcc.*-m64}}
+// PPC-M64: {{.*as.*-a64}}





More information about the cfe-commits mailing list