Skip to content

Commit

Permalink
Reland "Move #include manipulation code to new lib/Tooling/Inclusions."
Browse files Browse the repository at this point in the history
This reverts commit r333534 (i.e. reland r332720) after fixing module build.

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

llvm-svn: 333874
  • Loading branch information
Eric Liu committed Jun 4, 2018
1 parent d0a6f6a commit 44564ac
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 15 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/Format/Format.h
Expand Up @@ -16,8 +16,8 @@
#define LLVM_CLANG_FORMAT_FORMAT_H

#include "clang/Basic/LangOptions.h"
#include "clang/Tooling/Core/IncludeStyle.h"
#include "clang/Tooling/Core/Replacement.h"
#include "clang/Tooling/Inclusions/IncludeStyle.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/Regex.h"
#include <system_error>
Expand Down
Expand Up @@ -7,12 +7,12 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
#define LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
#ifndef LLVM_CLANG_TOOLING_INCLUSIONS_HEADERINCLUDES_H
#define LLVM_CLANG_TOOLING_INCLUSIONS_HEADERINCLUDES_H

#include "clang/Basic/SourceManager.h"
#include "clang/Tooling/Core/Replacement.h"
#include "clang/Tooling/Core/IncludeStyle.h"
#include "clang/Tooling/Inclusions/IncludeStyle.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/Regex.h"
#include <unordered_map>
Expand Down Expand Up @@ -134,4 +134,4 @@ class HeaderIncludes {
} // namespace tooling
} // namespace clang

#endif // LLVM_CLANG_TOOLING_CORE_HEADERINCLUDES_H
#endif // LLVM_CLANG_TOOLING_INCLUSIONS_HEADERINCLUDES_H
Expand Up @@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_TOOLING_CORE_INCLUDESTYLE_H
#define LLVM_CLANG_TOOLING_CORE_INCLUDESTYLE_H
#ifndef LLVM_CLANG_TOOLING_INCLUSIONS_INCLUDESTYLE_H
#define LLVM_CLANG_TOOLING_INCLUSIONS_INCLUDESTYLE_H

#include "llvm/Support/YAMLTraits.h"
#include <string>
Expand Down Expand Up @@ -130,4 +130,4 @@ struct ScalarEnumerationTraits<
} // namespace yaml
} // namespace llvm

#endif // LLVM_CLANG_TOOLING_CORE_INCLUDESTYLE_H
#endif // LLVM_CLANG_TOOLING_INCLUSIONS_INCLUDESTYLE_H
5 changes: 5 additions & 0 deletions clang/include/clang/module.modulemap
Expand Up @@ -154,3 +154,8 @@ module Clang_ToolingCore {
requires cplusplus
umbrella "Tooling/Core" module * { export * }
}

module Clang_ToolingInclusions {
requires cplusplus
umbrella "Tooling/Inclusions" module * { export * }
}
1 change: 1 addition & 0 deletions clang/lib/Format/CMakeLists.txt
Expand Up @@ -20,4 +20,5 @@ add_clang_library(clangFormat
clangBasic
clangLex
clangToolingCore
clangToolingInclusions
)
2 changes: 1 addition & 1 deletion clang/lib/Format/Format.cpp
Expand Up @@ -31,7 +31,7 @@
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/VirtualFileSystem.h"
#include "clang/Lex/Lexer.h"
#include "clang/Tooling/Core/HeaderIncludes.h"
#include "clang/Tooling/Inclusions/HeaderIncludes.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Allocator.h"
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Tooling/CMakeLists.txt
Expand Up @@ -4,6 +4,7 @@ set(LLVM_LINK_COMPONENTS
)

add_subdirectory(Core)
add_subdirectory(Inclusions)
add_subdirectory(Refactoring)
add_subdirectory(ASTDiff)

Expand Down
2 changes: 0 additions & 2 deletions clang/lib/Tooling/Core/CMakeLists.txt
Expand Up @@ -2,8 +2,6 @@ set(LLVM_LINK_COMPONENTS support)

add_clang_library(clangToolingCore
Diagnostic.cpp
HeaderIncludes.cpp
IncludeStyle.cpp
Lookup.cpp
Replacement.cpp

Expand Down
12 changes: 12 additions & 0 deletions clang/lib/Tooling/Inclusions/CMakeLists.txt
@@ -0,0 +1,12 @@
set(LLVM_LINK_COMPONENTS support)

add_clang_library(clangToolingInclusions
HeaderIncludes.cpp
IncludeStyle.cpp

LINK_LIBS
clangBasic
clangLex
clangRewrite
clangToolingCore
)
Expand Up @@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//

#include "clang/Tooling/Core/HeaderIncludes.h"
#include "clang/Tooling/Inclusions/HeaderIncludes.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"

Expand Down
Expand Up @@ -7,8 +7,7 @@
//
//===----------------------------------------------------------------------===//

#include "clang/Tooling/Core/IncludeStyle.h"

#include "clang/Tooling/Inclusions/IncludeStyle.h"

using clang::tooling::IncludeStyle;

Expand Down
2 changes: 1 addition & 1 deletion clang/unittests/Tooling/HeaderIncludesTest.cpp
Expand Up @@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//

#include "clang/Tooling/Core/HeaderIncludes.h"
#include "clang/Tooling/Inclusions/HeaderIncludes.h"
#include "../Tooling/ReplacementTest.h"
#include "../Tooling/RewriterTestContext.h"
#include "clang/Format/Format.h"
Expand Down

0 comments on commit 44564ac

Please sign in to comment.