[clang] 7f59dba - [Driver] Remove no-op -frewrite-map-file=

Fangrui Song via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 24 23:19:04 PDT 2023


Author: Fangrui Song
Date: 2023-04-24T23:18:59-07:00
New Revision: 7f59dba564cac9868111e7b5631bd54f9c959fca

URL: https://github.com/llvm/llvm-project/commit/7f59dba564cac9868111e7b5631bd54f9c959fca
DIFF: https://github.com/llvm/llvm-project/commit/7f59dba564cac9868111e7b5631bd54f9c959fca.diff

LOG: [Driver] Remove no-op -frewrite-map-file=

This option has been a no-op since D99707.

Added: 
    

Modified: 
    clang/include/clang/Basic/CodeGenOptions.h
    clang/include/clang/Driver/Options.td
    clang/lib/Driver/Driver.cpp
    clang/lib/Driver/ToolChains/Clang.cpp

Removed: 
    clang/test/Driver/Inputs/rewrite-1.map
    clang/test/Driver/Inputs/rewrite-2.map
    clang/test/Driver/Inputs/rewrite.map
    clang/test/Driver/rewrite-map-files.c
    clang/test/Driver/rewrite-map-in-diagnostics.c
    clang/test/Driver/symbol-rewriter.c


################################################################################
diff  --git a/clang/include/clang/Basic/CodeGenOptions.h b/clang/include/clang/Basic/CodeGenOptions.h
index e1817b990cdf9..6192d3fafd411 100644
--- a/clang/include/clang/Basic/CodeGenOptions.h
+++ b/clang/include/clang/Basic/CodeGenOptions.h
@@ -368,9 +368,6 @@ class CodeGenOptions : public CodeGenOptionsBase {
   /// transformation.
   OptRemark OptimizationRemarkAnalysis;
 
-  /// Set of files defining the rules for the symbol rewriting.
-  std::vector<std::string> RewriteMapFiles;
-
   /// Set of sanitizer checks that are non-fatal (i.e. execution should be
   /// continued when possible).
   SanitizerSet SanitizeRecover;

diff  --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index bbdde9ada222a..eb48c142e84dd 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -2036,11 +2036,6 @@ defm delete_null_pointer_checks : BoolFOption<"delete-null-pointer-checks",
   PosFlag<SetFalse, [], "Treat usage of null pointers as undefined behavior (default)">,
   BothFlags<[CoreOption]>>;
 
-def frewrite_map_file_EQ : Joined<["-"], "frewrite-map-file=">,
-                           Group<f_Group>,
-                           Flags<[NoXarchOption, CC1Option]>,
-                           MarshallingInfoStringVector<CodeGenOpts<"RewriteMapFiles">>;
-
 defm use_line_directives : BoolFOption<"use-line-directives",
   PreprocessorOutputOpts<"UseLineDirectives">, DefaultFalse,
   PosFlag<SetTrue, [CC1Option], "Use #line in preprocessed output">, NegFlag<SetFalse>>;

diff  --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 2e924960eda37..4c8a83e6ff28a 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -1809,9 +1809,6 @@ void Driver::generateCompilationDiagnostics(
     }
   }
 
-  for (const auto &A : C.getArgs().filtered(options::OPT_frewrite_map_file_EQ))
-    Diag(clang::diag::note_drv_command_failed_diag_msg) << A->getValue();
-
   Diag(clang::diag::note_drv_command_failed_diag_msg)
       << "\n\n********************";
 }

diff  --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index e3633c0e60cea..e99fb32289220 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -5207,16 +5207,6 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
 
   // LLVM Code Generator Options.
 
-  for (const Arg *A : Args.filtered(options::OPT_frewrite_map_file_EQ)) {
-    StringRef Map = A->getValue();
-    if (!llvm::sys::fs::exists(Map)) {
-      D.Diag(diag::err_drv_no_such_file) << Map;
-    } else {
-      A->render(Args, CmdArgs);
-      A->claim();
-    }
-  }
-
   if (Arg *A = Args.getLastArg(options::OPT_mabi_EQ_quadword_atomics)) {
     if (!Triple.isOSAIX() || Triple.isPPC32())
       D.Diag(diag::err_drv_unsupported_opt_for_target)

diff  --git a/clang/test/Driver/Inputs/rewrite-1.map b/clang/test/Driver/Inputs/rewrite-1.map
deleted file mode 100644
index e69de29bb2d1d..0000000000000

diff  --git a/clang/test/Driver/Inputs/rewrite-2.map b/clang/test/Driver/Inputs/rewrite-2.map
deleted file mode 100644
index e69de29bb2d1d..0000000000000

diff  --git a/clang/test/Driver/Inputs/rewrite.map b/clang/test/Driver/Inputs/rewrite.map
deleted file mode 100644
index e69de29bb2d1d..0000000000000

diff  --git a/clang/test/Driver/rewrite-map-files.c b/clang/test/Driver/rewrite-map-files.c
deleted file mode 100644
index f079347c59438..0000000000000
--- a/clang/test/Driver/rewrite-map-files.c
+++ /dev/null
@@ -1,2 +0,0 @@
-// RUN: %clang -### -frewrite-map-file=%t.map -c %s -o /dev/null 2>&1 | FileCheck %s
-// CHECK: error: no such file or directory:

diff  --git a/clang/test/Driver/rewrite-map-in-diagnostics.c b/clang/test/Driver/rewrite-map-in-diagnostics.c
deleted file mode 100644
index 5ca8b897e199a..0000000000000
--- a/clang/test/Driver/rewrite-map-in-diagnostics.c
+++ /dev/null
@@ -1,12 +0,0 @@
-// RUN: export LSAN_OPTIONS=detect_leaks=0
-// RUN: rm -rf "%t"
-// RUN: mkdir -p "%t"
-// RUN: env TMPDIR="%t" TEMP="%t" TMP="%t" RC_DEBUG_OPTION=1 \
-// RUN:     not %clang -fsyntax-only -frewrite-map-file=%p/Inputs/rewrite.map %s 2>&1 \
-// RUN:   | FileCheck %s
-
-#pragma clang __debug parser_crash
-
-// CHECK: note: diagnostic msg: {{.*}}rewrite.map
-
-// REQUIRES: crash-recovery

diff  --git a/clang/test/Driver/symbol-rewriter.c b/clang/test/Driver/symbol-rewriter.c
deleted file mode 100644
index 2bee07b4b0281..0000000000000
--- a/clang/test/Driver/symbol-rewriter.c
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: %clang -frewrite-map-file=%S/Inputs/rewrite.map -### %s 2>&1 | FileCheck %s -check-prefix CHECK-SINGLE
-
-// CHECK-SINGLE: "-frewrite-map-file={{.*[\\/]}}rewrite.map"
-
-// RUN: %clang -frewrite-map-file=%S/Inputs/rewrite-1.map -frewrite-map-file=%S/Inputs/rewrite-2.map -### %s 2>&1 | FileCheck %s -check-prefix CHECK-MULTIPLE
-
-// CHECK-MULTIPLE: "-frewrite-map-file={{.*[\\/]}}rewrite-1.map" "-frewrite-map-file={{.*[\\/]}}rewrite-2.map"


        


More information about the cfe-commits mailing list