rupprecht updated this revision to Diff 488366.
rupprecht added a comment.
Herald added subscribers: cfe-commits, kadircet, arphaman, hiraditya.
Herald added projects: clang, clang-tools-extra.
- Move annotations to a separate package entirely
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141175/new/
https://reviews.llvm.org/D141175
Files:
clang-tools-extra/clangd/unittests/Annotations.h
clang-tools-extra/clangd/unittests/CMakeLists.txt
clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
clang-tools-extra/clangd/unittests/FindTargetTests.cpp
clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
clang-tools-extra/clangd/unittests/tweaks/TweakTesting.h
clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp
clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
clang-tools-extra/include-cleaner/unittests/LocateSymbolTest.cpp
clang-tools-extra/include-cleaner/unittests/RecordTest.cpp
clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp
clang-tools-extra/pseudo/unittests/BracketTest.cpp
clang-tools-extra/pseudo/unittests/CMakeLists.txt
clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
clang/docs/tools/clang-formatted-files.txt
clang/unittests/AST/CMakeLists.txt
clang/unittests/AST/DeclTest.cpp
clang/unittests/AST/SourceLocationTest.cpp
clang/unittests/Analysis/FlowSensitive/CMakeLists.txt
clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp
clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp
clang/unittests/Analysis/FlowSensitive/TestingSupport.h
clang/unittests/Analysis/FlowSensitive/TransferBranchTest.cpp
clang/unittests/Sema/CMakeLists.txt
clang/unittests/Sema/CodeCompleteTest.cpp
clang/unittests/Tooling/CMakeLists.txt
clang/unittests/Tooling/SourceCodeTest.cpp
clang/unittests/Tooling/Syntax/CMakeLists.txt
clang/unittests/Tooling/Syntax/TokensTest.cpp
clang/unittests/Tooling/Syntax/TreeTestBase.cpp
clang/unittests/Tooling/Syntax/TreeTestBase.h
llvm/include/llvm/Testing/Annotations/Annotations.h
llvm/include/llvm/Testing/Support/Annotations.h
llvm/lib/Testing/Annotations/Annotations.cpp
llvm/lib/Testing/Annotations/CMakeLists.txt
llvm/lib/Testing/CMakeLists.txt
llvm/lib/Testing/Support/Annotations.cpp
llvm/lib/Testing/Support/CMakeLists.txt
llvm/unittests/Support/AnnotationsTest.cpp
llvm/unittests/Support/CMakeLists.txt
llvm/unittests/Testing/Annotations/AnnotationsTest.cpp
llvm/unittests/Testing/Annotations/CMakeLists.txt
llvm/unittests/Testing/CMakeLists.txt
utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
Index: utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
===================================================================
--- utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
+++ utils/bazel/llvm-project-overlay/llvm/BUILD.bazel
@@ -4450,18 +4450,27 @@
"lib/Testing/Support/*.cpp",
"lib/Testing/Support/*.h",
]),
- hdrs = glob([
- "include/llvm/Testing/Support/*.h",
- ]),
+ hdrs = glob(["include/llvm/Testing/Support/*.h"]),
copts = llvm_copts,
deps = [
":Support",
+ ":TestingAnnotations",
":config",
"//third-party/unittest:gmock",
"//third-party/unittest:gtest",
],
)
+# Split out of TestingSupport to allow using this with a different gmock/gtest version.
+cc_library(
+ name = "TestingAnnotations",
+ testonly = True,
+ srcs = ["lib/Testing/Annotations/Annotations.cpp"],
+ hdrs = ["include/llvm/Testing/Annotations/Annotations.h"],
+ copts = llvm_copts,
+ deps = [":Support"],
+)
+
################################################################################
# Begin testonly binary utilities
Index: llvm/unittests/Testing/CMakeLists.txt
===================================================================
--- llvm/unittests/Testing/CMakeLists.txt
+++ llvm/unittests/Testing/CMakeLists.txt
@@ -1,2 +1,3 @@
add_subdirectory(ADT)
+add_subdirectory(Annotations)
add_subdirectory(Support)
Index: llvm/unittests/Testing/Annotations/CMakeLists.txt
===================================================================
--- /dev/null
+++ llvm/unittests/Testing/Annotations/CMakeLists.txt
@@ -0,0 +1,10 @@
+set(LLVM_LINK_COMPONENTS
+ Support
+ TestingAnnotations
+ )
+
+add_llvm_unittest(TestingAnnotationTests
+ AnnotationsTest.cpp
+ )
+
+target_link_libraries(TestingAnnotationTests PRIVATE LLVMTestingAnnotations)
Index: llvm/unittests/Testing/Annotations/AnnotationsTest.cpp
===================================================================
--- llvm/unittests/Testing/Annotations/AnnotationsTest.cpp
+++ llvm/unittests/Testing/Annotations/AnnotationsTest.cpp
@@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
Index: llvm/unittests/Support/CMakeLists.txt
===================================================================
--- llvm/unittests/Support/CMakeLists.txt
+++ llvm/unittests/Support/CMakeLists.txt
@@ -8,7 +8,6 @@
AlignmentTest.cpp
AlignOfTest.cpp
AllocatorTest.cpp
- AnnotationsTest.cpp
ARMAttributeParser.cpp
ArrayRecyclerTest.cpp
Base64Test.cpp
Index: llvm/lib/Testing/Support/CMakeLists.txt
===================================================================
--- llvm/lib/Testing/Support/CMakeLists.txt
+++ llvm/lib/Testing/Support/CMakeLists.txt
@@ -3,7 +3,6 @@
set(EXCLUDE_FROM_ALL ON)
add_llvm_library(LLVMTestingSupport
- Annotations.cpp
Error.cpp
SupportHelpers.cpp
Index: llvm/lib/Testing/CMakeLists.txt
===================================================================
--- llvm/lib/Testing/CMakeLists.txt
+++ llvm/lib/Testing/CMakeLists.txt
@@ -1 +1,2 @@
+add_subdirectory(Annotations)
add_subdirectory(Support)
Index: llvm/lib/Testing/Annotations/CMakeLists.txt
===================================================================
--- /dev/null
+++ llvm/lib/Testing/Annotations/CMakeLists.txt
@@ -0,0 +1,15 @@
+# Do not build unittest libraries automatically, they will be pulled in
+# by unittests if these are built.
+set(EXCLUDE_FROM_ALL ON)
+
+add_llvm_library(LLVMTestingAnnotations
+ Annotations.cpp
+
+ BUILDTREE_ONLY
+
+ ADDITIONAL_HEADER_DIRS
+ ${LLVM_MAIN_INCLUDE_DIR}/llvm/Testing/Support
+
+ LINK_COMPONENTS
+ Support
+ )
Index: llvm/lib/Testing/Annotations/Annotations.cpp
===================================================================
--- llvm/lib/Testing/Annotations/Annotations.cpp
+++ llvm/lib/Testing/Annotations/Annotations.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/FormatVariadic.h"
Index: llvm/include/llvm/Testing/Support/Annotations.h
===================================================================
--- /dev/null
+++ llvm/include/llvm/Testing/Support/Annotations.h
@@ -1,133 +0,0 @@
-//===--- Annotations.h - Annotated source code for tests ---------*- C++-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-#ifndef LLVM_TESTING_SUPPORT_ANNOTATIONS_H
-#define LLVM_TESTING_SUPPORT_ANNOTATIONS_H
-
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringMap.h"
-#include "llvm/ADT/StringRef.h"
-#include <tuple>
-#include <vector>
-
-namespace llvm {
-
-class raw_ostream;
-
-/// Annotations lets you mark points and ranges inside source code, for tests:
-///
-/// Annotations Example(R"cpp(
-/// int complete() { x.pri^ } // ^ indicates a point
-/// void err() { [["hello" == 42]]; } // [[this is a range]]
-/// $definition^class Foo{}; // points can be named: "definition"
-/// $(foo)^class Foo{}; // ...or have a payload: "foo"
-/// $definition(foo)^class Foo{}; // ...or both
-/// $fail(runtime)[[assert(false)]] // ranges can have names/payloads too
-/// )cpp");
-///
-/// StringRef Code = Example.code(); // annotations stripped.
-/// std::vector<size_t> PP = Example.points(); // all unnamed points
-/// size_t P = Example.point(); // there must be exactly one
-/// llvm::Range R = Example.range("fail"); // find named ranges
-///
-/// Points/ranges are coordinated into `code()` which is stripped of
-/// annotations.
-///
-/// Names consist of only alphanumeric characters or '_'.
-/// Payloads can contain any character expect '(' and ')'.
-///
-/// Ranges may be nested (and points can be inside ranges), but there's no way
-/// to define general overlapping ranges.
-///
-/// FIXME: the choice of the marking syntax makes it impossible to represent
-/// some of the C++ and Objective C constructs (including common ones
-/// like C++ attributes). We can fix this by:
-/// 1. introducing an escaping mechanism for the special characters,
-/// 2. making characters for marking points and ranges configurable,
-/// 3. changing the syntax to something less commonly used,
-/// 4. ...
-class Annotations {
-public:
- /// Two offsets pointing to a continuous substring. End is not included, i.e.
- /// represents a half-open range.
- struct Range {
- size_t Begin = 0;
- size_t End = 0;
-
- friend bool operator==(const Range &L, const Range &R) {
- return std::tie(L.Begin, L.End) == std::tie(R.Begin, R.End);
- }
- friend bool operator!=(const Range &L, const Range &R) { return !(L == R); }
- };
-
- /// Parses the annotations from Text. Crashes if it's malformed.
- Annotations(llvm::StringRef Text);
-
- /// The input text with all annotations stripped.
- /// All points and ranges are relative to this stripped text.
- llvm::StringRef code() const { return Code; }
-
- /// Returns the position of the point marked by ^ (or $name^) in the text.
- /// Crashes if there isn't exactly one.
- size_t point(llvm::StringRef Name = "") const;
- /// Returns the position of the point with \p Name and its payload (if any).
- std::pair<size_t, llvm::StringRef>
- pointWithPayload(llvm::StringRef Name = "") const;
- /// Returns the position of all points marked by ^ (or $name^) in the text.
- /// Order matches the order within the text.
- std::vector<size_t> points(llvm::StringRef Name = "") const;
- /// Returns the positions and payloads (if any) of all points named \p Name
- std::vector<std::pair<size_t, llvm::StringRef>>
- pointsWithPayload(llvm::StringRef Name = "") const;
- /// Returns the mapping of all names of points marked in the text to their
- /// position. Unnamed points are mapped to the empty string. The positions are
- /// sorted.
- /// FIXME Remove this and expose `All` directly (currently used out-of-tree)
- llvm::StringMap<llvm::SmallVector<size_t, 1>> all_points() const;
-
- /// Returns the location of the range marked by [[ ]] (or $name[[ ]]).
- /// Crashes if there isn't exactly one.
- Range range(llvm::StringRef Name = "") const;
- /// Returns the location and payload of the range marked by [[ ]]
- /// (or $name(payload)[[ ]]). Crashes if there isn't exactly one.
- std::pair<Range, llvm::StringRef>
- rangeWithPayload(llvm::StringRef Name = "") const;
- /// Returns the location of all ranges marked by [[ ]] (or $name[[ ]]).
- /// They are ordered by start position within the text.
- std::vector<Range> ranges(llvm::StringRef Name = "") const;
- /// Returns the location of all ranges marked by [[ ]]
- /// (or $name(payload)[[ ]]).
- /// They are ordered by start position within the text.
- std::vector<std::pair<Range, llvm::StringRef>>
- rangesWithPayload(llvm::StringRef Name = "") const;
- /// Returns the mapping of all names of ranges marked in the text to their
- /// location. Unnamed ranges are mapped to the empty string. The ranges are
- /// sorted by their start position.
- llvm::StringMap<llvm::SmallVector<Range, 1>> all_ranges() const;
-
-private:
- std::string Code;
- /// Either a Point (Only Start) or a Range (Start and End)
- struct Annotation {
- size_t Begin;
- size_t End = -1;
- bool isPoint() const { return End == size_t(-1); }
- llvm::StringRef Name;
- llvm::StringRef Payload;
- };
- std::vector<Annotation> All;
- // Values are the indices into All
- llvm::StringMap<llvm::SmallVector<size_t, 1>> Points;
- llvm::StringMap<llvm::SmallVector<size_t, 1>> Ranges;
-};
-
-llvm::raw_ostream &operator<<(llvm::raw_ostream &O,
- const llvm::Annotations::Range &R);
-
-} // namespace llvm
-
-#endif
Index: clang/unittests/Tooling/Syntax/TreeTestBase.h
===================================================================
--- clang/unittests/Tooling/Syntax/TreeTestBase.h
+++ clang/unittests/Tooling/Syntax/TreeTestBase.h
@@ -22,7 +22,7 @@
#include "clang/Tooling/Syntax/Tree.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ScopedPrinter.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
Index: clang/unittests/Tooling/Syntax/TreeTestBase.cpp
===================================================================
--- clang/unittests/Tooling/Syntax/TreeTestBase.cpp
+++ clang/unittests/Tooling/Syntax/TreeTestBase.cpp
@@ -28,7 +28,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Error.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gtest/gtest.h"
using namespace clang;
Index: clang/unittests/Tooling/Syntax/TokensTest.cpp
===================================================================
--- clang/unittests/Tooling/Syntax/TokensTest.cpp
+++ clang/unittests/Tooling/Syntax/TokensTest.cpp
@@ -37,7 +37,7 @@
#include "llvm/Support/VirtualFileSystem.h"
#include "llvm/Support/raw_os_ostream.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include <cassert>
#include <cstdlib>
Index: clang/unittests/Tooling/Syntax/CMakeLists.txt
===================================================================
--- clang/unittests/Tooling/Syntax/CMakeLists.txt
+++ clang/unittests/Tooling/Syntax/CMakeLists.txt
@@ -26,5 +26,6 @@
target_link_libraries(SyntaxTests
PRIVATE
clangTesting
+ LLVMTestingAnnotations
LLVMTestingSupport
)
Index: clang/unittests/Tooling/SourceCodeTest.cpp
===================================================================
--- clang/unittests/Tooling/SourceCodeTest.cpp
+++ clang/unittests/Tooling/SourceCodeTest.cpp
@@ -11,7 +11,7 @@
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Lex/Lexer.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/Error.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include <gmock/gmock.h>
Index: clang/unittests/Tooling/CMakeLists.txt
===================================================================
--- clang/unittests/Tooling/CMakeLists.txt
+++ clang/unittests/Tooling/CMakeLists.txt
@@ -90,6 +90,7 @@
target_link_libraries(ToolingTests
PRIVATE
+ LLVMTestingAnnotations
LLVMTestingSupport
clangTesting
)
Index: clang/unittests/Sema/CodeCompleteTest.cpp
===================================================================
--- clang/unittests/Sema/CodeCompleteTest.cpp
+++ clang/unittests/Sema/CodeCompleteTest.cpp
@@ -13,7 +13,7 @@
#include "clang/Sema/Sema.h"
#include "clang/Sema/SemaDiagnostic.h"
#include "clang/Tooling/Tooling.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <cstddef>
Index: clang/unittests/Sema/CMakeLists.txt
===================================================================
--- clang/unittests/Sema/CMakeLists.txt
+++ clang/unittests/Sema/CMakeLists.txt
@@ -25,5 +25,6 @@
target_link_libraries(SemaTests
PRIVATE
clangTesting
+ LLVMTestingAnnotations
LLVMTestingSupport
)
Index: clang/unittests/Analysis/FlowSensitive/TransferBranchTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/TransferBranchTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/TransferBranchTest.cpp
@@ -16,7 +16,7 @@
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/Error.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
Index: clang/unittests/Analysis/FlowSensitive/TestingSupport.h
===================================================================
--- clang/unittests/Analysis/FlowSensitive/TestingSupport.h
+++ clang/unittests/Analysis/FlowSensitive/TestingSupport.h
@@ -43,7 +43,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/Error.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
namespace clang {
namespace dataflow {
Index: clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp
+++ clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp
@@ -13,7 +13,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/Support/Error.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include <cassert>
#include <functional>
#include <memory>
Index: clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
@@ -28,7 +28,7 @@
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Error.h"
#include "llvm/Testing/ADT/StringMapEntry.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/Error.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
Index: clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp
===================================================================
--- clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp
+++ clang/unittests/Analysis/FlowSensitive/SignAnalysisTest.cpp
@@ -21,7 +21,7 @@
#include "clang/Analysis/FlowSensitive/DataflowAnalysis.h"
#include "clang/Analysis/FlowSensitive/NoopLattice.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/Error.h"
#include "gtest/gtest.h"
#include <memory>
Index: clang/unittests/Analysis/FlowSensitive/CMakeLists.txt
===================================================================
--- clang/unittests/Analysis/FlowSensitive/CMakeLists.txt
+++ clang/unittests/Analysis/FlowSensitive/CMakeLists.txt
@@ -41,5 +41,6 @@
target_link_libraries(ClangAnalysisFlowSensitiveTests
PRIVATE
clangTesting
+ LLVMTestingAnnotations
LLVMTestingSupport
)
Index: clang/unittests/AST/SourceLocationTest.cpp
===================================================================
--- clang/unittests/AST/SourceLocationTest.cpp
+++ clang/unittests/AST/SourceLocationTest.cpp
@@ -20,7 +20,7 @@
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Tooling/Tooling.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gtest/gtest.h"
using namespace clang;
Index: clang/unittests/AST/DeclTest.cpp
===================================================================
--- clang/unittests/AST/DeclTest.cpp
+++ clang/unittests/AST/DeclTest.cpp
@@ -20,7 +20,7 @@
#include "clang/Lex/Lexer.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/IR/DataLayout.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gtest/gtest.h"
using namespace clang::ast_matchers;
Index: clang/unittests/AST/CMakeLists.txt
===================================================================
--- clang/unittests/AST/CMakeLists.txt
+++ clang/unittests/AST/CMakeLists.txt
@@ -50,5 +50,6 @@
target_link_libraries(ASTTests
PRIVATE
clangTesting
+ LLVMTestingAnnotations
LLVMTestingSupport
)
Index: clang/docs/tools/clang-formatted-files.txt
===================================================================
--- clang/docs/tools/clang-formatted-files.txt
+++ clang/docs/tools/clang-formatted-files.txt
@@ -5536,7 +5536,7 @@
llvm/include/llvm/TableGen/StringToOffsetTable.h
llvm/include/llvm/Target/CGPassBuilderOption.h
llvm/include/llvm/Target/CodeGenCWrappers.h
-llvm/include/llvm/Testing/Support/Annotations.h
+llvm/include/llvm/Testing/Annotations/Annotations.h
llvm/include/llvm/Testing/Support/SupportHelpers.h
llvm/include/llvm/TextAPI/Architecture.h
llvm/include/llvm/TextAPI/ArchitectureSet.h
@@ -6839,7 +6839,7 @@
llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp
llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.h
llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp
-llvm/lib/Testing/Support/Annotations.cpp
+llvm/lib/Testing/Annotations/Annotations.cpp
llvm/lib/Testing/Support/Error.cpp
llvm/lib/Testing/Support/SupportHelpers.cpp
llvm/lib/TextAPI/ArchitectureSet.cpp
Index: clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
===================================================================
--- clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
+++ clang-tools-extra/unittests/clang-tidy/ClangTidyOptionsTest.cpp
@@ -3,7 +3,7 @@
#include "ClangTidyDiagnosticConsumer.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/ScopedPrinter.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <optional>
Index: clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
===================================================================
--- clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
+++ clang-tools-extra/unittests/clang-tidy/CMakeLists.txt
@@ -57,5 +57,6 @@
clangTidyObjCModule
clangTidyReadabilityModule
clangTidyUtils
+ LLVMTestingAnnotations
LLVMTestingSupport
)
Index: clang-tools-extra/pseudo/unittests/CMakeLists.txt
===================================================================
--- clang-tools-extra/pseudo/unittests/CMakeLists.txt
+++ clang-tools-extra/pseudo/unittests/CMakeLists.txt
@@ -26,5 +26,6 @@
clangPseudo
clangPseudoCXX
clangPseudoGrammar
+ LLVMTestingAnnotations
LLVMTestingSupport
)
Index: clang-tools-extra/pseudo/unittests/BracketTest.cpp
===================================================================
--- clang-tools-extra/pseudo/unittests/BracketTest.cpp
+++ clang-tools-extra/pseudo/unittests/BracketTest.cpp
@@ -9,7 +9,7 @@
#include "clang-pseudo/Bracket.h"
#include "clang-pseudo/Token.h"
#include "clang/Basic/LangOptions.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
Index: clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp
===================================================================
--- clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp
+++ clang-tools-extra/include-cleaner/unittests/WalkASTTest.cpp
@@ -15,7 +15,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/ScopedPrinter.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gtest/gtest.h"
#include <cstddef>
#include <unordered_map>
Index: clang-tools-extra/include-cleaner/unittests/RecordTest.cpp
===================================================================
--- clang-tools-extra/include-cleaner/unittests/RecordTest.cpp
+++ clang-tools-extra/include-cleaner/unittests/RecordTest.cpp
@@ -13,7 +13,7 @@
#include "clang/Testing/TestAST.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
Index: clang-tools-extra/include-cleaner/unittests/LocateSymbolTest.cpp
===================================================================
--- clang-tools-extra/include-cleaner/unittests/LocateSymbolTest.cpp
+++ clang-tools-extra/include-cleaner/unittests/LocateSymbolTest.cpp
@@ -15,7 +15,7 @@
#include "clang/Testing/TestAST.h"
#include "clang/Tooling/Inclusions/StandardLibrary.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <cstddef>
Index: clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
===================================================================
--- clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
+++ clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
@@ -17,7 +17,7 @@
#include "clang/Testing/TestAST.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <memory>
Index: clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
===================================================================
--- clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
+++ clang-tools-extra/include-cleaner/unittests/CMakeLists.txt
@@ -31,6 +31,7 @@
PRIVATE
clangIncludeCleaner
clangTesting
+ LLVMTestingAnnotations
LLVMTestingSupport
)
Index: clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp
===================================================================
--- clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp
+++ clang-tools-extra/include-cleaner/unittests/AnalysisTest.cpp
@@ -19,7 +19,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Support/ScopedPrinter.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <cstddef>
Index: clang-tools-extra/clangd/unittests/tweaks/TweakTesting.h
===================================================================
--- clang-tools-extra/clangd/unittests/tweaks/TweakTesting.h
+++ clang-tools-extra/clangd/unittests/tweaks/TweakTesting.h
@@ -13,7 +13,7 @@
#include "index/Index.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <memory>
Index: clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
+++ clang-tools-extra/clangd/unittests/SourceCodeTests.cpp
@@ -15,7 +15,7 @@
#include "clang/Basic/TokenKinds.h"
#include "clang/Format/Format.h"
#include "llvm/Support/Error.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/Error.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
Index: clang-tools-extra/clangd/unittests/FindTargetTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/FindTargetTests.cpp
+++ clang-tools-extra/clangd/unittests/FindTargetTests.cpp
@@ -15,7 +15,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <initializer_list>
Index: clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
===================================================================
--- clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
+++ clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
@@ -29,7 +29,7 @@
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/Path.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
#include "llvm/Testing/Support/Error.h"
#include "llvm/Testing/Support/SupportHelpers.h"
#include "gmock/gmock.h"
Index: clang-tools-extra/clangd/unittests/CMakeLists.txt
===================================================================
--- clang-tools-extra/clangd/unittests/CMakeLists.txt
+++ clang-tools-extra/clangd/unittests/CMakeLists.txt
@@ -5,7 +5,12 @@
)
if(CLANG_BUILT_STANDALONE)
- # LLVMTestingSupport library is needed for clangd tests.
+ # LLVMTestingSupport and LLVMTestingAnnotations are needed for clangd tests.
+ if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Annotations
+ AND NOT TARGET LLVMTestingAnnotations)
+ add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Annotations
+ lib/Testing/Annotations)
+ endif()
if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
AND NOT TARGET LLVMTestingSupport)
add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
@@ -162,6 +167,7 @@
clangDaemon
clangdSupport
clangTidy
+ LLVMTestingAnnotations
LLVMTestingSupport
)
Index: clang-tools-extra/clangd/unittests/Annotations.h
===================================================================
--- clang-tools-extra/clangd/unittests/Annotations.h
+++ clang-tools-extra/clangd/unittests/Annotations.h
@@ -5,7 +5,7 @@
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
-// A clangd-specific version of llvm/Testing/Support/Annotations.h, replaces
+// A clangd-specific version of llvm/Testing/Annotations/Annotations.h, replaces
// offsets and offset-based ranges with types from the LSP protocol.
//===---------------------------------------------------------------------===//
@@ -13,7 +13,7 @@
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_UNITTESTS_ANNOTATIONS_H
#include "Protocol.h"
-#include "llvm/Testing/Support/Annotations.h"
+#include "llvm/Testing/Annotations/Annotations.h"
namespace clang {
namespace clangd {
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits