]> granicus.if.org Git - clang/commitdiff
Use the integrated assembler when procession .s files on OpenBSD and Linux.
authorRafael Espindola <rafael.espindola@gmail.com>
Sun, 7 Nov 2010 23:13:01 +0000 (23:13 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Sun, 7 Nov 2010 23:13:01 +0000 (23:13 +0000)
Original patch for OpenBSD by Vladimir Kirillov.

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

lib/Driver/ToolChains.cpp

index adbac9029e16208bb4be05f5232714f53885e214..57743e59a55c405e5844f3d75b7fe01415b7d054 100644 (file)
@@ -1044,11 +1044,20 @@ Tool &OpenBSD::SelectTool(const Compilation &C, const JobAction &JA) const {
   else
     Key = JA.getKind();
 
+  bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as,
+                                             options::OPT_no_integrated_as,
+                                             IsIntegratedAssemblerDefault());
+
   Tool *&T = Tools[Key];
   if (!T) {
     switch (Key) {
-    case Action::AssembleJobClass:
-      T = new tools::openbsd::Assemble(*this); break;
+    case Action::AssembleJobClass: {
+      if (UseIntegratedAs)
+        T = new tools::ClangAs(*this);
+      else
+        T = new tools::openbsd::Assemble(*this);
+      break;
+    }
     case Action::LinkJobClass:
       T = new tools::openbsd::Link(*this); break;
     default:
@@ -1398,11 +1407,19 @@ Tool &Linux::SelectTool(const Compilation &C, const JobAction &JA) const {
   else
     Key = JA.getKind();
 
+  bool UseIntegratedAs = C.getArgs().hasFlag(options::OPT_integrated_as,
+                                             options::OPT_no_integrated_as,
+                                             IsIntegratedAssemblerDefault());
+
   Tool *&T = Tools[Key];
   if (!T) {
     switch (Key) {
     case Action::AssembleJobClass:
-      T = new tools::linuxtools::Assemble(*this); break;
+      if (UseIntegratedAs)
+        T = new tools::ClangAs(*this);
+      else
+        T = new tools::linuxtools::Assemble(*this);
+      break;
     case Action::LinkJobClass:
       T = new tools::linuxtools::Link(*this); break;
     default: