Rename clang-replace -> clang-apply-replacements

Made changes throughout clang-tools-extra for the renaming of
clang-replace to clang-apply-replacements as per feedback from
community.

llvm-svn: 189832
GitOrigin-RevId: b225be2729558a7b8d45b61056473c13ed2fd9aa
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 706f78d..e4b239d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,7 +1,7 @@
 add_subdirectory(remove-cstr-calls)
 add_subdirectory(tool-template)
+add_subdirectory(clang-apply-replacements)
 add_subdirectory(cpp11-migrate)
-add_subdirectory(clang-replace)
 add_subdirectory(modularize)
 add_subdirectory(clang-tidy)
 
diff --git a/Makefile b/Makefile
index a1b5561..fdcade7 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@
 include $(CLANG_LEVEL)/../../Makefile.config
 
 PARALLEL_DIRS := remove-cstr-calls tool-template modularize
-DIRS := clang-replace cpp11-migrate clang-tidy unittests
+DIRS := clang-apply-replacements cpp11-migrate clang-tidy unittests
 
 include $(CLANG_LEVEL)/Makefile
 
diff --git a/clang-replace/CMakeLists.txt b/clang-apply-replacements/CMakeLists.txt
similarity index 76%
rename from clang-replace/CMakeLists.txt
rename to clang-apply-replacements/CMakeLists.txt
index 5f954e2..c786f25 100644
--- a/clang-replace/CMakeLists.txt
+++ b/clang-apply-replacements/CMakeLists.txt
@@ -6,10 +6,10 @@
   mc
   )
 
-add_clang_library(clangReplace
+add_clang_library(clangApplyReplacements
   lib/Tooling/ApplyReplacements.cpp
   )
-target_link_libraries(clangReplace
+target_link_libraries(clangApplyReplacements
   clangTooling
   clangBasic
   clangRewriteFrontend
diff --git a/clang-replace/Makefile b/clang-apply-replacements/Makefile
similarity index 85%
rename from clang-replace/Makefile
rename to clang-apply-replacements/Makefile
index 5186f8d..7fd932b 100644
--- a/clang-replace/Makefile
+++ b/clang-apply-replacements/Makefile
@@ -1,4 +1,4 @@
-##===- clang-replace/Makefile ------------------------------*- Makefile -*-===##
+##===- clang-apply-replacements/Makefile -------------------*- Makefile -*-===##
 #
 #                     The LLVM Compiler Infrastructure
 #
diff --git a/clang-replace/include/clang-replace/Tooling/ApplyReplacements.h b/clang-apply-replacements/include/clang-apply-replacements/Tooling/ApplyReplacements.h
similarity index 100%
rename from clang-replace/include/clang-replace/Tooling/ApplyReplacements.h
rename to clang-apply-replacements/include/clang-apply-replacements/Tooling/ApplyReplacements.h
diff --git a/clang-replace/lib/Tooling/ApplyReplacements.cpp b/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
similarity index 98%
rename from clang-replace/lib/Tooling/ApplyReplacements.cpp
rename to clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
index 58f24c5..660c58b 100644
--- a/clang-replace/lib/Tooling/ApplyReplacements.cpp
+++ b/clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp
@@ -14,7 +14,7 @@
 /// FIXME: Use Diagnostics for output instead of llvm::errs().
 ///
 //===----------------------------------------------------------------------===//
-#include "clang-replace/Tooling/ApplyReplacements.h"
+#include "clang-apply-replacements/Tooling/ApplyReplacements.h"
 #include "clang/Basic/LangOptions.h"
 #include "clang/Basic/SourceManager.h"
 #include "clang/Rewrite/Core/Rewriter.h"
diff --git a/clang-replace/lib/Tooling/Makefile b/clang-apply-replacements/lib/Tooling/Makefile
similarity index 80%
rename from clang-replace/lib/Tooling/Makefile
rename to clang-apply-replacements/lib/Tooling/Makefile
index 017738c..c341ff3 100644
--- a/clang-replace/lib/Tooling/Makefile
+++ b/clang-apply-replacements/lib/Tooling/Makefile
@@ -1,5 +1,4 @@
-
-##===- clang-replace/Makefile ------------------------------*- Makefile -*-===##
+##===- clang-apply-replacements/lib/Tooling/Makefile -------*- Makefile -*-===##
 #
 #                     The LLVM Compiler Infrastructure
 #
@@ -9,7 +8,7 @@
 ##===----------------------------------------------------------------------===##
 
 CLANG_LEVEL := ../../../../..
-LIBRARYNAME := clangReplace
+LIBRARYNAME := clangApplyReplacements
 include $(CLANG_LEVEL)/../../Makefile.config
 include $(CLANG_LEVEL)/Makefile
 CPP.Flags += -I$(PROJ_SRC_DIR)/../../include
diff --git a/clang-apply-replacements/tool/CMakeLists.txt b/clang-apply-replacements/tool/CMakeLists.txt
new file mode 100644
index 0000000..c6a10df
--- /dev/null
+++ b/clang-apply-replacements/tool/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(LLVM_LINK_COMPONENTS
+  ${LLVM_TARGETS_TO_BUILD}
+  asmparser
+  bitreader
+  support
+  mc
+  )
+
+add_clang_executable(clang-apply-replacements
+  ClangApplyReplacementsMain.cpp
+  )
+target_link_libraries(clang-apply-replacements
+  clangApplyReplacements
+  )
+
+install(TARGETS clang-apply-replacements
+  RUNTIME DESTINATION bin)
diff --git a/clang-replace/tool/ClangReplaceMain.cpp b/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
similarity index 92%
rename from clang-replace/tool/ClangReplaceMain.cpp
rename to clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
index 24164c5..01ca686 100644
--- a/clang-replace/tool/ClangReplaceMain.cpp
+++ b/clang-apply-replacements/tool/ClangApplyReplacementsMain.cpp
@@ -1,4 +1,4 @@
-//===-- ClangReplaceMain.cpp - Main file for clang-replace tool -----------===//
+//===-- ClangApplyReplacementsMain.cpp - Main file for the tool -----------===//
 //
 //                     The LLVM Compiler Infrastructure
 //
@@ -8,11 +8,12 @@
 //===----------------------------------------------------------------------===//
 ///
 /// \file
-/// \brief This file provides the main function for the clang-replace tool.
+/// \brief This file provides the main function for the
+/// clang-apply-replacements tool.
 ///
 //===----------------------------------------------------------------------===//
 
-#include "clang-replace/Tooling/ApplyReplacements.h"
+#include "clang-apply-replacements/Tooling/ApplyReplacements.h"
 #include "clang/Basic/Diagnostic.h"
 #include "clang/Basic/DiagnosticOptions.h"
 #include "clang/Basic/SourceManager.h"
diff --git a/clang-replace/tool/Makefile b/clang-apply-replacements/tool/Makefile
similarity index 77%
rename from clang-replace/tool/Makefile
rename to clang-apply-replacements/tool/Makefile
index 107e781..97d9927 100644
--- a/clang-replace/tool/Makefile
+++ b/clang-apply-replacements/tool/Makefile
@@ -1,4 +1,4 @@
-##===- clang-replace/tool/Makefile -------------------------*- Makefile -*-===##
+##===- clang-apply-replacements/tool/Makefile --------------*- Makefile -*-===##
 #
 #                     The LLVM Compiler Infrastructure
 #
@@ -10,15 +10,15 @@
 CLANG_LEVEL := ../../../..
 include $(CLANG_LEVEL)/../../Makefile.config
 
-TOOLNAME = clang-replace
+TOOLNAME = clang-apply-replacements
 
 # No plugins, optimize startup time.
 TOOL_NO_EXPORTS = 1
 
-SOURCES = ClangReplaceMain.cpp
+SOURCES = ClangApplyReplacementsMain.cpp
 
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc mcparser option
-USEDLIBS = clangReplace.a clangFormat.a clangTooling.a clangFrontend.a \
+USEDLIBS = clangApplyReplacements.a clangFormat.a clangTooling.a clangFrontend.a \
 	   clangSerialization.a clangDriver.a clangRewriteFrontend.a \
 	   clangRewriteCore.a clangParse.a clangSema.a clangAnalysis.a \
 	   clangAST.a clangASTMatchers.a clangEdit.a clangLex.a clangBasic.a
diff --git a/clang-replace/tool/CMakeLists.txt b/clang-replace/tool/CMakeLists.txt
deleted file mode 100644
index ff47688..0000000
--- a/clang-replace/tool/CMakeLists.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-set(LLVM_LINK_COMPONENTS
-  ${LLVM_TARGETS_TO_BUILD}
-  asmparser
-  bitreader
-  support
-  mc
-  )
-
-add_clang_executable(clang-replace
-  ClangReplaceMain.cpp
-  )
-target_link_libraries(clang-replace
-  clangReplace
-  )
-
-install(TARGETS clang-replace
-  RUNTIME DESTINATION bin)
diff --git a/cpp11-migrate/CMakeLists.txt b/cpp11-migrate/CMakeLists.txt
index 41bb68e..5413edc 100644
--- a/cpp11-migrate/CMakeLists.txt
+++ b/cpp11-migrate/CMakeLists.txt
@@ -1,5 +1,5 @@
 get_filename_component(ClangReplaceLocation
-  "${CMAKE_CURRENT_SOURCE_DIR}/../clang-replace/include" ABSOLUTE)
+  "${CMAKE_CURRENT_SOURCE_DIR}/../clang-apply-replacements/include" ABSOLUTE)
 
 include_directories(
   ${CMAKE_CURRENT_SOURCE_DIR}
diff --git a/cpp11-migrate/Core/FileOverrides.h b/cpp11-migrate/Core/FileOverrides.h
index 8cde759..8ed2914 100644
--- a/cpp11-migrate/Core/FileOverrides.h
+++ b/cpp11-migrate/Core/FileOverrides.h
@@ -17,7 +17,7 @@
 #define CPP11_MIGRATE_FILE_OVERRIDES_H
 
 #include "Core/Refactoring.h"
-#include "clang-replace/Tooling/ApplyReplacements.h"
+#include "clang-apply-replacements/Tooling/ApplyReplacements.h"
 #include "clang/Tooling/ReplacementsYaml.h"
 #include "llvm/ADT/StringMap.h"
 
diff --git a/cpp11-migrate/Core/Makefile b/cpp11-migrate/Core/Makefile
index 51bc98d..e60e113 100644
--- a/cpp11-migrate/Core/Makefile
+++ b/cpp11-migrate/Core/Makefile
@@ -11,4 +11,4 @@
 
 include $(CLANG_LEVEL)/Makefile
 
-CPP.Flags += -I$(PROJ_SRC_DIR)/.. -I$(PROJ_SRC_DIR)/../../clang-replace/include
+CPP.Flags += -I$(PROJ_SRC_DIR)/.. -I$(PROJ_SRC_DIR)/../../clang-apply-replacements/include
diff --git a/cpp11-migrate/tool/CMakeLists.txt b/cpp11-migrate/tool/CMakeLists.txt
index 8721b5e..06e61c3 100644
--- a/cpp11-migrate/tool/CMakeLists.txt
+++ b/cpp11-migrate/tool/CMakeLists.txt
@@ -34,7 +34,7 @@
   )
 
 target_link_libraries(cpp11-migrate
-  clangReplace
+  clangApplyReplacements
   migrateCore
   )
 
diff --git a/cpp11-migrate/tool/Cpp11Migrate.cpp b/cpp11-migrate/tool/Cpp11Migrate.cpp
index e75a475..14d5560 100644
--- a/cpp11-migrate/tool/Cpp11Migrate.cpp
+++ b/cpp11-migrate/tool/Cpp11Migrate.cpp
@@ -28,7 +28,7 @@
 #include "clang/Rewrite/Core/Rewriter.h"
 #include "clang/Tooling/CommonOptionsParser.h"
 #include "clang/Tooling/Tooling.h"
-#include "clang-replace/Tooling/ApplyReplacements.h"
+#include "clang-apply-replacements/Tooling/ApplyReplacements.h"
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/ADT/StringSwitch.h"
 #include "llvm/Support/MemoryBuffer.h"
diff --git a/cpp11-migrate/tool/Makefile b/cpp11-migrate/tool/Makefile
index 82abe8a..8c4d010 100644
--- a/cpp11-migrate/tool/Makefile
+++ b/cpp11-migrate/tool/Makefile
@@ -36,14 +36,14 @@
 BUILT_SOURCES += $(ObjDir)/../ReplaceAutoPtr/.objdir
 
 LINK_COMPONENTS := $(TARGETS_TO_BUILD) asmparser bitreader support mc mcparser option
-USEDLIBS = migrateCore.a clangFormat.a clangReplace.a clangTooling.a clangFrontend.a \
+USEDLIBS = migrateCore.a clangFormat.a clangApplyReplacements.a clangTooling.a clangFrontend.a \
 	   clangSerialization.a clangDriver.a clangRewriteFrontend.a \
 	   clangRewriteCore.a clangParse.a clangSema.a clangAnalysis.a \
 	   clangAST.a clangASTMatchers.a clangEdit.a clangLex.a clangBasic.a
 
 include $(CLANG_LEVEL)/Makefile
 
-CPP.Flags += -I$(PROJ_SRC_DIR)/.. -I$(PROJ_SRC_DIR)/../../clang-replace/include
+CPP.Flags += -I$(PROJ_SRC_DIR)/.. -I$(PROJ_SRC_DIR)/../../clang-apply-replacements/include
 
 # BUILT_SOURCES gets used as a prereq for many top-level targets. However, at
 # the point those targets are defined, $(ObjDir) hasn't been defined and so the
diff --git a/docs/Doxyfile b/docs/Doxyfile
index 1c5e058..3403bae 100644
--- a/docs/Doxyfile
+++ b/docs/Doxyfile
@@ -648,7 +648,7 @@
 # directories like "/usr/src/myproject". Separate the files or directories
 # with spaces.
 
-INPUT                  = ../cpp11-migrate ../clang-replace
+INPUT                  = ../cpp11-migrate ../clang-apply-replacements
 
 # This tag can be used to specify the character encoding of the source files
 # that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 49fd4b9..6ab8e6d 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -27,7 +27,7 @@
   clang clang-headers FileCheck count not
 
   # Individual tools we test.
-  remove-cstr-calls clang-replace cpp11-migrate modularize clang-tidy
+  remove-cstr-calls clang-apply-replacements cpp11-migrate modularize clang-tidy
 
   # Unit tests
   ExtraToolsUnitTests
diff --git a/test/clang-replace/Inputs/basic/basic.h b/test/clang-apply-replacements/Inputs/basic/basic.h
similarity index 100%
rename from test/clang-replace/Inputs/basic/basic.h
rename to test/clang-apply-replacements/Inputs/basic/basic.h
diff --git a/test/clang-replace/Inputs/basic/file1.yaml b/test/clang-apply-replacements/Inputs/basic/file1.yaml
similarity index 100%
rename from test/clang-replace/Inputs/basic/file1.yaml
rename to test/clang-apply-replacements/Inputs/basic/file1.yaml
diff --git a/test/clang-replace/Inputs/basic/file2.yaml b/test/clang-apply-replacements/Inputs/basic/file2.yaml
similarity index 100%
rename from test/clang-replace/Inputs/basic/file2.yaml
rename to test/clang-apply-replacements/Inputs/basic/file2.yaml
diff --git a/test/clang-replace/Inputs/conflict/common.h b/test/clang-apply-replacements/Inputs/conflict/common.h
similarity index 100%
rename from test/clang-replace/Inputs/conflict/common.h
rename to test/clang-apply-replacements/Inputs/conflict/common.h
diff --git a/test/clang-replace/Inputs/conflict/expected.txt b/test/clang-apply-replacements/Inputs/conflict/expected.txt
similarity index 100%
rename from test/clang-replace/Inputs/conflict/expected.txt
rename to test/clang-apply-replacements/Inputs/conflict/expected.txt
diff --git a/test/clang-replace/Inputs/conflict/file1.yaml b/test/clang-apply-replacements/Inputs/conflict/file1.yaml
similarity index 100%
rename from test/clang-replace/Inputs/conflict/file1.yaml
rename to test/clang-apply-replacements/Inputs/conflict/file1.yaml
diff --git a/test/clang-replace/Inputs/conflict/file2.yaml b/test/clang-apply-replacements/Inputs/conflict/file2.yaml
similarity index 100%
rename from test/clang-replace/Inputs/conflict/file2.yaml
rename to test/clang-apply-replacements/Inputs/conflict/file2.yaml
diff --git a/test/clang-replace/Inputs/conflict/file3.yaml b/test/clang-apply-replacements/Inputs/conflict/file3.yaml
similarity index 100%
rename from test/clang-replace/Inputs/conflict/file3.yaml
rename to test/clang-apply-replacements/Inputs/conflict/file3.yaml
diff --git a/test/clang-replace/basic.cpp b/test/clang-apply-replacements/basic.cpp
similarity index 71%
rename from test/clang-replace/basic.cpp
rename to test/clang-apply-replacements/basic.cpp
index 5723d14..4f19a96 100644
--- a/test/clang-replace/basic.cpp
+++ b/test/clang-apply-replacements/basic.cpp
@@ -2,15 +2,15 @@
 // RUN: grep -Ev "// *[A-Z-]+:" %S/Inputs/basic/basic.h > %T/Inputs/basic/basic.h
 // RUN: sed "s#\$(path)#%/T/Inputs/basic#" %S/Inputs/basic/file1.yaml > %T/Inputs/basic/file1.yaml
 // RUN: sed "s#\$(path)#%/T/Inputs/basic#" %S/Inputs/basic/file2.yaml > %T/Inputs/basic/file2.yaml
-// RUN: clang-replace %T/Inputs/basic
+// RUN: clang-apply-replacements %T/Inputs/basic
 // RUN: FileCheck -input-file=%T/Inputs/basic/basic.h %S/Inputs/basic/basic.h
 //
-// Check that the yaml files are *not* deleted after running clang-replace without remove-change-desc-files.
+// Check that the yaml files are *not* deleted after running clang-apply-replacements without remove-change-desc-files.
 // RUN: ls -1 %T/Inputs/basic | FileCheck %s --check-prefix=YAML
 //
-// Check that the yaml files *are* deleted after running clang-replace with remove-change-desc-files.
+// Check that the yaml files *are* deleted after running clang-apply-replacements with remove-change-desc-files.
 // RUN: grep -Ev "// *[A-Z-]+:" %S/Inputs/basic/basic.h > %T/Inputs/basic/basic.h
-// RUN: clang-replace -remove-change-desc-files %T/Inputs/basic
+// RUN: clang-apply-replacements -remove-change-desc-files %T/Inputs/basic
 // RUN: ls -1 %T/Inputs/basic | FileCheck %s --check-prefix=NO_YAML
 //
 // YAML: {{^file.\.yaml$}}
diff --git a/test/clang-replace/conflict.cpp b/test/clang-apply-replacements/conflict.cpp
similarity index 65%
rename from test/clang-replace/conflict.cpp
rename to test/clang-apply-replacements/conflict.cpp
index 0a814ef..c1f2342 100644
--- a/test/clang-replace/conflict.cpp
+++ b/test/clang-apply-replacements/conflict.cpp
@@ -3,14 +3,14 @@
 // RUN: sed "s#\$(path)#%/S/Inputs/conflict#" %S/Inputs/conflict/file2.yaml > %T/Inputs/conflict/file2.yaml
 // RUN: sed "s#\$(path)#%/S/Inputs/conflict#" %S/Inputs/conflict/file3.yaml > %T/Inputs/conflict/file3.yaml
 // RUN: sed "s#\$(path)#%/S/Inputs/conflict#" %S/Inputs/conflict/expected.txt > %T/Inputs/conflict/expected.txt
-// RUN: not clang-replace %T/Inputs/conflict > %T/Inputs/conflict/output.txt 2>&1
+// RUN: not clang-apply-replacements %T/Inputs/conflict > %T/Inputs/conflict/output.txt 2>&1
 // RUN: diff -b %T/Inputs/conflict/output.txt %T/Inputs/conflict/expected.txt
 //
-// Check that the yaml files are *not* deleted after running clang-replace without remove-change-desc-files even when there is a failure.
+// Check that the yaml files are *not* deleted after running clang-apply-replacements without remove-change-desc-files even when there is a failure.
 // RUN: ls -1 %T/Inputs/conflict | FileCheck %s --check-prefix=YAML
 //
-// Check that the yaml files *are* deleted after running clang-replace with remove-change-desc-files even when there is a failure.
-// RUN: not clang-replace %T/Inputs/conflict -remove-change-desc-files > %T/Inputs/conflict/output.txt 2>&1
+// Check that the yaml files *are* deleted after running clang-apply-replacements with remove-change-desc-files even when there is a failure.
+// RUN: not clang-apply-replacements %T/Inputs/conflict -remove-change-desc-files > %T/Inputs/conflict/output.txt 2>&1
 // RUN: ls -1 %T/Inputs/conflict | FileCheck %s --check-prefix=NO_YAML
 //
 // YAML: {{^file.\.yaml$}}
diff --git a/unittests/cpp11-migrate/CMakeLists.txt b/unittests/cpp11-migrate/CMakeLists.txt
index 228de69..8bcdf71 100644
--- a/unittests/cpp11-migrate/CMakeLists.txt
+++ b/unittests/cpp11-migrate/CMakeLists.txt
@@ -5,7 +5,7 @@
 get_filename_component(CPP11_MIGRATE_SOURCE_DIR
   ${CMAKE_CURRENT_SOURCE_DIR}/../../cpp11-migrate REALPATH)
 get_filename_component(ClangReplaceLocation
-  "${CMAKE_CURRENT_SOURCE_DIR}/../../clang-replace/include" REALPATH)
+  "${CMAKE_CURRENT_SOURCE_DIR}/../../clang-apply-replacements/include" REALPATH)
 include_directories(
   ${CPP11_MIGRATE_SOURCE_DIR}
   ${ClangReplaceLocation}
diff --git a/unittests/cpp11-migrate/Makefile b/unittests/cpp11-migrate/Makefile
index 2f4a59a..464bcd7 100644
--- a/unittests/cpp11-migrate/Makefile
+++ b/unittests/cpp11-migrate/Makefile
@@ -13,7 +13,7 @@
 TESTNAME = Cpp11MigrateTests
 LINK_COMPONENTS := asmparser bitreader support MC MCParser option \
 		TransformUtils
-USEDLIBS = migrateCore.a clangFormat.a clangReplace.a clangTooling.a clangFrontend.a \
+USEDLIBS = migrateCore.a clangFormat.a clangApplyReplacements.a clangTooling.a clangFrontend.a \
 		clangSerialization.a clangDriver.a clangRewriteFrontend.a \
 		clangRewriteCore.a clangParse.a clangSema.a clangAnalysis.a \
 		clangAST.a clangASTMatchers.a clangEdit.a clangLex.a \
@@ -21,5 +21,5 @@
 
 include $(CLANG_LEVEL)/Makefile
 MAKEFILE_UNITTEST_NO_INCLUDE_COMMON := 1
-CPP.Flags += -I$(PROJ_SRC_DIR)/../../cpp11-migrate -I$(PROJ_SRC_DIR)/../../clang-replace/include
+CPP.Flags += -I$(PROJ_SRC_DIR)/../../cpp11-migrate -I$(PROJ_SRC_DIR)/../../clang-apply-replacements/include
 include $(LLVM_SRC_ROOT)/unittests/Makefile.unittest