[llvm-branch-commits] [cfe-branch] r206064 - Merging r198940:

Tom Stellard thomas.stellard at amd.com
Fri Apr 11 13:23:39 PDT 2014


Author: tstellar
Date: Fri Apr 11 15:23:39 2014
New Revision: 206064

URL: http://llvm.org/viewvc/llvm-project?rev=206064&view=rev
Log:
Merging r198940:

------------------------------------------------------------------------
r198940 | kristof.beyls | 2014-01-10 08:44:34 -0500 (Fri, 10 Jan 2014) | 2 lines

Enable -fuse-init-array for all AArch64 ELF targets by default, not just linux.

------------------------------------------------------------------------

Modified:
    cfe/branches/release_34/lib/Driver/Driver.cpp
    cfe/branches/release_34/lib/Driver/ToolChains.cpp
    cfe/branches/release_34/lib/Driver/ToolChains.h
    cfe/branches/release_34/test/Driver/constructors.c

Modified: cfe/branches/release_34/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/Driver/Driver.cpp?rev=206064&r1=206063&r2=206064&view=diff
==============================================================================
--- cfe/branches/release_34/lib/Driver/Driver.cpp (original)
+++ cfe/branches/release_34/lib/Driver/Driver.cpp Fri Apr 11 15:23:39 2014
@@ -1981,6 +1981,10 @@ const ToolChain &Driver::getToolChain(co
         TC = new toolchains::XCore(*this, Target, Args);
         break;
       }
+      if (Target.isOSBinFormatELF()) {
+        TC = new toolchains::Generic_ELF(*this, Target, Args);
+        break;
+      }
       TC = new toolchains::Generic_GCC(*this, Target, Args);
       break;
     }

Modified: cfe/branches/release_34/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/Driver/ToolChains.cpp?rev=206064&r1=206063&r2=206064&view=diff
==============================================================================
--- cfe/branches/release_34/lib/Driver/ToolChains.cpp (original)
+++ cfe/branches/release_34/lib/Driver/ToolChains.cpp Fri Apr 11 15:23:39 2014
@@ -1622,6 +1622,21 @@ bool Generic_GCC::isPICDefaultForced() c
   return false;
 }
 
+void Generic_ELF::addClangTargetOptions(const ArgList &DriverArgs,
+                                        ArgStringList &CC1Args) const {
+  const Generic_GCC::GCCVersion &V = GCCInstallation.getVersion();
+  bool UseInitArrayDefault = 
+      getTriple().getArch() == llvm::Triple::aarch64 ||
+      (getTriple().getOS() == llvm::Triple::Linux && (
+         !V.isOlderThan(4, 7, 0) ||
+         getTriple().getEnvironment() == llvm::Triple::Android));
+
+  if (DriverArgs.hasFlag(options::OPT_fuse_init_array,
+                         options::OPT_fno_use_init_array,
+                         UseInitArrayDefault))
+    CC1Args.push_back("-fuse-init-array");
+}
+
 /// Hexagon Toolchain
 
 std::string Hexagon_TC::GetGnuDir(const std::string &InstalledDir) {
@@ -2536,19 +2551,6 @@ Tool *Linux::buildAssembler() const {
   return new tools::gnutools::Assemble(*this);
 }
 
-void Linux::addClangTargetOptions(const ArgList &DriverArgs,
-                                  ArgStringList &CC1Args) const {
-  const Generic_GCC::GCCVersion &V = GCCInstallation.getVersion();
-  bool UseInitArrayDefault =
-      !V.isOlderThan(4, 7, 0) ||
-      getTriple().getArch() == llvm::Triple::aarch64 ||
-      getTriple().getEnvironment() == llvm::Triple::Android;
-  if (DriverArgs.hasFlag(options::OPT_fuse_init_array,
-                         options::OPT_fno_use_init_array,
-                         UseInitArrayDefault))
-    CC1Args.push_back("-fuse-init-array");
-}
-
 std::string Linux::computeSysRoot() const {
   if (!getDriver().SysRoot.empty())
     return getDriver().SysRoot;

Modified: cfe/branches/release_34/lib/Driver/ToolChains.h
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/lib/Driver/ToolChains.h?rev=206064&r1=206063&r2=206064&view=diff
==============================================================================
--- cfe/branches/release_34/lib/Driver/ToolChains.h (original)
+++ cfe/branches/release_34/lib/Driver/ToolChains.h Fri Apr 11 15:23:39 2014
@@ -427,12 +427,8 @@ public:
               const llvm::opt::ArgList &Args)
       : Generic_GCC(D, Triple, Args) {}
 
-  virtual bool IsIntegratedAssemblerDefault() const {
-    // Default integrated assembler to on for x86.
-    return (getTriple().getArch() == llvm::Triple::aarch64 ||
-            getTriple().getArch() == llvm::Triple::x86 ||
-            getTriple().getArch() == llvm::Triple::x86_64);
-  }
+  virtual void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
+                                     llvm::opt::ArgStringList &CC1Args) const;
 };
 
 class LLVM_LIBRARY_VISIBILITY AuroraUX : public Generic_GCC {
@@ -579,8 +575,6 @@ public:
   virtual void
   AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
                             llvm::opt::ArgStringList &CC1Args) const;
-  virtual void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
-                                     llvm::opt::ArgStringList &CC1Args) const;
   virtual void
   AddClangCXXStdlibIncludeArgs(const llvm::opt::ArgList &DriverArgs,
                                llvm::opt::ArgStringList &CC1Args) const;

Modified: cfe/branches/release_34/test/Driver/constructors.c
URL: http://llvm.org/viewvc/llvm-project/cfe/branches/release_34/test/Driver/constructors.c?rev=206064&r1=206063&r2=206064&view=diff
==============================================================================
--- cfe/branches/release_34/test/Driver/constructors.c (original)
+++ cfe/branches/release_34/test/Driver/constructors.c Fri Apr 11 15:23:39 2014
@@ -46,3 +46,12 @@
 // RUN:     -target i386-unknown-linux-android \
 // RUN:     --sysroot=%S/Inputs/basic_android_tree/sysroot \
 // RUN:   | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
+//
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1       \
+// RUN:     -target aarch64-none-linux-gnu \
+// RUN:     --sysroot=%S/Inputs/basic_linux_tree \
+// RUN:   | FileCheck --check-prefix=CHECK-INIT-ARRAY %s
+//
+// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1       \
+// RUN:     -target aarch64-none-none-eabi \
+// RUN:   | FileCheck --check-prefix=CHECK-INIT-ARRAY %s





More information about the llvm-branch-commits mailing list