[clang] 3dd7877 - Revert "[clang][dataflow] Move dataflow testing support out of unittests"
Stanislav Gatev via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 9 07:39:28 PST 2022
Author: Stanislav Gatev
Date: 2022-03-09T15:38:51Z
New Revision: 3dd7877b27dcd0d2b8e0d3a3ac156390248fe612
URL: https://github.com/llvm/llvm-project/commit/3dd7877b27dcd0d2b8e0d3a3ac156390248fe612
DIFF: https://github.com/llvm/llvm-project/commit/3dd7877b27dcd0d2b8e0d3a3ac156390248fe612.diff
LOG: Revert "[clang][dataflow] Move dataflow testing support out of unittests"
This reverts commit 26bbde2612b2042c3a8a31aed7f45e065c3dd413.
Added:
clang/unittests/Analysis/FlowSensitive/NoopAnalysis.h
clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp
clang/unittests/Analysis/FlowSensitive/TestingSupport.h
clang/unittests/Analysis/FlowSensitive/TestingSupportTest.cpp
Modified:
clang/lib/Analysis/FlowSensitive/CMakeLists.txt
clang/unittests/Analysis/FlowSensitive/CMakeLists.txt
clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp
clang/unittests/Analysis/FlowSensitive/MatchSwitchTest.cpp
clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp
clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
Removed:
clang/include/clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h
clang/include/clang/Analysis/FlowSensitive/Testing/NoopAnalysis.h
clang/lib/Analysis/FlowSensitive/Testing/CMakeLists.txt
clang/lib/Analysis/FlowSensitive/Testing/DataflowAnalysis.cpp
clang/unittests/Analysis/FlowSensitive/Testing/CMakeLists.txt
clang/unittests/Analysis/FlowSensitive/Testing/DataflowCheckerTest.cpp
################################################################################
diff --git a/clang/lib/Analysis/FlowSensitive/CMakeLists.txt b/clang/lib/Analysis/FlowSensitive/CMakeLists.txt
index 58c3df47745cb..cfe3c8e77b4fd 100644
--- a/clang/lib/Analysis/FlowSensitive/CMakeLists.txt
+++ b/clang/lib/Analysis/FlowSensitive/CMakeLists.txt
@@ -12,5 +12,3 @@ add_clang_library(clangAnalysisFlowSensitive
clangAST
clangBasic
)
-
-add_subdirectory(Testing)
diff --git a/clang/lib/Analysis/FlowSensitive/Testing/CMakeLists.txt b/clang/lib/Analysis/FlowSensitive/Testing/CMakeLists.txt
deleted file mode 100644
index 513bcbf5ecc7a..0000000000000
--- a/clang/lib/Analysis/FlowSensitive/Testing/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-add_clang_library(clangAnalysisFlowSensitiveTesting
- DataflowAnalysis.cpp
-
- LINK_LIBS
- clangAnalysis
- clangAnalysisFlowSensitive
- clangAST
- clangBasic
- clangFrontend
- clangLex
- clangSerialization
- clangTesting
- clangTooling
- )
diff --git a/clang/unittests/Analysis/FlowSensitive/CMakeLists.txt b/clang/unittests/Analysis/FlowSensitive/CMakeLists.txt
index f59024c8e78a7..d2608503a5396 100644
--- a/clang/unittests/Analysis/FlowSensitive/CMakeLists.txt
+++ b/clang/unittests/Analysis/FlowSensitive/CMakeLists.txt
@@ -11,6 +11,8 @@ add_clang_unittest(ClangAnalysisFlowSensitiveTests
MultiVarConstantPropagationTest.cpp
SingleVarConstantPropagationTest.cpp
SourceLocationsLatticeTest.cpp
+ TestingSupport.cpp
+ TestingSupportTest.cpp
TransferTest.cpp
TypeErasedDataflowAnalysisTest.cpp
SolverTest.cpp
@@ -20,7 +22,6 @@ clang_target_link_libraries(ClangAnalysisFlowSensitiveTests
PRIVATE
clangAnalysis
clangAnalysisFlowSensitive
- clangAnalysisFlowSensitiveTesting
clangAST
clangASTMatchers
clangBasic
@@ -35,5 +36,3 @@ target_link_libraries(ClangAnalysisFlowSensitiveTests
PRIVATE
LLVMTestingSupport
)
-
-add_subdirectory(Testing)
diff --git a/clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp b/clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp
index 738af8d9c97ca..51b40f2319878 100644
--- a/clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/DataflowEnvironmentTest.cpp
@@ -7,9 +7,9 @@
//===----------------------------------------------------------------------===//
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
+#include "NoopAnalysis.h"
+#include "TestingSupport.h"
#include "clang/Analysis/FlowSensitive/DataflowAnalysisContext.h"
-#include "clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h"
-#include "clang/Analysis/FlowSensitive/Testing/NoopAnalysis.h"
#include "clang/Analysis/FlowSensitive/Value.h"
#include "clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h"
#include "gmock/gmock.h"
diff --git a/clang/unittests/Analysis/FlowSensitive/MatchSwitchTest.cpp b/clang/unittests/Analysis/FlowSensitive/MatchSwitchTest.cpp
index b04d2b7e9105a..b99e5c6e1c0b0 100644
--- a/clang/unittests/Analysis/FlowSensitive/MatchSwitchTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/MatchSwitchTest.cpp
@@ -13,6 +13,7 @@
//===----------------------------------------------------------------------===//
#include "clang/Analysis/FlowSensitive/MatchSwitch.h"
+#include "TestingSupport.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
@@ -23,7 +24,6 @@
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
#include "clang/Analysis/FlowSensitive/DataflowLattice.h"
#include "clang/Analysis/FlowSensitive/MapLattice.h"
-#include "clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
diff --git a/clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp b/clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp
index b1d4650772fb2..9535f99c5aea4 100644
--- a/clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/MultiVarConstantPropagationTest.cpp
@@ -12,6 +12,7 @@
//
//===----------------------------------------------------------------------===//
+#include "TestingSupport.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
@@ -22,7 +23,6 @@
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
#include "clang/Analysis/FlowSensitive/DataflowLattice.h"
#include "clang/Analysis/FlowSensitive/MapLattice.h"
-#include "clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
diff --git a/clang/include/clang/Analysis/FlowSensitive/Testing/NoopAnalysis.h b/clang/unittests/Analysis/FlowSensitive/NoopAnalysis.h
similarity index 90%
rename from clang/include/clang/Analysis/FlowSensitive/Testing/NoopAnalysis.h
rename to clang/unittests/Analysis/FlowSensitive/NoopAnalysis.h
index 18f5e87765487..eab5782095bbc 100644
--- a/clang/include/clang/Analysis/FlowSensitive/Testing/NoopAnalysis.h
+++ b/clang/unittests/Analysis/FlowSensitive/NoopAnalysis.h
@@ -11,8 +11,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_TESTING_NOOPANALYSIS_H
-#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_TESTING_NOOPANALYSIS_H
+#ifndef LLVM_CLANG_UNITTESTS_ANALYSIS_FLOWSENSITIVE_NOOPANALYSIS_H
+#define LLVM_CLANG_UNITTESTS_ANALYSIS_FLOWSENSITIVE_NOOPANALYSIS_H
#include "clang/AST/ASTContext.h"
#include "clang/AST/Stmt.h"
@@ -55,4 +55,4 @@ class NoopAnalysis : public DataflowAnalysis<NoopAnalysis, NoopLattice> {
} // namespace dataflow
} // namespace clang
-#endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_TESTING_NOOPANALYSIS_H
+#endif // LLVM_CLANG_UNITTESTS_ANALYSIS_FLOWSENSITIVE_NOOPANALYSIS_H
diff --git a/clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp b/clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
index 9d20760ca62a3..e14724931a7c0 100644
--- a/clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/SingleVarConstantPropagationTest.cpp
@@ -12,6 +12,7 @@
//
//===----------------------------------------------------------------------===//
+#include "TestingSupport.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Expr.h"
@@ -21,7 +22,6 @@
#include "clang/Analysis/FlowSensitive/DataflowAnalysis.h"
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
#include "clang/Analysis/FlowSensitive/DataflowLattice.h"
-#include "clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/ADT/None.h"
#include "llvm/ADT/Optional.h"
diff --git a/clang/unittests/Analysis/FlowSensitive/Testing/CMakeLists.txt b/clang/unittests/Analysis/FlowSensitive/Testing/CMakeLists.txt
deleted file mode 100644
index f7845c6717180..0000000000000
--- a/clang/unittests/Analysis/FlowSensitive/Testing/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-set(LLVM_LINK_COMPONENTS
- FrontendOpenMP
- Support
- )
-
-add_clang_unittest(ClangAnalysisFlowSensitiveTestingTests
- DataflowCheckerTest.cpp
- )
-
-clang_target_link_libraries(ClangAnalysisFlowSensitiveTestingTests
- PRIVATE
- clangAnalysis
- clangAnalysisFlowSensitive
- clangAnalysisFlowSensitiveTesting
- clangAST
- clangASTMatchers
- clangBasic
- clangFrontend
- clangLex
- clangSerialization
- clangTesting
- clangTooling
- )
-
-target_link_libraries(ClangAnalysisFlowSensitiveTestingTests
- PRIVATE
- LLVMTestingSupport
- )
diff --git a/clang/lib/Analysis/FlowSensitive/Testing/DataflowAnalysis.cpp b/clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp
similarity index 88%
rename from clang/lib/Analysis/FlowSensitive/Testing/DataflowAnalysis.cpp
rename to clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp
index 7cdbc6b5f5283..4c5efa7504048 100644
--- a/clang/lib/Analysis/FlowSensitive/Testing/DataflowAnalysis.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/TestingSupport.cpp
@@ -1,16 +1,4 @@
-//===-- DataflowAnalysis.cpp ------------------------------------*- 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
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines utilities to simplify testing of dataflow analyses.
-//
-//===----------------------------------------------------------------------===//
-
-#include "clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h"
+#include "TestingSupport.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/AST/Stmt.h"
diff --git a/clang/include/clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h b/clang/unittests/Analysis/FlowSensitive/TestingSupport.h
similarity index 95%
rename from clang/include/clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h
rename to clang/unittests/Analysis/FlowSensitive/TestingSupport.h
index df9fdcb215eb4..957d73fd6d0c4 100644
--- a/clang/include/clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h
+++ b/clang/unittests/Analysis/FlowSensitive/TestingSupport.h
@@ -1,4 +1,4 @@
-//===--- DataflowAnalysis.h - Testing utils for dataflow analyses * C++ -*-===//
+//===--- TestingSupport.h - Testing utils for dataflow analyses -*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
@@ -10,8 +10,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_TESTING_DATAFLOWANALYSIS_H
-#define LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_TESTING_DATAFLOWANALYSIS_H
+#ifndef LLVM_CLANG_ANALYSIS_FLOW_SENSITIVE_TESTING_SUPPORT_H_
+#define LLVM_CLANG_ANALYSIS_FLOW_SENSITIVE_TESTING_SUPPORT_H_
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
@@ -179,4 +179,4 @@ const ValueDecl *findValueDecl(ASTContext &ASTCtx, llvm::StringRef Name);
} // namespace dataflow
} // namespace clang
-#endif // LLVM_CLANG_ANALYSIS_FLOWSENSITIVE_TESTING_DATAFLOWANALYSIS_H
+#endif // LLVM_CLANG_ANALYSIS_FLOW_SENSITIVE_TESTING_SUPPORT_H_
diff --git a/clang/unittests/Analysis/FlowSensitive/Testing/DataflowCheckerTest.cpp b/clang/unittests/Analysis/FlowSensitive/TestingSupportTest.cpp
similarity index 90%
rename from clang/unittests/Analysis/FlowSensitive/Testing/DataflowCheckerTest.cpp
rename to clang/unittests/Analysis/FlowSensitive/TestingSupportTest.cpp
index 4ecc755388767..960879025307f 100644
--- a/clang/unittests/Analysis/FlowSensitive/Testing/DataflowCheckerTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/TestingSupportTest.cpp
@@ -1,16 +1,8 @@
-//===- DataflowAnalysisTest.cpp -------------------------------------------===//
-//
-// 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
-//
-//===----------------------------------------------------------------------===//
-
+#include "TestingSupport.h"
+#include "NoopAnalysis.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
-#include "clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h"
-#include "clang/Analysis/FlowSensitive/Testing/NoopAnalysis.h"
#include "clang/Tooling/Tooling.h"
#include "llvm/Testing/Support/Error.h"
#include "gmock/gmock.h"
diff --git a/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp b/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
index cbd59a6351b88..49aaca9a7588c 100644
--- a/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/TransferTest.cpp
@@ -6,14 +6,14 @@
//
//===----------------------------------------------------------------------===//
+#include "NoopAnalysis.h"
+#include "TestingSupport.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/Decl.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
#include "clang/Analysis/FlowSensitive/StorageLocation.h"
-#include "clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h"
-#include "clang/Analysis/FlowSensitive/Testing/NoopAnalysis.h"
#include "clang/Analysis/FlowSensitive/Value.h"
#include "clang/Basic/LangStandard.h"
#include "llvm/ADT/ArrayRef.h"
diff --git a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
index 8ed15a6e1b1ce..f93b3fc2e8ed8 100644
--- a/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
+++ b/clang/unittests/Analysis/FlowSensitive/TypeErasedDataflowAnalysisTest.cpp
@@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//
+#include "NoopAnalysis.h"
+#include "TestingSupport.h"
#include "clang/AST/Decl.h"
#include "clang/AST/ExprCXX.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
@@ -15,8 +17,6 @@
#include "clang/Analysis/FlowSensitive/DataflowAnalysisContext.h"
#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
#include "clang/Analysis/FlowSensitive/DataflowLattice.h"
-#include "clang/Analysis/FlowSensitive/Testing/DataflowAnalysis.h"
-#include "clang/Analysis/FlowSensitive/Testing/NoopAnalysis.h"
#include "clang/Analysis/FlowSensitive/Value.h"
#include "clang/Analysis/FlowSensitive/WatchedLiteralsSolver.h"
#include "clang/Tooling/Tooling.h"
More information about the cfe-commits
mailing list