[ThinLTO/LTO] Don't link in unneeded metadata
[oota-llvm.git] / include / llvm / Transforms / Utils / ValueMapper.h
index 7b1382854ba8d6510de69aaaa2c9d39f2c9f8fba..469022f34c56472cd6f50f32076c9f85e873c25e 100644 (file)
@@ -61,6 +61,11 @@ namespace llvm {
     virtual Metadata *mapTemporaryMetadata(Metadata *MD) { return nullptr; }
     virtual void replaceTemporaryMetadata(const Metadata *OrigMD,
                                           Metadata *NewMD) {}
+
+    /// The client should implement this method if some metadata need
+    /// not be mapped, for example DISubprogram metadata for functions not
+    /// linked into the destination module.
+    virtual bool isMetadataNeeded(Metadata *MD) { return true; }
   };
 
   /// RemapFlags - These are flags that the value mapping APIs allow.