summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfiling.c
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-20 03:19:15 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-20 03:19:15 +0000
commitcab2b24e0704c4efb150c6ea44195b766e56a690 (patch)
treeef68e6818b1fa87cb00a13f8ebab628a5648a6cd /lib/profile/InstrProfiling.c
parentf0b00b35ce5c160efb01589b7f016eab62c68b95 (diff)
PGO: Constify references to instrumentation data
<rdar://problem/15943240> git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204298 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfiling.c')
-rw-r--r--lib/profile/InstrProfiling.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/profile/InstrProfiling.c b/lib/profile/InstrProfiling.c
index 5676f5ac0..41818ab8a 100644
--- a/lib/profile/InstrProfiling.c
+++ b/lib/profile/InstrProfiling.c
@@ -10,8 +10,8 @@
#include "InstrProfiling.h"
/* TODO: Calculate these with linker magic. */
-static __llvm_pgo_data *First = NULL;
-static __llvm_pgo_data *Last = NULL;
+static const __llvm_pgo_data *First = NULL;
+static const __llvm_pgo_data *Last = NULL;
/*!
* \brief Register an instrumented function.
@@ -24,7 +24,7 @@ static __llvm_pgo_data *Last = NULL;
*/
void __llvm_pgo_register_function(void *Data_) {
/* TODO: Only emit this function if we can't use linker magic. */
- __llvm_pgo_data *Data = (__llvm_pgo_data*)Data_;
+ const __llvm_pgo_data *Data = (__llvm_pgo_data*)Data_;
if (!First || Data < First)
First = Data;
if (!Last || Data >= Last)
@@ -32,13 +32,13 @@ void __llvm_pgo_register_function(void *Data_) {
}
/*! \brief Get the first instrumentation record. */
-static __llvm_pgo_data *getFirst() {
+static const __llvm_pgo_data *getFirst() {
/* TODO: Use extern + linker magic instead of a static variable. */
return First;
}
/*! \brief Get the last instrumentation record. */
-static __llvm_pgo_data *getLast() {
+static const __llvm_pgo_data *getLast() {
/* TODO: Use extern + linker magic instead of a static variable. */
return Last;
}
@@ -62,7 +62,7 @@ void __llvm_pgo_write_buffer(FILE *OutputFile) {
/* TODO: Requires libc: break requirement by taking a char* buffer instead of
* a FILE stream.
*/
- __llvm_pgo_data *I, *E;
+ const __llvm_pgo_data *I, *E;
for (I = getFirst(), E = getLast(); I != E; ++I)
writeFunction(OutputFile, I);