Rename directory housing clang-include-fixer to be eponymous
authorNico Weber <nicolasweber@gmx.de>
Mon, 25 Mar 2019 14:09:10 +0000 (14:09 +0000)
committerNico Weber <nicolasweber@gmx.de>
Mon, 25 Mar 2019 14:09:10 +0000 (14:09 +0000)
Makes the name of this directory consistent with the names of the other
directories in clang-tools-extra.

Similar to r356254. No intended behavior change.

Differential Revision: https://reviews.llvm.org/D59750

llvm-svn: 356897

73 files changed:
clang-tools-extra/CMakeLists.txt
clang-tools-extra/clang-include-fixer/CMakeLists.txt [moved from clang-tools-extra/include-fixer/CMakeLists.txt with 100% similarity]
clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp [moved from clang-tools-extra/include-fixer/FuzzySymbolIndex.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.h [moved from clang-tools-extra/include-fixer/FuzzySymbolIndex.h with 95% similarity]
clang-tools-extra/clang-include-fixer/InMemorySymbolIndex.cpp [moved from clang-tools-extra/include-fixer/InMemorySymbolIndex.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/InMemorySymbolIndex.h [moved from clang-tools-extra/include-fixer/InMemorySymbolIndex.h with 100% similarity]
clang-tools-extra/clang-include-fixer/IncludeFixer.cpp [moved from clang-tools-extra/include-fixer/IncludeFixer.cpp with 98% similarity]
clang-tools-extra/clang-include-fixer/IncludeFixer.h [moved from clang-tools-extra/include-fixer/IncludeFixer.h with 99% similarity]
clang-tools-extra/clang-include-fixer/IncludeFixerContext.cpp [moved from clang-tools-extra/include-fixer/IncludeFixerContext.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/IncludeFixerContext.h [moved from clang-tools-extra/include-fixer/IncludeFixerContext.h with 100% similarity]
clang-tools-extra/clang-include-fixer/SymbolIndex.h [moved from clang-tools-extra/include-fixer/SymbolIndex.h with 100% similarity]
clang-tools-extra/clang-include-fixer/SymbolIndexManager.cpp [moved from clang-tools-extra/include-fixer/SymbolIndexManager.cpp with 99% similarity]
clang-tools-extra/clang-include-fixer/SymbolIndexManager.h [moved from clang-tools-extra/include-fixer/SymbolIndexManager.h with 100% similarity]
clang-tools-extra/clang-include-fixer/YamlSymbolIndex.cpp [moved from clang-tools-extra/include-fixer/YamlSymbolIndex.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/YamlSymbolIndex.h [moved from clang-tools-extra/include-fixer/YamlSymbolIndex.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/CMakeLists.txt [moved from clang-tools-extra/include-fixer/find-all-symbols/CMakeLists.txt with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllMacros.cpp [moved from clang-tools-extra/include-fixer/find-all-symbols/FindAllMacros.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllMacros.h [moved from clang-tools-extra/include-fixer/find-all-symbols/FindAllMacros.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllSymbols.cpp [moved from clang-tools-extra/include-fixer/find-all-symbols/FindAllSymbols.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllSymbols.h [moved from clang-tools-extra/include-fixer/find-all-symbols/FindAllSymbols.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllSymbolsAction.cpp [moved from clang-tools-extra/include-fixer/find-all-symbols/FindAllSymbolsAction.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/FindAllSymbolsAction.h [moved from clang-tools-extra/include-fixer/find-all-symbols/FindAllSymbolsAction.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/HeaderMapCollector.cpp [moved from clang-tools-extra/include-fixer/find-all-symbols/HeaderMapCollector.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/HeaderMapCollector.h [moved from clang-tools-extra/include-fixer/find-all-symbols/HeaderMapCollector.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/PathConfig.cpp [moved from clang-tools-extra/include-fixer/find-all-symbols/PathConfig.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/PathConfig.h [moved from clang-tools-extra/include-fixer/find-all-symbols/PathConfig.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/PragmaCommentHandler.cpp [moved from clang-tools-extra/include-fixer/find-all-symbols/PragmaCommentHandler.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/PragmaCommentHandler.h [moved from clang-tools-extra/include-fixer/find-all-symbols/PragmaCommentHandler.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp [moved from clang-tools-extra/include-fixer/find-all-symbols/STLPostfixHeaderMap.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/STLPostfixHeaderMap.h [moved from clang-tools-extra/include-fixer/find-all-symbols/STLPostfixHeaderMap.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolInfo.cpp [moved from clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolInfo.h [moved from clang-tools-extra/include-fixer/find-all-symbols/SymbolInfo.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/SymbolReporter.h [moved from clang-tools-extra/include-fixer/find-all-symbols/SymbolReporter.h with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/tool/CMakeLists.txt [moved from clang-tools-extra/include-fixer/find-all-symbols/tool/CMakeLists.txt with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp [moved from clang-tools-extra/include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py [moved from clang-tools-extra/include-fixer/find-all-symbols/tool/run-find-all-symbols.py with 100% similarity]
clang-tools-extra/clang-include-fixer/plugin/CMakeLists.txt [moved from clang-tools-extra/include-fixer/plugin/CMakeLists.txt with 100% similarity]
clang-tools-extra/clang-include-fixer/plugin/IncludeFixerPlugin.cpp [moved from clang-tools-extra/include-fixer/plugin/IncludeFixerPlugin.cpp with 100% similarity]
clang-tools-extra/clang-include-fixer/tool/CMakeLists.txt [moved from clang-tools-extra/include-fixer/tool/CMakeLists.txt with 100% similarity]
clang-tools-extra/clang-include-fixer/tool/ClangIncludeFixer.cpp [moved from clang-tools-extra/include-fixer/tool/ClangIncludeFixer.cpp with 97% similarity]
clang-tools-extra/clang-include-fixer/tool/clang-include-fixer-test.el [moved from clang-tools-extra/include-fixer/tool/clang-include-fixer-test.el with 100% similarity]
clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.el [moved from clang-tools-extra/include-fixer/tool/clang-include-fixer.el with 99% similarity]
clang-tools-extra/clang-include-fixer/tool/clang-include-fixer.py [moved from clang-tools-extra/include-fixer/tool/clang-include-fixer.py with 95% similarity]
clang-tools-extra/clang-move/Move.cpp
clang-tools-extra/clang-tidy/add_new_check.py
clang-tools-extra/docs/ReleaseNotes.rst
clang-tools-extra/docs/clang-include-fixer.rst [moved from clang-tools-extra/docs/include-fixer.rst with 96% similarity]
clang-tools-extra/docs/doxygen.cfg.in
clang-tools-extra/docs/index.rst
clang-tools-extra/test/clang-include-fixer/Inputs/database_template.json [moved from clang-tools-extra/test/include-fixer/Inputs/database_template.json with 100% similarity]
clang-tools-extra/test/clang-include-fixer/Inputs/fake_yaml_db.yaml [moved from clang-tools-extra/test/include-fixer/Inputs/fake_yaml_db.yaml with 96% similarity]
clang-tools-extra/test/clang-include-fixer/Inputs/merge/a.yaml [moved from clang-tools-extra/test/include-fixer/Inputs/merge/a.yaml with 100% similarity]
clang-tools-extra/test/clang-include-fixer/Inputs/merge/b.yaml [moved from clang-tools-extra/test/include-fixer/Inputs/merge/b.yaml with 100% similarity]
clang-tools-extra/test/clang-include-fixer/commandline_options.cpp [moved from clang-tools-extra/test/include-fixer/commandline_options.cpp with 100% similarity]
clang-tools-extra/test/clang-include-fixer/exit_on_fatal.cpp [moved from clang-tools-extra/test/include-fixer/exit_on_fatal.cpp with 100% similarity]
clang-tools-extra/test/clang-include-fixer/fixeddb.cpp [moved from clang-tools-extra/test/include-fixer/fixeddb.cpp with 100% similarity]
clang-tools-extra/test/clang-include-fixer/include_path.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-include-fixer/merge.test [moved from clang-tools-extra/test/include-fixer/merge.test with 100% similarity]
clang-tools-extra/test/clang-include-fixer/multiple_fixes.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-include-fixer/prefix_variable.cpp [moved from clang-tools-extra/test/include-fixer/prefix_variable.cpp with 100% similarity]
clang-tools-extra/test/clang-include-fixer/query_symbol.cpp [moved from clang-tools-extra/test/include-fixer/query_symbol.cpp with 100% similarity]
clang-tools-extra/test/clang-include-fixer/ranking.cpp [moved from clang-tools-extra/test/include-fixer/ranking.cpp with 89% similarity]
clang-tools-extra/test/clang-include-fixer/yaml_fuzzy.cpp [moved from clang-tools-extra/test/include-fixer/yaml_fuzzy.cpp with 74% similarity]
clang-tools-extra/test/clang-include-fixer/yamldb.cpp [moved from clang-tools-extra/test/include-fixer/yamldb.cpp with 100% similarity]
clang-tools-extra/test/clang-include-fixer/yamldb_autodetect.cpp [moved from clang-tools-extra/test/include-fixer/yamldb_autodetect.cpp with 100% similarity]
clang-tools-extra/test/include-fixer/include_path.cpp [deleted file]
clang-tools-extra/test/include-fixer/multiple_fixes.cpp [deleted file]
clang-tools-extra/unittests/CMakeLists.txt
clang-tools-extra/unittests/clang-include-fixer/CMakeLists.txt [moved from clang-tools-extra/unittests/include-fixer/CMakeLists.txt with 89% similarity]
clang-tools-extra/unittests/clang-include-fixer/FuzzySymbolIndexTests.cpp [moved from clang-tools-extra/unittests/include-fixer/FuzzySymbolIndexTests.cpp with 100% similarity]
clang-tools-extra/unittests/clang-include-fixer/IncludeFixerTest.cpp [moved from clang-tools-extra/unittests/include-fixer/IncludeFixerTest.cpp with 99% similarity]
clang-tools-extra/unittests/clang-include-fixer/find-all-symbols/CMakeLists.txt [moved from clang-tools-extra/unittests/include-fixer/find-all-symbols/CMakeLists.txt with 82% similarity]
clang-tools-extra/unittests/clang-include-fixer/find-all-symbols/FindAllSymbolsTests.cpp [moved from clang-tools-extra/unittests/include-fixer/find-all-symbols/FindAllSymbolsTests.cpp with 100% similarity]

index bb45333..66ebeae 100644 (file)
@@ -11,10 +11,10 @@ add_subdirectory(clang-tidy-vs)
 
 add_subdirectory(clang-change-namespace)
 add_subdirectory(clang-doc)
-add_subdirectory(clang-query)
+add_subdirectory(clang-include-fixer)
 add_subdirectory(clang-move)
+add_subdirectory(clang-query)
 add_subdirectory(clangd)
-add_subdirectory(include-fixer)
 add_subdirectory(pp-trace)
 add_subdirectory(tool-template)
 
@@ -31,7 +31,7 @@ namespace include_fixer {
 // Implementations may choose to truncate results, refuse short queries, etc.
 class FuzzySymbolIndex : public SymbolIndex {
 public:
-  // Loads the specified include-fixer database and returns an index serving it.
+  // Loads the specified clang-include-fixer database and returns an index serving it.
   static llvm::Expected<std::unique_ptr<FuzzySymbolIndex>>
   createFromYAML(llvm::StringRef File);
 
@@ -16,7 +16,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/raw_ostream.h"
 
-#define DEBUG_TYPE "include-fixer"
+#define DEBUG_TYPE "clang-include-fixer"
 
 using namespace clang;
 
@@ -348,8 +348,8 @@ IncludeFixerSemaSource::query(StringRef Query, StringRef ScopedQualifiers,
   //
   // We use conservative behavior for detecting the same unidentified symbol
   // here. The symbols which have the same ScopedQualifier and RawIdentifier
-  // are considered equal. So that include-fixer avoids false positives, and
-  // always adds missing qualifiers to correct symbols.
+  // are considered equal. So that clang-include-fixer avoids false positives,
+  // and always adds missing qualifiers to correct symbols.
   if (!GenerateDiagnostics && !QuerySymbolInfos.empty()) {
     if (ScopedQualifiers == QuerySymbolInfos.front().ScopedQualifiers &&
         Query == QuerySymbolInfos.front().RawIdentifier) {
@@ -67,7 +67,7 @@ private:
 ///
 /// \param Code The source code.
 /// \param Context The context which contains all information for creating
-/// include-fixer replacements.
+/// clang-include-fixer replacements.
 /// \param Style clang-format style being used.
 /// \param AddQualifiers  Whether we should add qualifiers to all instances of
 /// an unidentified symbol.
@@ -13,7 +13,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Path.h"
 
-#define DEBUG_TYPE "include-fixer"
+#define DEBUG_TYPE "clang-include-fixer"
 
 namespace clang {
 namespace include_fixer {
@@ -366,8 +366,8 @@ int includeFixerMain(int argc, const char **argv) {
     }
 
     // We leave an empty symbol range as we don't know the range of the symbol
-    // being queried in this mode. include-fixer won't add namespace qualifiers
-    // if the symbol range is empty, which also fits this case.
+    // being queried in this mode. clang-include-fixer won't add namespace
+    // qualifiers if the symbol range is empty, which also fits this case.
     IncludeFixerContext::QuerySymbolInfo Symbol;
     Symbol.RawIdentifier = QuerySymbol;
     auto Context =
@@ -383,9 +383,10 @@ int includeFixerMain(int argc, const char **argv) {
 
   if (tool.run(&Factory) != 0) {
     // We suppress all Clang diagnostics (because they would be wrong,
-    // include-fixer does custom recovery) but still want to give some feedback
-    // in case there was a compiler error we couldn't recover from. The most
-    // common case for this is a #include in the file that couldn't be found.
+    // clang-include-fixer does custom recovery) but still want to give some
+    // feedback in case there was a compiler error we couldn't recover from.
+    // The most common case for this is a #include in the file that couldn't be
+    // found.
     llvm::errs() << "Fatal compiler error occurred while parsing file!"
                     " (incorrect include paths?)\n";
     return 1;
@@ -8,7 +8,7 @@
 ;; This package allows Emacs users to invoke the 'clang-include-fixer' within
 ;; Emacs.  'clang-include-fixer' provides an automated way of adding #include
 ;; directives for missing symbols in one translation unit, see
-;; <http://clang.llvm.org/extra/include-fixer.html>.
+;; <http://clang.llvm.org/extra/clang-include-fixer.html>.
 
 ;;; Code:
 
@@ -243,7 +243,7 @@ return nil.  Buffer restrictions are ignored."
                         t))))))))))))
 
 (defun clang-include-fixer--add-header (stdout)
-  "Analyse the result of include-fixer stored in STDOUT.
+  "Analyse the result of clang-include-fixer stored in STDOUT.
 Add a missing header if there is any.  If there are multiple
 possible headers the user can select one of them to be included.
 Temporarily highlight the affected symbols.  Asynchronously call
@@ -317,7 +317,7 @@ They are replaced by the single element selected by the user."
             (when overlays
               (goto-char (clang-include-fixer--closest-overlay overlays)))
             (cl-flet ((header (info) (let-alist info .Header)))
-              ;; The header-infos is already sorted by include-fixer.
+              ;; The header-infos is already sorted by clang-include-fixer.
               (let* ((headers (mapcar #'header .HeaderInfos))
                      (header (completing-read
                               (clang-include-fixer--format-message
@@ -2,12 +2,14 @@
 # - Change 'binary' if clang-include-fixer is not on the path (see below).
 # - Add to your .vimrc:
 #
-#   noremap <leader>cf :pyf path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/clang-include-fixer.py<cr>
+#   noremap <leader>cf :pyf path/to/llvm/source/tools/clang/tools/extra/clang-include-fixer/tool/clang-include-fixer.py<cr>
 #
-# This enables clang-include-fixer for NORMAL and VISUAL mode. Change "<leader>cf"
-# to another binding if you need clang-include-fixer on a different key.
+# This enables clang-include-fixer for NORMAL and VISUAL mode. Change
+# "<leader>cf" to another binding if you need clang-include-fixer on a
+# different key.
 #
-# To set up clang-include-fixer, see http://clang.llvm.org/extra/include-fixer.html
+# To set up clang-include-fixer, see
+# http://clang.llvm.org/extra/clang-include-fixer.html
 #
 # With this integration you can press the bound key and clang-include-fixer will
 # be run on the current buffer.
@@ -76,7 +78,7 @@ def GetUserSelection(message, headers, maximum_suggested_headers):
         raise Exception()
     except Exception:
       # Show a new prompt on invalid option instead of aborting so that users
-      # don't need to wait for another include-fixer run.
+      # don't need to wait for another clang-include-fixer run.
       print >> sys.stderr, "Invalid option:", res
       return GetUserSelection(message, headers, maximum_suggested_headers)
   return headers[idx - 1]
@@ -170,7 +172,7 @@ def main():
     print "The file is fine, no need to add a header."
     return
   symbol = query_symbol_infos[0]["RawIdentifier"]
-  # The header_infos is already sorted by include-fixer.
+  # The header_infos is already sorted by clang-include-fixer.
   header_infos = include_fixer_context["HeaderInfos"]
   # Deduplicate headers while keeping the order, so that the same header would
   # not be suggested twice.
index 9b69b88..8c56861 100644 (file)
@@ -765,7 +765,7 @@ void ClangMoveTool::removeDeclsInOldFiles() {
     if (Context->Spec.OldDependOnNew &&
         MakeAbsolutePath(SM, FilePath) ==
             makeAbsolutePath(Context->Spec.OldHeader)) {
-      // FIXME: Minimize the include path like include-fixer.
+      // FIXME: Minimize the include path like clang-include-fixer.
       std::string IncludeNewH =
           "#include \"" + Context->Spec.NewHeader + "\"\n";
       // This replacment for inserting header will be cleaned up at the end.
index 898392b..839bd4d 100755 (executable)
@@ -198,7 +198,7 @@ def add_release_notes(module_path, module, check_name):
     lines = f.readlines()
 
   lineMatcher = re.compile('Improvements to clang-tidy')
-  nextSectionMatcher = re.compile('Improvements to include-fixer')
+  nextSectionMatcher = re.compile('Improvements to clang-include-fixer')
   checkerMatcher = re.compile('- New :doc:`(.*)')
 
   print('Updating %s...' % filename)
index fa473d7..07eab64 100644 (file)
@@ -143,7 +143,7 @@ Improvements to clang-tidy
   but either don't specify it or the clause is specified but with the kind
   other than ``none``, and suggests to use the ``default(none)`` clause.
 
-Improvements to include-fixer
+Improvements to clang-include-fixer
 -----------------------------
 
 The improvements are...
similarity index 96%
rename from clang-tools-extra/docs/include-fixer.rst
rename to clang-tools-extra/docs/clang-include-fixer.rst
index 9898840..783f45e 100644 (file)
@@ -49,7 +49,7 @@ database for LLVM, any project built by CMake should follow similar steps.
   $ ninja clang-include-fixer // build clang-include-fixer tool.
   $ ls compile_commands.json # Make sure compile_commands.json exists.
     compile_commands.json
-  $ path/to/llvm/source/tools/clang/tools/extra/include-fixer/find-all-symbols/tool/run-find-all-symbols.py
+  $ path/to/llvm/source/tools/clang/tools/extra/clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
     ... wait as clang indexes the code base ...
   $ ln -s $PWD/find_all_symbols_db.yaml path/to/llvm/source/ # Link database into the source tree.
   $ ln -s $PWD/compile_commands.json path/to/llvm/source/ # Also link compilation database if it's not there already.
@@ -64,7 +64,7 @@ following key binding to your ``.vimrc``:
 
 .. code-block:: console
 
-  noremap <leader>cf :pyf path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/clang-include-fixer.py<cr>
+  noremap <leader>cf :pyf path/to/llvm/source/tools/clang/tools/extra/clang-include-fixer/tool/clang-include-fixer.py<cr>
 
 This enables `clang-include-fixer` for NORMAL and VISUAL mode. Change
 `<leader>cf` to another binding if you need clang-include-fixer on a different
@@ -118,7 +118,7 @@ in your ``.emacs``:
 
 .. code-block:: console
 
- (add-to-list 'load-path "path/to/llvm/source/tools/clang/tools/extra/include-fixer/tool/"
+ (add-to-list 'load-path "path/to/llvm/source/tools/clang/tools/extra/clang-include-fixer/tool/"
  (require 'clang-include-fixer)
 
 Within Emacs the tool can be invoked with the command
index 8809588..fd77fc4 100644 (file)
@@ -752,7 +752,7 @@ INPUT                  =  \
                           @abs_srcdir@/../clang-reorder-fields \
                           @abs_srcdir@/../clang-tidy \
                           @abs_srcdir@/../clangd \
-                          @abs_srcdir@/../include-fixer \
+                          @abs_srcdir@/../clang-include-fixer \
                           @abs_srcdir@/../modularize \
                           @abs_srcdir@/../pp-trace \
                           @abs_srcdir@/../tool-template \
index 86ba5cb..0fe9895 100644 (file)
@@ -16,7 +16,7 @@ Contents
    :maxdepth: 2
 
    clang-tidy/index
-   include-fixer
+   clang-include-fixer
    modularize
    pp-trace
    clang-rename
@@ -65,7 +65,7 @@ Name:            bar
 Contexts:
   - ContextType:    Namespace
     ContextName:    c
-FilePath:        test/include-fixer/baz.h
+FilePath:        test/clang-include-fixer/baz.h
 Type:            Class
 Seen:            1
 Used:            0
diff --git a/clang-tools-extra/test/clang-include-fixer/include_path.cpp b/clang-tools-extra/test/clang-include-fixer/include_path.cpp
new file mode 100644 (file)
index 0000000..9185b7a
--- /dev/null
@@ -0,0 +1,19 @@
+// RUN: mkdir -p %T/clang-include-fixer/include
+// RUN: mkdir -p %T/clang-include-fixer/symbols
+// RUN: mkdir -p %T/clang-include-fixer/build
+// RUN: mkdir -p %T/clang-include-fixer/src
+// RUN: sed 's|test_dir|%/T/clang-include-fixer|g' %S/Inputs/database_template.json > %T/clang-include-fixer/build/compile_commands.json
+// RUN: echo -e '#include "bar.h"\nb::a::bar f;' > %T/clang-include-fixer/src/bar.cpp
+// RUN: echo 'namespace b { namespace a { class bar {}; } }' > %T/clang-include-fixer/include/bar.h
+// RUN: cd %T/clang-include-fixer/build
+// RUN: find-all-symbols -output-dir=%T/clang-include-fixer/symbols -p=. %T/clang-include-fixer/src/bar.cpp
+// RUN: find-all-symbols -merge-dir=%T/clang-include-fixer/symbols %T/clang-include-fixer/build/find_all_symbols.yaml
+// RUN: FileCheck -input-file=%T/clang-include-fixer/build/find_all_symbols.yaml -check-prefix=CHECK-YAML %s
+//
+// RUN: echo 'b::a::bar f;' > %T/clang-include-fixer/src/bar.cpp
+// RUN: clang-include-fixer -db=yaml -input=%T/clang-include-fixer/build/find_all_symbols.yaml -minimize-paths=true -p=. %T/clang-include-fixer/src/bar.cpp
+// RUN: FileCheck -input-file=%T/clang-include-fixer/src/bar.cpp %s
+
+// CHECK-YAML: ..{{[/\\]}}include{{[/\\]}}bar.h
+// CHECK: #include "bar.h"
+// CHECK: b::a::bar f;
diff --git a/clang-tools-extra/test/clang-include-fixer/multiple_fixes.cpp b/clang-tools-extra/test/clang-include-fixer/multiple_fixes.cpp
new file mode 100644 (file)
index 0000000..791417a
--- /dev/null
@@ -0,0 +1,13 @@
+// REQUIRES: shell
+// RUN: sed -e 's#//.*$##' %s > %t.cpp
+// RUN: mkdir -p %T/clang-include-fixer/multiple-fixes
+// RUN: echo 'foo f;' > %T/clang-include-fixer/multiple-fixes/foo.cpp
+// RUN: echo 'bar b;' > %T/clang-include-fixer/multiple-fixes/bar.cpp
+// RUN: clang-include-fixer -db=fixed -input='foo= "foo.h";bar= "bar.h"' %T/clang-include-fixer/multiple-fixes/*.cpp --
+// RUN: FileCheck -input-file=%T/clang-include-fixer/multiple-fixes/bar.cpp %s -check-prefix=CHECK-BAR
+// RUN: FileCheck -input-file=%T/clang-include-fixer/multiple-fixes/foo.cpp %s -check-prefix=CHECK-FOO
+//
+// CHECK-FOO: #include "foo.h"
+// CHECK-FOO: foo f;
+// CHECK-BAR: #include "bar.h"
+// CHECK-BAR: bar b;
@@ -2,7 +2,7 @@
 // RUN: clang-include-fixer -query-symbol bar -db=yaml -input=%S/Inputs/fake_yaml_db.yaml -output-headers %s -- | FileCheck %s
 
 // CHECK:     "HeaderInfos": [
-// CHECK-NEXT:  {"Header": "\"test/include-fixer/baz.h\"",
+// CHECK-NEXT:  {"Header": "\"test/clang-include-fixer/baz.h\"",
 // CHECK-NEXT:   "QualifiedName": "c::bar"},
 // CHECK-NEXT:  {"Header": "\"../include/bar.h\"",
 // CHECK-NEXT:   "QualifiedName": "b::a::bar"},
@@ -2,7 +2,7 @@
 // RUN: clang-include-fixer -db=fuzzyYaml -input=%p/Inputs/fake_yaml_db.yaml %t.cpp --
 // RUN: FileCheck %s -input-file=%t.cpp
 
-// include-fixer will add the include, but doesn't complete the symbol.
+// clang-include-fixer will add the include, but doesn't complete the symbol.
 // CHECK: #include "foobar.h"
 // CHECK: fba f;
 
diff --git a/clang-tools-extra/test/include-fixer/include_path.cpp b/clang-tools-extra/test/include-fixer/include_path.cpp
deleted file mode 100644 (file)
index 28b6ace..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-// RUN: mkdir -p %T/include-fixer/include
-// RUN: mkdir -p %T/include-fixer/symbols
-// RUN: mkdir -p %T/include-fixer/build
-// RUN: mkdir -p %T/include-fixer/src
-// RUN: sed 's|test_dir|%/T/include-fixer|g' %S/Inputs/database_template.json > %T/include-fixer/build/compile_commands.json
-// RUN: echo -e '#include "bar.h"\nb::a::bar f;' > %T/include-fixer/src/bar.cpp
-// RUN: echo 'namespace b { namespace a { class bar {}; } }' > %T/include-fixer/include/bar.h
-// RUN: cd %T/include-fixer/build
-// RUN: find-all-symbols -output-dir=%T/include-fixer/symbols -p=. %T/include-fixer/src/bar.cpp
-// RUN: find-all-symbols -merge-dir=%T/include-fixer/symbols %T/include-fixer/build/find_all_symbols.yaml
-// RUN: FileCheck -input-file=%T/include-fixer/build/find_all_symbols.yaml -check-prefix=CHECK-YAML %s
-//
-// RUN: echo 'b::a::bar f;' > %T/include-fixer/src/bar.cpp
-// RUN: clang-include-fixer -db=yaml -input=%T/include-fixer/build/find_all_symbols.yaml -minimize-paths=true -p=. %T/include-fixer/src/bar.cpp
-// RUN: FileCheck -input-file=%T/include-fixer/src/bar.cpp %s
-
-// CHECK-YAML: ..{{[/\\]}}include{{[/\\]}}bar.h
-// CHECK: #include "bar.h"
-// CHECK: b::a::bar f;
diff --git a/clang-tools-extra/test/include-fixer/multiple_fixes.cpp b/clang-tools-extra/test/include-fixer/multiple_fixes.cpp
deleted file mode 100644 (file)
index 35a73b4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-// REQUIRES: shell
-// RUN: sed -e 's#//.*$##' %s > %t.cpp
-// RUN: mkdir -p %T/include-fixer/multiple-fixes
-// RUN: echo 'foo f;' > %T/include-fixer/multiple-fixes/foo.cpp
-// RUN: echo 'bar b;' > %T/include-fixer/multiple-fixes/bar.cpp
-// RUN: clang-include-fixer -db=fixed -input='foo= "foo.h";bar= "bar.h"' %T/include-fixer/multiple-fixes/*.cpp --
-// RUN: FileCheck -input-file=%T/include-fixer/multiple-fixes/bar.cpp %s -check-prefix=CHECK-BAR
-// RUN: FileCheck -input-file=%T/include-fixer/multiple-fixes/foo.cpp %s -check-prefix=CHECK-FOO
-//
-// CHECK-FOO: #include "foo.h"
-// CHECK-FOO: foo f;
-// CHECK-BAR: #include "bar.h"
-// CHECK-BAR: bar b;
index 4008737..ce6e665 100644 (file)
@@ -17,8 +17,8 @@ endif()
 add_subdirectory(clang-apply-replacements)
 add_subdirectory(clang-change-namespace)
 add_subdirectory(clang-doc)
+add_subdirectory(clang-include-fixer)
 add_subdirectory(clang-move)
 add_subdirectory(clang-query)
 add_subdirectory(clang-tidy)
 add_subdirectory(clangd)
-add_subdirectory(include-fixer)
@@ -3,7 +3,7 @@ set(LLVM_LINK_COMPONENTS
   )
 
 get_filename_component(INCLUDE_FIXER_SOURCE_DIR
-  ${CMAKE_CURRENT_SOURCE_DIR}/../../include-fixer REALPATH)
+  ${CMAKE_CURRENT_SOURCE_DIR}/../../clang-include-fixer REALPATH)
 include_directories(
   ${INCLUDE_FIXER_SOURCE_DIR}
   )
@@ -178,7 +178,7 @@ TEST(IncludeFixer, NestedName) {
   EXPECT_EQ("#define FOO(x) a::##x\nint x = FOO(b::foo);\n",
             runIncludeFixer("#define FOO(x) a::##x\nint x = FOO(b::foo);\n"));
 
-  // The empty namespace is cleaned up by clang-format after include-fixer
+  // The empty namespace is cleaned up by clang-format after clang-include-fixer
   // finishes.
   EXPECT_EQ("#include \"dir/otherdir/qux.h\"\n"
             "\nint a = a::b::foo(0);\n",
@@ -227,7 +227,7 @@ TEST(IncludeFixer, IgnoreSymbolFromHeader) {
 }
 
 // FIXME: add test cases for inserting and sorting multiple headers when
-// include-fixer supports multiple headers insertion.
+// clang-include-fixer supports multiple headers insertion.
 TEST(IncludeFixer, InsertAndSortSingleHeader) {
   // Insert one header.
   std::string Code = "#include \"a.h\"\n"
@@ -3,7 +3,7 @@ set(LLVM_LINK_COMPONENTS
   )
 
 get_filename_component(INCLUDE_FIXER_SOURCE_DIR
-  ${CMAKE_CURRENT_SOURCE_DIR}/../../../include-fixer/find-all-symbols REALPATH)
+  ${CMAKE_CURRENT_SOURCE_DIR}/../../../clang-include-fixer/find-all-symbols REALPATH)
 include_directories(
   ${INCLUDE_FIXER_SOURCE_DIR}
   )