Author: Reid Kleckner
Date: 2019-11-18T10:52:41-08:00
New Revision: 1ff5f0ced3163e457c799bd3bd838153806d6320

URL: 
https://github.com/llvm/llvm-project/commit/1ff5f0ced3163e457c799bd3bd838153806d6320
DIFF: 
https://github.com/llvm/llvm-project/commit/1ff5f0ced3163e457c799bd3bd838153806d6320.diff

LOG: Revert "[Remarks][Driver] Use different remark files when targeting 
multiple architectures"

This reverts commit b4e2b112b58154a89171df39dae80044865ff4ff.

Test doesn't appear to pass on Windows, maybe all non-Mac.

Added: 
    

Modified: 
    clang/lib/Driver/ToolChains/Clang.cpp
    clang/test/Driver/opt-record.c

Removed: 
    


################################################################################
diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp 
b/clang/lib/Driver/ToolChains/Clang.cpp
index 2e3624e6cd24..6f25eea243ad 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5218,8 +5218,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction 
&JA,
     if (A) {
       CmdArgs.push_back(A->getValue());
     } else {
-      bool hasMultipleArchs =
-          Args.getAllArgValues(options::OPT_arch).size() > 1;
       SmallString<128> F;
 
       if (Args.hasArg(options::OPT_c) || Args.hasArg(options::OPT_S)) {
@@ -5244,22 +5242,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction 
&JA,
         }
       }
 
-      // If we're having more than one "-arch", we should name the files
-      // 
diff erently so that every cc1 invocation writes to a 
diff erent file.
-      // We're doing that by appending "-<arch>" with "<arch>" being the arch
-      // name from the triple.
-      if (hasMultipleArchs) {
-        // First, remember the extension.
-        SmallString<64> OldExtension = llvm::sys::path::extension(F);
-        // then, remove it.
-        llvm::sys::path::replace_extension(F, "");
-        // attach -<arch> to it.
-        F += "-";
-        F += Triple.getArchName();
-        // put back the extension.
-        llvm::sys::path::replace_extension(F, OldExtension);
-      }
-
       std::string Extension = "opt.";
       if (const Arg *A =
               Args.getLastArg(options::OPT_fsave_optimization_record_EQ))

diff  --git a/clang/test/Driver/opt-record.c b/clang/test/Driver/opt-record.c
index d8d2aa53ed40..062d0acc17da 100644
--- a/clang/test/Driver/opt-record.c
+++ b/clang/test/Driver/opt-record.c
@@ -18,7 +18,6 @@
 // RUN: %clang -### -S -o FOO -fsave-optimization-record 
-fsave-optimization-record=some-format %s 2>&1 | FileCheck %s 
-check-prefix=CHECK-EQ-FORMAT
 // RUN: %clang -### -S -o FOO -fsave-optimization-record=some-format %s 2>&1 | 
FileCheck %s -check-prefix=CHECK-EQ-FORMAT
 // RUN: %clang -### -S -o FOO -fsave-optimization-record=some-format 
-fno-save-optimization-record %s 2>&1 | FileCheck %s 
--check-prefix=CHECK-FOPT-DISABLE-FORMAT
-// RUN: %clang -### -S -o FOO -fsave-optimization-record -arch x86_64 -arch 
x86_64h %s 2>&1 | FileCheck %s --check-prefix=CHECK-MULTIPLE-ARCH
 //
 // CHECK: "-cc1"
 // CHECK: "-opt-record-file" "FOO.opt.yaml"
@@ -42,8 +41,3 @@
 // CHECK-EQ-FORMAT: "-opt-record-format" "some-format"
 
 // CHECK-FOPT-DISABLE-FORMAT-NOT: "-fno-save-optimization-record"
-
-// CHECK-MULTIPLE-ARCH: "-cc1"
-// CHECK-MULTIPLE-ARCH: "-opt-record-file" "FOO-x86_64.opt.yaml"
-// CHECK-MULTIPLE-ARCH: "-cc1"
-// CHECK-MULTIPLE-ARCH: "-opt-record-file" "FOO-x86_64h.opt.yaml"


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to