summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingFile.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-01-13 20:02:03 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-01-13 20:02:03 +0000
commitfc411a9eb44c912f867b49a08d4ea98be89681d9 (patch)
tree83d2530c824b866f040519d74b68316c571e0986 /lib/profile/InstrProfilingFile.c
parent4e3a0d5a8f750527f2f433019967f8f8214c558a (diff)
Diffstat (limited to 'lib/profile/InstrProfilingFile.c')
-rw-r--r--lib/profile/InstrProfilingFile.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/profile/InstrProfilingFile.c b/lib/profile/InstrProfilingFile.c
index bf50c02761d3..68d088a1956a 100644
--- a/lib/profile/InstrProfilingFile.c
+++ b/lib/profile/InstrProfilingFile.c
@@ -214,6 +214,15 @@ int __llvm_profile_write_file(void) {
return -1;
}
+ /* Check if there is llvm/runtime version mismatch. */
+ if (GET_VERSION(__llvm_profile_get_version()) != INSTR_PROF_RAW_VERSION) {
+ PROF_ERR("LLVM Profile: runtime and instrumentation version mismatch : "
+ "expected %d, but get %d\n",
+ INSTR_PROF_RAW_VERSION,
+ (int)GET_VERSION(__llvm_profile_get_version()));
+ return -1;
+ }
+
/* Write the file. */
rc = writeFileWithName(__llvm_profile_CurrentFilename);
if (rc)