ObjectFileInterface.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- ObjectFileInterface.h - MU interface utils for objects --*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // Utilities for building MaterializationUnit::Interface objects from
  15. // object files.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_EXECUTIONENGINE_ORC_OBJECTFILEINTERFACE_H
  19. #define LLVM_EXECUTIONENGINE_ORC_OBJECTFILEINTERFACE_H
  20. #include "llvm/ExecutionEngine/Orc/Core.h"
  21. #include "llvm/Support/MemoryBuffer.h"
  22. namespace llvm {
  23. namespace orc {
  24. /// Adds an initializer symbol to the given MU interface.
  25. /// The init symbol's name is guaranteed to be unique within I, and will be of
  26. /// the form $.<ObjFileName>.__inits.<N>, where N is some integer.
  27. void addInitSymbol(MaterializationUnit::Interface &I, ExecutionSession &ES,
  28. StringRef ObjFileName);
  29. /// Returns a MaterializationUnit::Interface for the object file contained in
  30. /// the given buffer, or an error if the buffer does not contain a valid object
  31. /// file.
  32. Expected<MaterializationUnit::Interface>
  33. getObjectFileInterface(ExecutionSession &ES, MemoryBufferRef ObjBuffer);
  34. } // End namespace orc
  35. } // End namespace llvm
  36. #endif // LLVM_EXECUTIONENGINE_ORC_OBJECTFILEINTERFACE_H
  37. #ifdef __GNUC__
  38. #pragma GCC diagnostic pop
  39. #endif