GVMaterializer.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- GVMaterializer.h - Interface for GV materializers --------*- 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. // This file provides an abstract interface for loading a module from some
  15. // place. This interface allows incremental or random access loading of
  16. // functions from the file. This is useful for applications like JIT compilers
  17. // or interprocedural optimizers that do not need the entire program in memory
  18. // at the same time.
  19. //
  20. //===----------------------------------------------------------------------===//
  21. #ifndef LLVM_IR_GVMATERIALIZER_H
  22. #define LLVM_IR_GVMATERIALIZER_H
  23. #include <vector>
  24. namespace llvm {
  25. class Error;
  26. class GlobalValue;
  27. class StructType;
  28. class GVMaterializer {
  29. protected:
  30. GVMaterializer() = default;
  31. public:
  32. virtual ~GVMaterializer();
  33. /// Make sure the given GlobalValue is fully read.
  34. ///
  35. virtual Error materialize(GlobalValue *GV) = 0;
  36. /// Make sure the entire Module has been completely read.
  37. ///
  38. virtual Error materializeModule() = 0;
  39. virtual Error materializeMetadata() = 0;
  40. virtual void setStripDebugInfo() = 0;
  41. virtual std::vector<StructType *> getIdentifiedStructTypes() const = 0;
  42. };
  43. } // end namespace llvm
  44. #endif // LLVM_IR_GVMATERIALIZER_H
  45. #ifdef __GNUC__
  46. #pragma GCC diagnostic pop
  47. #endif