X-Git-Url: http://plrg.eecs.uci.edu/git/?p=oota-llvm.git;a=blobdiff_plain;f=include%2Fllvm%2FIR%2FGVMaterializer.h;h=6cb593c7a3dab790b28ee169e216ca523c4d855b;hp=ae2f2e1aefbed5f4e26e4e711baf053812c6e237;hb=8a32dc47d61f3c12f95f5cf7dd1d67ed7c6c00cd;hpb=dc6141a4ff04291f76dced9bd0155470cfbe7a5d diff --git a/include/llvm/IR/GVMaterializer.h b/include/llvm/IR/GVMaterializer.h index ae2f2e1aefb..6cb593c7a3d 100644 --- a/include/llvm/IR/GVMaterializer.h +++ b/include/llvm/IR/GVMaterializer.h @@ -18,12 +18,14 @@ #ifndef LLVM_IR_GVMATERIALIZER_H #define LLVM_IR_GVMATERIALIZER_H +#include "llvm/ADT/DenseMap.h" #include #include namespace llvm { class Function; class GlobalValue; +class Metadata; class Module; class StructType; @@ -34,26 +36,24 @@ protected: public: virtual ~GVMaterializer(); - /// True if GV has been materialized and can be dematerialized back to - /// whatever backing store this GVMaterializer uses. - virtual bool isDematerializable(const GlobalValue *GV) const = 0; - /// Make sure the given GlobalValue is fully read. /// virtual std::error_code materialize(GlobalValue *GV) = 0; - /// If the given GlobalValue is read in, and if the GVMaterializer supports - /// it, release the memory for the GV, and set it up to be materialized - /// lazily. If the Materializer doesn't support this capability, this method - /// is a noop. - /// - 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() = 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 + saveMetadataList(DenseMap &MetadataToIDs, + bool OnlyTempMD) {} virtual std::vector getIdentifiedStructTypes() const = 0; };