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 
17 #ifndef LLVM_IR_GVMATERIALIZER_H
18 #define LLVM_IR_GVMATERIALIZER_H
19 
20 #include <vector>
21 
22 namespace llvm {
23 
24 class Error;
25 class GlobalValue;
26 class StructType;
27 
28 class GVMaterializer {
29 protected:
30   GVMaterializer() = default;
31 
32 public:
33   virtual ~GVMaterializer();
34 
35   /// Make sure the given GlobalValue is fully read.
36   ///
37   virtual Error materialize(GlobalValue *GV) = 0;
38 
39   /// Make sure the entire Module has been completely read.
40   ///
41   virtual Error materializeModule() = 0;
42 
43   virtual Error materializeMetadata() = 0;
44   virtual void setStripDebugInfo() = 0;
45 
46   virtual std::vector<StructType *> getIdentifiedStructTypes() const = 0;
47 };
48 
49 } // end namespace llvm
50 
51 #endif // LLVM_IR_GVMATERIALIZER_H
52