blob: ffa37a13d06497ba21c9e685cdcc71a5b248c964 [file] [log] [blame]
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01001//===------ NullResolver.h - Reject symbol lookup requests ------*- C++ -*-===//
2//
Andrew Walbran16937d02019-10-22 13:54:20 +01003// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Andrew Scull5e1ddfa2018-08-14 10:06:54 +01006//
7//===----------------------------------------------------------------------===//
8//
9// Defines a RuntimeDyld::SymbolResolver subclass that rejects all symbol
10// resolution requests, for clients that have no cross-object fixups.
11//
12//===----------------------------------------------------------------------===//
13
14#ifndef LLVM_EXECUTIONENGINE_ORC_NULLRESOLVER_H
15#define LLVM_EXECUTIONENGINE_ORC_NULLRESOLVER_H
16
Andrew Scullcdfcccc2018-10-05 20:58:37 +010017#include "llvm/ExecutionEngine/Orc/Legacy.h"
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010018#include "llvm/ExecutionEngine/RuntimeDyld.h"
19
20namespace llvm {
21namespace orc {
22
23class NullResolver : public SymbolResolver {
24public:
Andrew Scull0372a572018-11-16 15:47:06 +000025 SymbolNameSet getResponsibilitySet(const SymbolNameSet &Symbols) final;
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010026
27 SymbolNameSet lookup(std::shared_ptr<AsynchronousSymbolQuery> Query,
Andrew Scull0372a572018-11-16 15:47:06 +000028 SymbolNameSet Symbols) final;
Andrew Scull5e1ddfa2018-08-14 10:06:54 +010029};
30
31/// SymbolResolver impliementation that rejects all resolution requests.
32/// Useful for clients that have no cross-object fixups.
33class NullLegacyResolver : public LegacyJITSymbolResolver {
34public:
35 JITSymbol findSymbol(const std::string &Name) final;
36
37 JITSymbol findSymbolInLogicalDylib(const std::string &Name) final;
38};
39
40} // End namespace orc.
41} // End namespace llvm.
42
43#endif // LLVM_EXECUTIONENGINE_ORC_NULLRESOLVER_H