diff options
author | Easwaran Raman <eraman@google.com> | 2016-03-18 21:29:30 +0000 |
---|---|---|
committer | Easwaran Raman <eraman@google.com> | 2016-03-18 21:29:30 +0000 |
commit | 26628d3015028ad2f4d07acea0acc7168db0e107 (patch) | |
tree | 5bd6075a8e4d945026f20584e29b96c1ce2851c2 /llvm/lib/IR/Module.cpp | |
parent | c5269c0a4b8ebebc64e58b1bdb921f8f0f1d3164 (diff) | |
download | llvm-26628d3015028ad2f4d07acea0acc7168db0e107.zip llvm-26628d3015028ad2f4d07acea0acc7168db0e107.tar.gz llvm-26628d3015028ad2f4d07acea0acc7168db0e107.tar.bz2 |
Interface to get/set profile summary metadata to module
Differential Revision: http://reviews.llvm.org/D17894
llvm-svn: 263835
Diffstat (limited to 'llvm/lib/IR/Module.cpp')
-rw-r--r-- | llvm/lib/IR/Module.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/IR/Module.cpp b/llvm/lib/IR/Module.cpp index fc3f9d0..a0bda00 100644 --- a/llvm/lib/IR/Module.cpp +++ b/llvm/lib/IR/Module.cpp @@ -485,3 +485,11 @@ Optional<uint64_t> Module::getMaximumFunctionCount() { return None; return cast<ConstantInt>(Val->getValue())->getZExtValue(); } + +void Module::setProfileSummary(Metadata *M) { + addModuleFlag(ModFlagBehavior::Error, "ProfileSummary", M); +} + +Metadata *Module::getProfileSummary() { + return getModuleFlag("ProfileSummary"); +} |