#ifndef LLVM_IR_GVMATERIALIZER_H
#define LLVM_IR_GVMATERIALIZER_H
+#include "llvm/ADT/DenseMap.h"
#include <system_error>
#include <vector>
namespace llvm {
class Function;
class GlobalValue;
+class Metadata;
class Module;
class StructType;
/// lazily. If the Materializer doesn't support this capability, this method
/// is a noop.
///
- virtual void Dematerialize(GlobalValue *) {}
+ virtual void dematerialize(GlobalValue *) {}
/// Make sure the entire Module has been completely read.
///
- virtual std::error_code MaterializeModule(Module *M) = 0;
+ virtual std::error_code materializeModule(Module *M) = 0;
+
+ virtual std::error_code materializeMetadata() = 0;
+ virtual void setStripDebugInfo() = 0;
+
+ /// Client should define this interface if the mapping between metadata
+ /// values and value ids needs to be preserved, e.g. across materializer
+ /// instantiations. If OnlyTempMD is true, only those that have remained
+ /// temporary metadata are recorded in the map.
+ virtual void
+ saveMDValueList(DenseMap<const Metadata *, unsigned> &MDValueToValIDMap,
+ bool OnlyTempMD) {}
virtual std::vector<StructType *> getIdentifiedStructTypes() const = 0;
};