[clang] [clang-tools-extra] Remove clang-rename (PR #108988)

via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 17 08:19:09 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Aaron Ballman (AaronBallman)

<details>
<summary>Changes</summary>

clang-rename has largely been superseded by clangd and this project
hasn't received much attention in many years. Further, our
documentation on it still claims it's in very early stages of
development despite being ~10 years old. One of the primary people
driving the tool has mentioned that they don't believe there is a
reason to continue to support it unless it's still being actively
used (https://reviews.llvm.org/D148439#<!-- -->4303202) and I've found no
evidence to suggest that is the case.

Original RFC: https://discourse.llvm.org/t/rfc-time-to-deprecate-remove-clang-rename/70707

---

Patch is 128.89 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/108988.diff


59 Files Affected:

- (modified) clang-tools-extra/CODE_OWNERS.TXT (+1-1) 
- (modified) clang-tools-extra/docs/ReleaseNotes.rst (-3) 
- (removed) clang-tools-extra/docs/clang-rename.rst (-168) 
- (modified) clang-tools-extra/docs/index.rst (-1) 
- (modified) clang-tools-extra/test/CMakeLists.txt (-3) 
- (removed) clang-tools-extra/test/clang-apply-replacements/ClangRenameClassReplacements.cpp (-11) 
- (modified) clang/docs/ClangFormattedStatus.rst (-5) 
- (modified) clang/docs/tools/clang-formatted-files.txt (-1) 
- (modified) clang/test/CMakeLists.txt (-1) 
- (removed) clang/test/clang-rename/ClassAsTemplateArgument.cpp (-21) 
- (removed) clang/test/clang-rename/ClassFindByName.cpp (-10) 
- (removed) clang/test/clang-rename/ClassSimpleRenaming.cpp (-14) 
- (removed) clang/test/clang-rename/ClassTestMulti.cpp (-11) 
- (removed) clang/test/clang-rename/ClassTestMultiByName.cpp (-8) 
- (removed) clang/test/clang-rename/ComplexFunctionOverride.cpp (-47) 
- (removed) clang/test/clang-rename/ComplicatedClassType.cpp (-63) 
- (removed) clang/test/clang-rename/Ctor.cpp (-14) 
- (removed) clang/test/clang-rename/CtorInitializer.cpp (-17) 
- (removed) clang/test/clang-rename/DeclRefExpr.cpp (-24) 
- (removed) clang/test/clang-rename/ForceMulti.cpp (-8) 
- (removed) clang/test/clang-rename/ForwardClassDecl.cpp (-4) 
- (removed) clang/test/clang-rename/FunctionMacro.cpp (-20) 
- (removed) clang/test/clang-rename/FunctionOverride.cpp (-13) 
- (removed) clang/test/clang-rename/FunctionTemplate.cpp (-19) 
- (removed) clang/test/clang-rename/FunctionWithClassFindByName.cpp (-12) 
- (removed) clang/test/clang-rename/IncludeHeaderWithSymbol.cpp (-10) 
- (removed) clang/test/clang-rename/Inputs/HeaderWithSymbol.h (-1) 
- (removed) clang/test/clang-rename/Inputs/OffsetToNewName.yaml (-6) 
- (removed) clang/test/clang-rename/Inputs/QualifiedNameToNewName.yaml (-6) 
- (removed) clang/test/clang-rename/InvalidNewName.cpp (-2) 
- (removed) clang/test/clang-rename/InvalidOffset.cpp (-9) 
- (removed) clang/test/clang-rename/InvalidQualifiedName.cpp (-4) 
- (removed) clang/test/clang-rename/MemberExprMacro.cpp (-22) 
- (removed) clang/test/clang-rename/Namespace.cpp (-13) 
- (removed) clang/test/clang-rename/NoNewName.cpp (-4) 
- (removed) clang/test/clang-rename/NonExistFile.cpp (-2) 
- (removed) clang/test/clang-rename/TemplateClassInstantiation.cpp (-42) 
- (removed) clang/test/clang-rename/TemplateCtor.cpp (-10) 
- (removed) clang/test/clang-rename/TemplateTypename.cpp (-24) 
- (removed) clang/test/clang-rename/TemplatedClassFunction.cpp (-27) 
- (removed) clang/test/clang-rename/Typedef.cpp (-8) 
- (removed) clang/test/clang-rename/UserDefinedConversion.cpp (-26) 
- (removed) clang/test/clang-rename/Variable.cpp (-33) 
- (removed) clang/test/clang-rename/VariableMacro.cpp (-21) 
- (removed) clang/test/clang-rename/VariableTemplate.cpp (-32) 
- (removed) clang/test/clang-rename/YAMLInput.cpp (-10) 
- (modified) clang/tools/CMakeLists.txt (-1) 
- (removed) clang/tools/clang-rename/CMakeLists.txt (-26) 
- (removed) clang/tools/clang-rename/ClangRename.cpp (-242) 
- (removed) clang/tools/clang-rename/clang-rename.el (-80) 
- (removed) clang/tools/clang-rename/clang-rename.py (-70) 
- (modified) clang/unittests/CMakeLists.txt (-1) 
- (removed) clang/unittests/Rename/CMakeLists.txt (-29) 
- (removed) clang/unittests/Rename/ClangRenameTest.h (-116) 
- (removed) clang/unittests/Rename/RenameAliasTest.cpp (-303) 
- (removed) clang/unittests/Rename/RenameClassTest.cpp (-820) 
- (removed) clang/unittests/Rename/RenameEnumTest.cpp (-189) 
- (removed) clang/unittests/Rename/RenameFunctionTest.cpp (-573) 
- (removed) clang/unittests/Rename/RenameMemberTest.cpp (-228) 


``````````diff
diff --git a/clang-tools-extra/CODE_OWNERS.TXT b/clang-tools-extra/CODE_OWNERS.TXT
index 4cf80aa2b0b826..2831ec7e25f59f 100644
--- a/clang-tools-extra/CODE_OWNERS.TXT
+++ b/clang-tools-extra/CODE_OWNERS.TXT
@@ -23,7 +23,7 @@ D: clang-tidy
 
 N: Manuel Klimek
 E: klimek at google.com
-D: clang-rename, all parts of clang-tools-extra not covered by someone else
+D: all parts of clang-tools-extra not covered by someone else
 
 N: Sam McCall
 E: sammccall at google.com
diff --git a/clang-tools-extra/docs/ReleaseNotes.rst b/clang-tools-extra/docs/ReleaseNotes.rst
index b5b164833e1575..8a540b9606df4a 100644
--- a/clang-tools-extra/docs/ReleaseNotes.rst
+++ b/clang-tools-extra/docs/ReleaseNotes.rst
@@ -87,9 +87,6 @@ Improvements to clang-doc
 Improvements to clang-query
 ---------------------------
 
-Improvements to clang-rename
-----------------------------
-
 The improvements are...
 
 Improvements to clang-tidy
diff --git a/clang-tools-extra/docs/clang-rename.rst b/clang-tools-extra/docs/clang-rename.rst
deleted file mode 100644
index e13d8c3ad25f98..00000000000000
--- a/clang-tools-extra/docs/clang-rename.rst
+++ /dev/null
@@ -1,168 +0,0 @@
-============
-Clang-Rename
-============
-
-.. contents::
-
-See also:
-
-.. toctree::
-   :maxdepth: 1
-
-
-:program:`clang-rename` is a C++ refactoring tool. Its purpose is to perform
-efficient renaming actions in large-scale projects such as renaming classes,
-functions, variables, arguments, namespaces etc.
-
-The tool is in a very early development stage, so you might encounter bugs and
-crashes. Submitting reports with information about how to reproduce the issue
-to `the LLVM bugtracker <https://bugs.llvm.org>`_ will definitely help the
-project. If you have any ideas or suggestions, you might want to put a feature
-request there.
-
-Using Clang-Rename
-==================
-
-:program:`clang-rename` is a `LibTooling
-<https://clang.llvm.org/docs/LibTooling.html>`_-based tool, and it's easier to
-work with if you set up a compile command database for your project (for an
-example of how to do this see `How To Setup Tooling For LLVM
-<https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html>`_). You can also
-specify compilation options on the command line after `--`:
-
-.. code-block:: console
-
-  $ clang-rename -offset=42 -new-name=foo test.cpp -- -Imy_project/include -DMY_DEFINES ...
-
-
-To get an offset of a symbol in a file run
-
-.. code-block:: console
-
-  $ grep -FUbo 'foo' file.cpp
-
-
-The tool currently supports renaming actions inside a single translation unit
-only. It is planned to extend the tool's functionality to support multi-TU
-renaming actions in the future.
-
-:program:`clang-rename` also aims to be easily integrated into popular text
-editors, such as Vim and Emacs, and improve the workflow of users.
-
-Although a command line interface exists, it is highly recommended to use the
-text editor interface instead for better experience.
-
-You can also identify one or more symbols to be renamed by giving the fully
-qualified name:
-
-.. code-block:: console
-
-  $ clang-rename -qualified-name=foo -new-name=bar test.cpp
-
-Renaming multiple symbols at once is supported, too. However,
-:program:`clang-rename` doesn't accept both `-offset` and `-qualified-name` at
-the same time. So, you can either specify multiple `-offset` or
-`-qualified-name`.
-
-.. code-block:: console
-
-  $ clang-rename -offset=42 -new-name=bar1 -offset=150 -new-name=bar2 test.cpp
-
-or
-
-.. code-block:: console
-
-  $ clang-rename -qualified-name=foo1 -new-name=bar1 -qualified-name=foo2 -new-name=bar2 test.cpp
-
-
-Alternatively, {offset | qualified-name} / new-name pairs can be put into a YAML
-file:
-
-.. code-block:: yaml
-
-  ---
-  - Offset:         42
-    NewName:        bar1
-  - Offset:         150
-    NewName:        bar2
-  ...
-
-or
-
-.. code-block:: yaml
-
-  ---
-  - QualifiedName:  foo1
-    NewName:        bar1
-  - QualifiedName:  foo2
-    NewName:        bar2
-  ...
-
-That way you can avoid spelling out all the names as command line arguments:
-
-.. code-block:: console
-
-  $ clang-rename -input=test.yaml test.cpp
-
-:program:`clang-rename` offers the following options:
-
-.. code-block:: console
-
-  $ clang-rename --help
-  USAGE: clang-rename [subcommand] [options] <source0> [... <sourceN>]
-
-  OPTIONS:
-
-  Generic Options:
-
-    -help                      - Display available options (-help-hidden for more)
-    -help-list                 - Display list of available options (-help-list-hidden for more)
-    -version                   - Display the version of this program
-
-  clang-rename common options:
-
-    -export-fixes=<filename>   - YAML file to store suggested fixes in.
-    -extra-arg=<string>        - Additional argument to append to the compiler command line
-                                 Can be used several times.
-    -extra-arg-before=<string> - Additional argument to prepend to the compiler command line
-                                 Can be used several times.
-    -force                     - Ignore nonexistent qualified names.
-    -i                         - Overwrite edited <file>s.
-    -input=<string>            - YAML file to load oldname-newname pairs from.
-    -new-name=<string>         - The new name to change the symbol to.
-    -offset=<uint>             - Locates the symbol by offset as opposed to <line>:<column>.
-    -p <string>                - Build path
-    -pl                        - Print the locations affected by renaming to stderr.
-    -pn                        - Print the found symbol's name prior to renaming to stderr.
-    -qualified-name=<string>   - The fully qualified name of the symbol.
-
-Vim Integration
-===============
-
-You can call :program:`clang-rename` directly from Vim! To set up
-:program:`clang-rename` integration for Vim see
-`clang/tools/clang-rename/clang-rename.py
-<https://github.com/llvm/llvm-project/blob/main/clang/tools/clang-rename/clang-rename.py>`_.
-
-Please note that **you have to save all buffers, in which the replacement will
-happen before running the tool**.
-
-Once installed, you can point your cursor to symbols you want to rename, press
-`<leader>cr` and type new desired name. The `<leader> key
-<http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_3)#Map_leader>`_
-is a reference to a specific key defined by the mapleader variable and is bound
-to backslash by default.
-
-Emacs Integration
-=================
-
-You can also use :program:`clang-rename` while using Emacs! To set up
-:program:`clang-rename` integration for Emacs see
-`clang-rename/tool/clang-rename.el
-<https://github.com/llvm/llvm-project/blob/main/clang/tools/clang-rename/clang-rename.el>`_.
-
-Once installed, you can point your cursor to symbols you want to rename, press
-`M-X`, type `clang-rename` and new desired name.
-
-Please note that **you have to save all buffers, in which the replacement will
-happen before running the tool**.
diff --git a/clang-tools-extra/docs/index.rst b/clang-tools-extra/docs/index.rst
index d5c00b89a1555e..9f7324fcf74197 100644
--- a/clang-tools-extra/docs/index.rst
+++ b/clang-tools-extra/docs/index.rst
@@ -19,7 +19,6 @@ Contents
    clang-include-fixer
    modularize
    pp-trace
-   clang-rename
    clangd <https://clangd.llvm.org/>
    clang-doc
 
diff --git a/clang-tools-extra/test/CMakeLists.txt b/clang-tools-extra/test/CMakeLists.txt
index 0953ff2531e1a1..d72a117166a08b 100644
--- a/clang-tools-extra/test/CMakeLists.txt
+++ b/clang-tools-extra/test/CMakeLists.txt
@@ -28,9 +28,6 @@ configure_lit_site_cfg(
   )
 
 set(CLANG_TOOLS_TEST_DEPS
-  # For the clang-apply-replacements test that uses clang-rename.
-  clang-rename
-
   # For the clang-doc tests that emit bitcode files.
   llvm-bcanalyzer
 
diff --git a/clang-tools-extra/test/clang-apply-replacements/ClangRenameClassReplacements.cpp b/clang-tools-extra/test/clang-apply-replacements/ClangRenameClassReplacements.cpp
deleted file mode 100644
index 2b478bbf900df8..00000000000000
--- a/clang-tools-extra/test/clang-apply-replacements/ClangRenameClassReplacements.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-// RUN: rm -rf %t
-// RUN: mkdir -p %t/fixes
-// RUN: cat %s > %t.cpp
-// RUN: clang-rename -offset=254 -new-name=Bar -export-fixes=%t/fixes/clang-rename.yaml %t.cpp --
-// RUN: clang-apply-replacements %t
-// RUN: sed 's,//.*,,' %t.cpp | FileCheck %s
-
-class Foo {}; // CHECK: class Bar {};
-
-// Use grep -FUbo 'Foo' <file> to get the correct offset of Cla when changing
-// this file.
diff --git a/clang/docs/ClangFormattedStatus.rst b/clang/docs/ClangFormattedStatus.rst
index 0ee0782879ef6b..b917e077679b47 100644
--- a/clang/docs/ClangFormattedStatus.rst
+++ b/clang/docs/ClangFormattedStatus.rst
@@ -809,11 +809,6 @@ tree in terms of conformance to :doc:`ClangFormat` as of: March 06, 2022 17:32:2
      - `4`
      - `0`
      - :good:`100%`
-   * - clang/tools/clang-rename
-     - `1`
-     - `1`
-     - `0`
-     - :good:`100%`
    * - clang/tools/clang-repl
      - `1`
      - `1`
diff --git a/clang/docs/tools/clang-formatted-files.txt b/clang/docs/tools/clang-formatted-files.txt
index 48ded9c7545547..fa40ea74fb7e7d 100644
--- a/clang/docs/tools/clang-formatted-files.txt
+++ b/clang/docs/tools/clang-formatted-files.txt
@@ -608,7 +608,6 @@ clang/tools/clang-refactor/ClangRefactor.cpp
 clang/tools/clang-refactor/TestSupport.cpp
 clang/tools/clang-refactor/TestSupport.h
 clang/tools/clang-refactor/ToolRefactoringResultConsumer.h
-clang/tools/clang-rename/ClangRename.cpp
 clang/tools/clang-repl/ClangRepl.cpp
 clang/tools/clang-scan-deps/ClangScanDeps.cpp
 clang/tools/clang-shlib/clang-shlib.cpp
diff --git a/clang/test/CMakeLists.txt b/clang/test/CMakeLists.txt
index 299a35723b59d5..2d84b0d73053f6 100644
--- a/clang/test/CMakeLists.txt
+++ b/clang/test/CMakeLists.txt
@@ -72,7 +72,6 @@ list(APPEND CLANG_TEST_DEPS
   clang-tblgen
   clang-offload-bundler
   clang-import-test
-  clang-rename
   clang-refactor
   clang-diff
   clang-installapi
diff --git a/clang/test/clang-rename/ClassAsTemplateArgument.cpp b/clang/test/clang-rename/ClassAsTemplateArgument.cpp
deleted file mode 100644
index 2e09a5b529e753..00000000000000
--- a/clang/test/clang-rename/ClassAsTemplateArgument.cpp
+++ /dev/null
@@ -1,21 +0,0 @@
-class Foo /* Test 1 */ {};    // CHECK: class Bar /* Test 1 */ {};
-
-template <typename T>
-void func() {}
-
-template <typename T>
-class Baz {};
-
-int main() {
-  func<Foo>();                // CHECK: func<Bar>();
-  Baz<Foo> /* Test 2 */ obj;  // CHECK: Baz<Bar> /* Test 2 */ obj;
-  return 0;
-}
-
-// Test 1.
-// RUN: clang-rename -offset=7 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 2.
-// RUN: clang-rename -offset=215 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-
-// To find offsets after modifying the file, use:
-//   grep -Ubo 'Foo.*' <file>
diff --git a/clang/test/clang-rename/ClassFindByName.cpp b/clang/test/clang-rename/ClassFindByName.cpp
deleted file mode 100644
index 4430891ec4b1e0..00000000000000
--- a/clang/test/clang-rename/ClassFindByName.cpp
+++ /dev/null
@@ -1,10 +0,0 @@
-class Foo {         // CHECK: class Bar {
-};
-
-int main() {
-  Foo *Pointer = 0; // CHECK: Bar *Pointer = 0;
-  return 0;
-}
-
-// Test 1.
-// RUN: clang-rename -qualified-name=Foo -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
diff --git a/clang/test/clang-rename/ClassSimpleRenaming.cpp b/clang/test/clang-rename/ClassSimpleRenaming.cpp
deleted file mode 100644
index 086f55736cb72f..00000000000000
--- a/clang/test/clang-rename/ClassSimpleRenaming.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-class Foo /* Test 1 */ {              // CHECK: class Bar /* Test 1 */ {
-public:
-  void foo(int x);
-};
-
-void Foo::foo(int x) /* Test 2 */ {}  // CHECK: void Bar::foo(int x) /* Test 2 */ {}
-
-// Test 1.
-// RUN: clang-rename -offset=6 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 2.
-// RUN: clang-rename -offset=109 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-
-// To find offsets after modifying the file, use:
-//   grep -Ubo 'Foo.*' <file>
diff --git a/clang/test/clang-rename/ClassTestMulti.cpp b/clang/test/clang-rename/ClassTestMulti.cpp
deleted file mode 100644
index 81e65c76065214..00000000000000
--- a/clang/test/clang-rename/ClassTestMulti.cpp
+++ /dev/null
@@ -1,11 +0,0 @@
-class Foo1 /* Offset 1 */ { // CHECK: class Bar1 /* Offset 1 */ {
-};
-
-class Foo2 /* Offset 2 */ { // CHECK: class Bar2 /* Offset 2 */ {
-};
-
-// Test 1.
-// RUN: clang-rename -offset=6 -new-name=Bar1 -offset=76 -new-name=Bar2 %s -- | sed 's,//.*,,' | FileCheck %s
-
-// To find offsets after modifying the file, use:
-//   grep -Ubo 'Foo.*' <file>
diff --git a/clang/test/clang-rename/ClassTestMultiByName.cpp b/clang/test/clang-rename/ClassTestMultiByName.cpp
deleted file mode 100644
index 61b69a1bdf4cac..00000000000000
--- a/clang/test/clang-rename/ClassTestMultiByName.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-class Foo1 { // CHECK: class Bar1
-};
-
-class Foo2 { // CHECK: class Bar2
-};
-
-// Test 1.
-// RUN: clang-rename -qualified-name=Foo1 -new-name=Bar1 -qualified-name=Foo2 -new-name=Bar2 %s -- | sed 's,//.*,,' | FileCheck %s
diff --git a/clang/test/clang-rename/ComplexFunctionOverride.cpp b/clang/test/clang-rename/ComplexFunctionOverride.cpp
deleted file mode 100644
index ccf3a20e540024..00000000000000
--- a/clang/test/clang-rename/ComplexFunctionOverride.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-struct A {
-  virtual void foo() {} /* Test 1 */    // CHECK: virtual void bar() {}
-};
-
-struct B : A {
-  void foo() override {} /* Test 2 */   // CHECK: void bar() override {}
-};
-
-struct C : B {
-  void foo() override {} /* Test 3 */   // CHECK: void bar() override {}
-};
-
-struct D : B {
-  void foo() override {} /* Test 4 */   // CHECK: void bar() override {}
-};
-
-struct E : D {
-  void foo() override {} /* Test 5 */   // CHECK: void bar() override {}
-};
-
-int main() {
-  A a;
-  a.foo();                              // CHECK: a.bar();
-  B b;
-  b.foo();                              // CHECK: b.bar();
-  C c;
-  c.foo();                              // CHECK: c.bar();
-  D d;
-  d.foo();                              // CHECK: d.bar();
-  E e;
-  e.foo();                              // CHECK: e.bar();
-  return 0;
-}
-
-// Test 1.
-// RUN: clang-rename -offset=26 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 2.
-// RUN: clang-rename -offset=109 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 3.
-// RUN: clang-rename -offset=201 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 4.
-// RUN: clang-rename -offset=293 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 5.
-// RUN: clang-rename -offset=385 -new-name=bar %s -- | sed 's,//.*,,' | FileCheck %s
-
-// To find offsets after modifying the file, use:
-//   grep -Ubo 'foo.*' <file>
diff --git a/clang/test/clang-rename/ComplicatedClassType.cpp b/clang/test/clang-rename/ComplicatedClassType.cpp
deleted file mode 100644
index 8801953031273a..00000000000000
--- a/clang/test/clang-rename/ComplicatedClassType.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-// Forward declaration.
-class Foo; /* Test 1 */               // CHECK: class Bar; /* Test 1 */
-
-class Baz {
-  virtual int getValue() const = 0;
-};
-
-class Foo : public Baz  { /* Test 2 */// CHECK: class Bar : public Baz {
-public:
-  Foo(int value = 0) : x(value) {}    // CHECK: Bar(int value = 0) : x(value) {}
-
-  Foo &operator++(int) {              // CHECK: Bar &operator++(int) {
-    x++;
-    return *this;
-  }
-
-  bool operator<(Foo const &rhs) {    // CHECK: bool operator<(Bar const &rhs) {
-    return this->x < rhs.x;
-  }
-
-  int getValue() const {
-    return 0;
-  }
-
-private:
-  int x;
-};
-
-int main() {
-  Foo *Pointer = 0;                   // CHECK: Bar *Pointer = 0;
-  Foo Variable = Foo(10);             // CHECK: Bar Variable = Bar(10);
-  for (Foo it; it < Variable; it++) { // CHECK: for (Bar it; it < Variable; it++) {
-  }
-  const Foo *C = new Foo();           // CHECK: const Bar *C = new Bar();
-  const_cast<Foo *>(C)->getValue();   // CHECK: const_cast<Bar *>(C)->getValue();
-  Foo foo;                            // CHECK: Bar foo;
-  const Baz &BazReference = foo;
-  const Baz *BazPointer = &foo;
-  dynamic_cast<const Foo &>(BazReference).getValue();     /* Test 3 */ // CHECK: dynamic_cast<const Bar &>(BazReference).getValue();
-  dynamic_cast<const Foo *>(BazPointer)->getValue();      /* Test 4 */ // CHECK: dynamic_cast<const Bar *>(BazPointer)->getValue();
-  reinterpret_cast<const Foo *>(BazPointer)->getValue();  /* Test 5 */ // CHECK: reinterpret_cast<const Bar *>(BazPointer)->getValue();
-  static_cast<const Foo &>(BazReference).getValue();      /* Test 6 */ // CHECK: static_cast<const Bar &>(BazReference).getValue();
-  static_cast<const Foo *>(BazPointer)->getValue();       /* Test 7 */ // CHECK: static_cast<const Bar *>(BazPointer)->getValue();
-  return 0;
-}
-
-// Test 1.
-// RUN: clang-rename -offset=30 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s
-// Test 2.
-// RUN: clang-rename -offset=155 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s
-// Test 3.
-// RUN: clang-rename -offset=1133 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s
-// Test 4.
-// RUN: clang-rename -offset=1266 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s
-// Test 5.
-// RUN: clang-rename -offset=1402 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s
-// Test 6.
-// RUN: clang-rename -offset=1533 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s
-// Test 7.
-// RUN: clang-rename -offset=1665 -new-name=Bar %s -- -frtti | sed 's,//.*,,' | FileCheck %s
-
-// To find offsets after modifying the file, use:
-//   grep -Ubo 'Foo.*' <file>
diff --git a/clang/test/clang-rename/Ctor.cpp b/clang/test/clang-rename/Ctor.cpp
deleted file mode 100644
index 9908a4123ddfc0..00000000000000
--- a/clang/test/clang-rename/Ctor.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
-class Foo {                   // CHECK: class Bar {
-public:
-  Foo();    /* Test 1 */      // CHECK: Bar();
-};
-
-Foo::Foo()  /* Test 2 */ {}   // CHECK: Bar::Bar()  /* Test 2 */ {}
-
-// Test 1.
-// RUN: clang-rename -offset=62 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 2.
-// RUN: clang-rename -offset=116 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-
-// To find offsets after modifying the file, use:
-//   grep -Ubo 'Foo.*' <file>
diff --git a/clang/test/clang-rename/CtorInitializer.cpp b/clang/test/clang-rename/CtorInitializer.cpp
deleted file mode 100644
index fed4f5b06c2755..00000000000000
--- a/clang/test/clang-rename/CtorInitializer.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-class Baz {};
-
-class Qux {
-  Baz Foo;         /* Test 1 */       // CHECK: Baz Bar;
-public:
-  Qux();
-};
-
-Qux::Qux() : Foo() /* Test 2 */ {}    // CHECK: Qux::Qux() : Bar() /* Test 2 */ {}
-
-// Test 1.
-// RUN: clang-rename -offset=33 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 2.
-// RUN: clang-rename -offset=118 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-
-// To find offsets after modifying the file, use:
-//   grep -Ubo 'Foo.*' <file>
diff --git a/clang/test/clang-rename/DeclRefExpr.cpp b/clang/test/clang-rename/DeclRefExpr.cpp
deleted file mode 100644
index 6462862d82adfa..00000000000000
--- a/clang/test/clang-rename/DeclRefExpr.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-class C {
-public:
-  static int Foo; /* Test 1 */  // CHECK: static int Bar;
-};
-
-int foo(int x) { return 0; }
-#define MACRO(a) foo(a)
-
-int main() {
-  C::Foo = 1;     /* Test 2 */  // CHECK: C::Bar = 1;
-  MACRO(C::Foo);                // CHECK: MACRO(C::Bar);
-  int y = C::Foo; /* Test 3 */  // CHECK: int y = C::Bar;
-  return 0;
-}
-
-// Test 1.
-// RUN: clang-rename -offset=31 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 2.
-// RUN: clang-rename -offset=152 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-// Test 3.
-// RUN: clang-rename -offset=271 -new-name=Bar %s -- | sed 's,//.*,,' | FileCheck %s
-
-// To find offsets after modifying the file, use:
-//   grep -Ubo 'Foo.*' <file>
diff --git a/clang/test/clang-rename/ForceMulti.cpp b/clang/test/clang-rename/ForceMulti.cpp
deleted file mode 100644
index 41983ce260c826..00000000000000
--- a/clang/test/clang-rename/ForceMulti.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-class B /* Test 1 */ { // CHECK: class B2 /* Test 1 */ {
-};
-
-class D : public B /* Test 1 */ { // C...
[truncated]

``````````

</details>


https://github.com/llvm/llvm-project/pull/108988


More information about the cfe-commits mailing list