]> granicus.if.org Git - clang/commitdiff
Stop disabling integrated assembler with -static. <rdar://problem/10175391>
authorBob Wilson <bob.wilson@apple.com>
Sun, 30 Oct 2011 00:20:28 +0000 (00:20 +0000)
committerBob Wilson <bob.wilson@apple.com>
Sun, 30 Oct 2011 00:20:28 +0000 (00:20 +0000)
The integrated assembler seems to be working pretty well for -static code
now, so remove the hacks to disable it.

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

lib/Driver/Driver.cpp
lib/Driver/ToolChains.cpp
lib/Driver/Tools.cpp
test/Driver/cfi.c
test/Driver/darwin-as.c

index 75300b5307e0e8e09b1ff37ef0ee6e86d2ac7d30..a4aa2ed02509ed214f9c42840e65baad7d7a7701 100644 (file)
@@ -1225,17 +1225,9 @@ static const Tool &SelectToolForJob(Compilation &C, const ToolChain *TC,
   // bottom up, so what we are actually looking for is an assembler job with a
   // compiler input.
 
-  // FIXME: This doesn't belong here, but ideally we will support static soon
-  // anyway.
-  bool HasStatic = (C.getArgs().hasArg(options::OPT_mkernel) ||
-                    C.getArgs().hasArg(options::OPT_static) ||
-                    C.getArgs().hasArg(options::OPT_fapple_kext));
-  bool IsDarwin = TC->getTriple().isOSDarwin();
-  bool IsIADefault = TC->IsIntegratedAssemblerDefault() &&
-    !(HasStatic && IsDarwin);
   if (C.getArgs().hasFlag(options::OPT_integrated_as,
-                         options::OPT_no_integrated_as,
-                         IsIADefault) &&
+                          options::OPT_no_integrated_as,
+                          TC->IsIntegratedAssemblerDefault()) &&
       !C.getArgs().hasArg(options::OPT_save_temps) &&
       isa<AssembleJobAction>(JA) &&
       Inputs->size() == 1 && isa<CompileJobAction>(*Inputs->begin())) {
index dd92266ec67ebbc9a144dbe415f3bd3690ab8b74..d88017ff78bbb677399e0233b8ff6ff3babd752a 100644 (file)
@@ -210,15 +210,9 @@ Tool &Darwin::SelectTool(const Compilation &C, const JobAction &JA,
   } else
     Key = JA.getKind();
 
-  // FIXME: This doesn't belong here, but ideally we will support static soon
-  // anyway.
-  bool HasStatic = (C.getArgs().hasArg(options::OPT_mkernel) ||
-                    C.getArgs().hasArg(options::OPT_static) ||
-                    C.getArgs().hasArg(options::OPT_fapple_kext));
-  bool IsIADefault = IsIntegratedAssemblerDefault() && !HasStatic;
   bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as,
                                              options::OPT_no_integrated_as,
-                                             IsIADefault);
+                                             IsIntegratedAssemblerDefault());
 
   Tool *&T = Tools[Key];
   if (!T) {
index 75fb710dcb17a3431f5e542ce8f519744fb1837f..4db6d007fcf5681470500725caa151d8d4efbacc 100644 (file)
@@ -1036,17 +1036,9 @@ static bool ShouldDisableCFI(const ArgList &Args,
   if (TC.getTriple().isOSDarwin()) {
     // The native darwin assembler doesn't support cfi directives, so
     // we disable them if we think the .s file will be passed to it.
-
-    // FIXME: Duplicated code with ToolChains.cpp
-    // FIXME: This doesn't belong here, but ideally we will support static soon
-    // anyway.
-    bool HasStatic = (Args.hasArg(options::OPT_mkernel) ||
-                      Args.hasArg(options::OPT_static) ||
-                      Args.hasArg(options::OPT_fapple_kext));
-    bool IsIADefault = TC.IsIntegratedAssemblerDefault() && !HasStatic;
     bool UseIntegratedAs = Args.hasFlag(options::OPT_integrated_as,
                                         options::OPT_no_integrated_as,
-                                        IsIADefault);
+                                        TC.IsIntegratedAssemblerDefault());
     bool UseCFI = Args.hasFlag(options::OPT_fdwarf2_cfi_asm,
                                options::OPT_fno_dwarf2_cfi_asm,
                                UseIntegratedAs);
index b5c0c03e7a49c636363fd2a06d1b27c9e2c43bf9..36924b4e385dfe4f304a81ef9dfcd0a05af0d915 100644 (file)
@@ -1,4 +1,5 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin10  -static -### %s 2>&1 | \
+// RUN: %clang -ccc-host-triple i386-apple-darwin10 \
+// RUN:    -no-integrated-as -### %s 2>&1 | \
 // RUN:  FileCheck --check-prefix=CHECK-DARWIN %s
 
 // RUN: %clang -ccc-host-triple i386-pc-linux-gnu  -static -### %s 2>&1 | \
index 7d4cdbfcd379ac1c7229bb8d41c08c8369e9b4bb..655319a13e05eb6a8725de7d18af7f28556b73f1 100644 (file)
@@ -1,9 +1,11 @@
-// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -x assembler -c %s -static -dynamic 2>%t
+// RUN: %clang -ccc-host-triple i386-apple-darwin10 -### -x assembler -c %s \
+// RUN:   -no-integrated-as -static -dynamic 2>%t
 // RUN: FileCheck -check-prefix=STATIC_AND_DYNAMIC-32 --input-file %t %s
 //
 // CHECK-STATIC_AND_DYNAMIC-32: as{{(.exe)?}}" "-arch" "i386" "-force_cpusubtype_ALL" "-static" "-o"
 
-// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -x assembler -c %s -static 2>%t
+// RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -x assembler -c %s \
+// RUN:   -no-integrated-as -static 2>%t
 // RUN: FileCheck -check-prefix=STATIC-64 --input-file %t %s
 //
 // CHECK-STATIC-64: as{{(.exe)?}}" "-arch" "x86_64" "-force_cpusubtype_ALL" "-o"
@@ -13,4 +15,3 @@
 // RUN: FileCheck -check-prefix=ARMV6 --input-file %t %s
 //
 // CHECK-ARMV6: as{{(.exe)?}}" "-arch" "armv6" "-o"
-