summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/profile/InstrProfiling.c
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-19 22:45:28 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-03-19 22:45:28 +0000
commitd1a3bebeeb155097d5463229928d39e7c67a40e3 (patch)
tree38c51dcc7aaa3ec6f339ad45d0374e6155b49e53 /compiler-rt/lib/profile/InstrProfiling.c
parente33c990616e948a610d7d2deb48efdf171bafca3 (diff)
downloadbcm5719-llvm-d1a3bebeeb155097d5463229928d39e7c67a40e3.tar.gz
bcm5719-llvm-d1a3bebeeb155097d5463229928d39e7c67a40e3.zip
PGO: Use past-the-end semantics for pointer range
llvm-svn: 204278
Diffstat (limited to 'compiler-rt/lib/profile/InstrProfiling.c')
-rw-r--r--compiler-rt/lib/profile/InstrProfiling.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler-rt/lib/profile/InstrProfiling.c b/compiler-rt/lib/profile/InstrProfiling.c
index 4c9bb7e2b8f..5676f5ac05e 100644
--- a/compiler-rt/lib/profile/InstrProfiling.c
+++ b/compiler-rt/lib/profile/InstrProfiling.c
@@ -11,7 +11,7 @@
/* TODO: Calculate these with linker magic. */
static __llvm_pgo_data *First = NULL;
-static __llvm_pgo_data *Final = NULL;
+static __llvm_pgo_data *Last = NULL;
/*!
* \brief Register an instrumented function.
@@ -27,8 +27,8 @@ void __llvm_pgo_register_function(void *Data_) {
__llvm_pgo_data *Data = (__llvm_pgo_data*)Data_;
if (!First || Data < First)
First = Data;
- if (!Final || Data > Final)
- Final = Data;
+ if (!Last || Data >= Last)
+ Last = Data + 1;
}
/*! \brief Get the first instrumentation record. */
@@ -40,7 +40,7 @@ static __llvm_pgo_data *getFirst() {
/*! \brief Get the last instrumentation record. */
static __llvm_pgo_data *getLast() {
/* TODO: Use extern + linker magic instead of a static variable. */
- return Final + 1;
+ return Last;
}
/* TODO: void __llvm_pgo_get_size_for_buffer(void); */
@@ -67,4 +67,3 @@ void __llvm_pgo_write_buffer(FILE *OutputFile) {
for (I = getFirst(), E = getLast(); I != E; ++I)
writeFunction(OutputFile, I);
}
-
OpenPOWER on IntegriCloud