summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTeresa Johnson <tejohnson@google.com>2015-12-18 17:51:37 +0000
committerTeresa Johnson <tejohnson@google.com>2015-12-18 17:51:37 +0000
commite8df234a6ea0dbc20e4da677f2f9f8c426f44246 (patch)
tree7185d9f9615e2ff9d7764d40942512dd1325a40a /include
parentec08d99feee1ebbc5176d01e1c6cb021ade1eb37 (diff)
[ThinLTO/LTO] Don't link in unneeded metadata
Summary: Third patch split out from http://reviews.llvm.org/D14752. Only map in needed DISubroutine metadata (imported or otherwise linked in functions and other DISubroutine referenced by inlined instructions). This is supported for ThinLTO, LTO and llvm-link --only-needed, with associated tests for each one. Depends on D14838. Reviewers: dexonsmith, joker.eph Subscribers: davidxl, llvm-commits, joker.eph Differential Revision: http://reviews.llvm.org/D14843 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256003 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Transforms/Utils/ValueMapper.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Transforms/Utils/ValueMapper.h b/include/llvm/Transforms/Utils/ValueMapper.h
index 7b1382854ba..469022f34c5 100644
--- a/include/llvm/Transforms/Utils/ValueMapper.h
+++ b/include/llvm/Transforms/Utils/ValueMapper.h
@@ -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.