Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 1 | //===------ NullResolver.h - Reject symbol lookup requests ------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // Defines a RuntimeDyld::SymbolResolver subclass that rejects all symbol |
| 11 | // resolution requests, for clients that have no cross-object fixups. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef LLVM_EXECUTIONENGINE_ORC_NULLRESOLVER_H |
| 16 | #define LLVM_EXECUTIONENGINE_ORC_NULLRESOLVER_H |
| 17 | |
Andrew Scull | cdfcccc | 2018-10-05 20:58:37 +0100 | [diff] [blame] | 18 | #include "llvm/ExecutionEngine/Orc/Legacy.h" |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 19 | #include "llvm/ExecutionEngine/RuntimeDyld.h" |
| 20 | |
| 21 | namespace llvm { |
| 22 | namespace orc { |
| 23 | |
| 24 | class NullResolver : public SymbolResolver { |
| 25 | public: |
Andrew Scull | 0372a57 | 2018-11-16 15:47:06 +0000 | [diff] [blame] | 26 | SymbolNameSet getResponsibilitySet(const SymbolNameSet &Symbols) final; |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 27 | |
| 28 | SymbolNameSet lookup(std::shared_ptr<AsynchronousSymbolQuery> Query, |
Andrew Scull | 0372a57 | 2018-11-16 15:47:06 +0000 | [diff] [blame] | 29 | SymbolNameSet Symbols) final; |
Andrew Scull | 5e1ddfa | 2018-08-14 10:06:54 +0100 | [diff] [blame] | 30 | }; |
| 31 | |
| 32 | /// SymbolResolver impliementation that rejects all resolution requests. |
| 33 | /// Useful for clients that have no cross-object fixups. |
| 34 | class NullLegacyResolver : public LegacyJITSymbolResolver { |
| 35 | public: |
| 36 | JITSymbol findSymbol(const std::string &Name) final; |
| 37 | |
| 38 | JITSymbol findSymbolInLogicalDylib(const std::string &Name) final; |
| 39 | }; |
| 40 | |
| 41 | } // End namespace orc. |
| 42 | } // End namespace llvm. |
| 43 | |
| 44 | #endif // LLVM_EXECUTIONENGINE_ORC_NULLRESOLVER_H |