[llvm] c76e3c3 - [ORC] Remove some stale unit test utils.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Thu May 13 18:32:44 PDT 2021
Author: Lang Hames
Date: 2021-05-13T18:32:35-07:00
New Revision: c76e3c319ebfeecbc2814ae7ac44516b5f0b4027
URL: https://github.com/llvm/llvm-project/commit/c76e3c319ebfeecbc2814ae7ac44516b5f0b4027
DIFF: https://github.com/llvm/llvm-project/commit/c76e3c319ebfeecbc2814ae7ac44516b5f0b4027.diff
LOG: [ORC] Remove some stale unit test utils.
This code was used to test ORCv1, which has been removed. It is not useful for
testing ORCv2.
Added:
Modified:
llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
Removed:
################################################################################
diff --git a/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h b/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
index 96e89d7a8066f..d2521587ebdba 100644
--- a/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
+++ b/llvm/unittests/ExecutionEngine/Orc/OrcTestCommon.h
@@ -201,89 +201,6 @@ inline StructType *getDummyStructTy(LLVMContext &Context) {
return StructType::get(ArrayType::get(Type::getInt32Ty(Context), 256));
}
-template <typename HandleT, typename ModuleT>
-class MockBaseLayer {
-public:
-
- using ModuleHandleT = HandleT;
-
- using AddModuleSignature =
- Expected<ModuleHandleT>(ModuleT M,
- std::shared_ptr<JITSymbolResolver> R);
-
- using RemoveModuleSignature = Error(ModuleHandleT H);
- using FindSymbolSignature = JITSymbol(const std::string &Name,
- bool ExportedSymbolsOnly);
- using FindSymbolInSignature = JITSymbol(ModuleHandleT H,
- const std::string &Name,
- bool ExportedSymbolsONly);
- using EmitAndFinalizeSignature = Error(ModuleHandleT H);
-
- std::function<AddModuleSignature> addModuleImpl;
- std::function<RemoveModuleSignature> removeModuleImpl;
- std::function<FindSymbolSignature> findSymbolImpl;
- std::function<FindSymbolInSignature> findSymbolInImpl;
- std::function<EmitAndFinalizeSignature> emitAndFinalizeImpl;
-
- Expected<ModuleHandleT> addModule(ModuleT M,
- std::shared_ptr<JITSymbolResolver> R) {
- assert(addModuleImpl &&
- "addModule called, but no mock implementation was provided");
- return addModuleImpl(std::move(M), std::move(R));
- }
-
- Error removeModule(ModuleHandleT H) {
- assert(removeModuleImpl &&
- "removeModule called, but no mock implementation was provided");
- return removeModuleImpl(H);
- }
-
- JITSymbol findSymbol(const std::string &Name, bool ExportedSymbolsOnly) {
- assert(findSymbolImpl &&
- "findSymbol called, but no mock implementation was provided");
- return findSymbolImpl(Name, ExportedSymbolsOnly);
- }
-
- JITSymbol findSymbolIn(ModuleHandleT H, const std::string &Name,
- bool ExportedSymbolsOnly) {
- assert(findSymbolInImpl &&
- "findSymbolIn called, but no mock implementation was provided");
- return findSymbolInImpl(H, Name, ExportedSymbolsOnly);
- }
-
- Error emitAndFinaliez(ModuleHandleT H) {
- assert(emitAndFinalizeImpl &&
- "emitAndFinalize called, but no mock implementation was provided");
- return emitAndFinalizeImpl(H);
- }
-};
-
-class ReturnNullJITSymbol {
-public:
- template <typename... Args>
- JITSymbol operator()(Args...) const {
- return nullptr;
- }
-};
-
-template <typename ReturnT>
-class DoNothingAndReturn {
-public:
- DoNothingAndReturn(ReturnT Ret) : Ret(std::move(Ret)) {}
-
- template <typename... Args>
- void operator()(Args...) const { return Ret; }
-private:
- ReturnT Ret;
-};
-
-template <>
-class DoNothingAndReturn<void> {
-public:
- template <typename... Args>
- void operator()(Args...) const { }
-};
-
} // namespace llvm
#endif
More information about the llvm-commits
mailing list