diff options
author | Teresa Johnson <tejohnson@google.com> | 2015-12-18 17:51:37 +0000 |
---|---|---|
committer | Teresa Johnson <tejohnson@google.com> | 2015-12-18 17:51:37 +0000 |
commit | 0e7c82cb69972c75978ec6c5077cc91879836122 (patch) | |
tree | cb53c4e32ca3659066af39599edd05c32ca6b8a4 /llvm/include | |
parent | b9e832608879a9defe8be23384677b9335b00546 (diff) | |
download | bcm5719-llvm-0e7c82cb69972c75978ec6c5077cc91879836122.tar.gz bcm5719-llvm-0e7c82cb69972c75978ec6c5077cc91879836122.zip |
[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
llvm-svn: 256003
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/Transforms/Utils/ValueMapper.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/ValueMapper.h b/llvm/include/llvm/Transforms/Utils/ValueMapper.h index 7b1382854ba..469022f34c5 100644 --- a/llvm/include/llvm/Transforms/Utils/ValueMapper.h +++ b/llvm/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. |