summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2015-10-22 20:32:12 +0000
committerXinliang David Li <davidxl@google.com>2015-10-22 20:32:12 +0000
commit83bc4220ce99b23ec237e04e73c1010e481ac311 (patch)
tree78a5ec968768265ca29c42846ac430528659847f /llvm/include
parente0675fb8fbc78bd1e60bab0c1fac711eab96ab6e (diff)
downloadbcm5719-llvm-83bc4220ce99b23ec237e04e73c1010e481ac311.tar.gz
bcm5719-llvm-83bc4220ce99b23ec237e04e73c1010e481ac311.zip
Add helper functions and remove hard coded references to instProf related name/name-prefixes
This is a clean up patch that defines instr prof section and variable name prefixes in a common header with access helper functions. clang FE change will be done as a follow up once this patch is in. Differential Revision: http://reviews.llvm.org/D13919 llvm-svn: 251058
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/ProfileData/InstrProf.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h
index f425c6e13ed..3dad3f5ccc6 100644
--- a/llvm/include/llvm/ProfileData/InstrProf.h
+++ b/llvm/include/llvm/ProfileData/InstrProf.h
@@ -27,6 +27,37 @@
#include <vector>
namespace llvm {
+
+inline StringRef getInstrProfCountersSectionName(bool AddSegment) {
+ return AddSegment ? "__DATA,__llvm_prf_cnts" : "__llvm_prf_cnts";
+}
+
+inline StringRef getInstrProfNameSectionName(bool AddSegment) {
+ return AddSegment ? "__DATA,__llvm_prf_names" : "__llvm_prf_names";
+}
+
+inline StringRef getInstrProfDataSectionName(bool AddSegment) {
+ return AddSegment ? "__DATA,__llvm_prf_data" : "__llvm_prf_data";
+}
+
+inline StringRef getInstrProfCoverageSectionName(bool AddSegment) {
+ return AddSegment ? "__DATA,__llvm_covmap" : "__llvm_covmap";
+}
+
+inline StringRef getInstrProfNameVarPrefix() { return "__llvm_profile_names_"; }
+
+inline StringRef getInstrProfDataVarPrefix() { return "__llvm_profile_data_"; }
+
+inline StringRef getInstrProfCountersVarPrefix() {
+ return "__llvm_profile_counters_";
+}
+
+inline StringRef getInstrProfComdatPrefix() { return "__llvm_profile_vars_"; }
+
+inline StringRef getCoverageMappingVarName() {
+ return "__llvm_coverage_mapping";
+}
+
const std::error_category &instrprof_category();
enum class instrprof_error {
OpenPOWER on IntegriCloud