--- /dev/null
+//===------ NullResolver.h - Reject symbol lookup requests ------*- C++ -*-===//\r
+//\r
+// The LLVM Compiler Infrastructure\r
+//\r
+// This file is distributed under the University of Illinois Open Source\r
+// License. See LICENSE.TXT for details.\r
+//\r
+//===----------------------------------------------------------------------===//\r
+//\r
+// Defines a RuntimeDyld::SymbolResolver subclass that rejects all symbol\r
+// resolution requests, for clients that have no cross-object fixups.\r
+//\r
+//===----------------------------------------------------------------------===//\r
+\r
+#ifndef LLVM_EXECUTIONENGINE_ORC_NULLRESOLVER_H\r
+#define LLVM_EXECUTIONENGINE_ORC_NULLRESOLVER_H\r
+\r
+#include "llvm/ExecutionEngine/RuntimeDyld.h"\r
+\r
+namespace llvm {\r
+namespace orc {\r
+\r
+/// SymbolResolver impliementation that rejects all resolution requests.\r
+/// Useful for clients that have no cross-object fixups.\r
+class NullResolver : public RuntimeDyld::SymbolResolver {\r
+public:\r
+ RuntimeDyld::SymbolInfo findSymbol(const std::string &Name) final;\r
+\r
+ RuntimeDyld::SymbolInfo\r
+ findSymbolInLogicalDylib(const std::string &Name) final;\r
+};\r
+\r
+} // End namespace orc.\r
+} // End namespace llvm.\r
+\r
+#endif // LLVM_EXECUTIONENGINE_ORC_NULLRESOLVER_H\r
-add_llvm_library(LLVMOrcJIT
- ExecutionUtils.cpp
- IndirectionUtils.cpp
- OrcMCJITReplacement.cpp
- OrcTargetSupport.cpp
-
- ADDITIONAL_HEADER_DIRS
- ${LLVM_MAIN_INCLUDE_DIR}/llvm/ExecutionEngine/Orc
-
- DEPENDS
- intrinsics_gen
- )
+add_llvm_library(LLVMOrcJIT\r
+ ExecutionUtils.cpp\r
+ IndirectionUtils.cpp\r
+ NullResolver.cpp\r
+ OrcMCJITReplacement.cpp\r
+ OrcTargetSupport.cpp\r
+\r
+ ADDITIONAL_HEADER_DIRS\r
+ ${LLVM_MAIN_INCLUDE_DIR}/llvm/ExecutionEngine/Orc\r
+\r
+ DEPENDS\r
+ intrinsics_gen\r
+ )\r
--- /dev/null
+//===---------- NullResolver.cpp - Reject symbol lookup requests ----------===//\r
+//\r
+// The LLVM Compiler Infrastructure\r
+//\r
+// This file is distributed under the University of Illinois Open Source\r
+// License. See LICENSE.TXT for details.\r
+//\r
+//===----------------------------------------------------------------------===//\r
+\r
+#include "llvm/ExecutionEngine/Orc/NullResolver.h"\r
+\r
+#include "llvm/Support/ErrorHandling.h"\r
+\r
+namespace llvm {\r
+namespace orc {\r
+\r
+RuntimeDyld::SymbolInfo NullResolver::findSymbol(const std::string &Name) {\r
+ llvm_unreachable("Unexpected cross-object symbol reference");\r
+}\r
+\r
+RuntimeDyld::SymbolInfo\r
+NullResolver::findSymbolInLogicalDylib(const std::string &Name) {\r
+ llvm_unreachable("Unexpected cross-object symbol reference");\r
+}\r
+\r
+} // End namespace orc.\r
+} // End namespace llvm.\r