Add more intrumentation/runtime helper interfaces (NFC)
[oota-llvm.git] / include / llvm / ProfileData / InstrProf.h
index 995d1f13c1cc6f8f4797ba34aa4044d3b6db922d..d94e41516c0b1ee7307b69a9c3a3a3fd6aba6a05 100644 (file)
 
 namespace llvm {
 
+/// Return the name of data section containing profile counter variables.
 inline StringRef getInstrProfCountersSectionName(bool AddSegment) {
   return AddSegment ? "__DATA,__llvm_prf_cnts" : "__llvm_prf_cnts";
 }
 
+/// Return the name of data section containing names of instrumented
+/// functions.
 inline StringRef getInstrProfNameSectionName(bool AddSegment) {
   return AddSegment ? "__DATA,__llvm_prf_names" : "__llvm_prf_names";
 }
 
+/// Return the name of the data section containing per-function control
+/// data.
 inline StringRef getInstrProfDataSectionName(bool AddSegment) {
   return AddSegment ? "__DATA,__llvm_prf_data" : "__llvm_prf_data";
 }
 
+/// Return the name of the section containing function coverage mapping
+/// data.
 inline StringRef getInstrProfCoverageSectionName(bool AddSegment) {
   return AddSegment ? "__DATA,__llvm_covmap" : "__llvm_covmap";
 }
 
+/// Return the name prefix of variables containing instrumented function names.
 inline StringRef getInstrProfNameVarPrefix() { return "__llvm_profile_name_"; }
 
+/// Return the name prefix of variables containing per-function control data.
 inline StringRef getInstrProfDataVarPrefix() { return "__llvm_profile_data_"; }
 
+/// Return the name prefix of profile counter variables.
 inline StringRef getInstrProfCountersVarPrefix() {
   return "__llvm_profile_counters_";
 }
 
+/// Return the name prefix of the COMDAT group for instrumentation variables
+/// associated with a COMDAT function.
 inline StringRef getInstrProfComdatPrefix() { return "__llvm_profile_vars_"; }
 
+/// Return the name of a covarage mapping variable (internal linkage) 
+/// for each instrumented source module. Such variables are allocated
+/// in the __llvm_covmap section.
 inline StringRef getCoverageMappingVarName() {
   return "__llvm_coverage_mapping";
 }
 
+/// Return the name of function that registers all the per-function control
+/// data at program startup time by calling __llvm_register_function. This
+/// function has internal linkage and is called by  __llvm_profile_init
+/// runtime method. This function is not generated for these platforms:
+/// Darwin, Linux, and FreeBSD.
+inline StringRef getInstrProfRegFuncsName() {
+  return "__llvm_profile_register_functions";
+}
+
+/// Return the name of the runtime interface that registers per-function control
+/// data for one instrumented function.
+inline StringRef getInstrProfRegFuncName() {
+  return "__llvm_profile_register_function";
+}
+
+/// Return the name of the runtime initialization method that is generated by
+/// the compiler. The function calls __llvm_profile_register_functions and
+/// __llvm_profile_override_default_filename functions if needed. This function
+/// has internal linkage and invoked at startup time via init_array.
+inline StringRef getInstrProfInitFuncName() { return "__llvm_profile_init"; }
+
+/// Return the name of the hook variable defined in profile runtime library.
+/// A reference to the variable causes the linker to link in the runtime
+/// initialization module (which defines the hook variable).
+inline StringRef getInstrProfRuntimeHookVarName() {
+  return "__llvm_profile_runtime";
+}
+
+/// Return the name of the compiler generated function that references the
+/// runtime hook variable. The function is a weak global.
+inline StringRef getInstrProfRuntimeHookVarUseFuncName() {
+  return "__llvm_profile_runtime_user";
+}
+
+/// Return the name of the profile runtime interface that overrides the default
+/// profile data file name.
+inline StringRef getInstrProfFileOverriderFuncName() {
+  return "__llvm_profile_override_default_filename";
+}
+
 const std::error_category &instrprof_category();
 
 enum class instrprof_error {