GVMaterializer.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //===- GVMaterializer.h - Interface for GV materializers --------*- C++ -*-===//
  2. //
  3. // 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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file provides an abstract interface for loading a module from some
  10. // place. This interface allows incremental or random access loading of
  11. // functions from the file. This is useful for applications like JIT compilers
  12. // or interprocedural optimizers that do not need the entire program in memory
  13. // at the same time.
  14. //
  15. //===----------------------------------------------------------------------===//
  16. #ifndef LLVM_IR_GVMATERIALIZER_H
  17. #define LLVM_IR_GVMATERIALIZER_H
  18. #include <vector>
  19. namespace llvm {
  20. class Error;
  21. class GlobalValue;
  22. class StructType;
  23. class GVMaterializer {
  24. protected:
  25. GVMaterializer() = default;
  26. public:
  27. virtual ~GVMaterializer();
  28. /// Make sure the given GlobalValue is fully read.
  29. ///
  30. virtual Error materialize(GlobalValue *GV) = 0;
  31. /// Make sure the entire Module has been completely read.
  32. ///
  33. virtual Error materializeModule() = 0;
  34. virtual Error materializeMetadata() = 0;
  35. virtual void setStripDebugInfo() = 0;
  36. virtual std::vector<StructType *> getIdentifiedStructTypes() const = 0;
  37. };
  38. } // end namespace llvm
  39. #endif // LLVM_IR_GVMATERIALIZER_H