summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingUtil.c
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2017-08-14 16:51:05 +0000
committerXinliang David Li <davidxl@google.com>2017-08-14 16:51:05 +0000
commit3caa058f838394a73e896a500784a21915f209ef (patch)
tree84e16f5b419acf7c1b93a314b562c3d7ec732561 /lib/profile/InstrProfilingUtil.c
parent83db677110a0953642661a2e526521e30c358c53 (diff)
[PGO] Add support for relocate profile dumping directory
Differential Revsion: http://reviews.llvm.org/D36648 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310857 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingUtil.c')
-rw-r--r--lib/profile/InstrProfilingUtil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/profile/InstrProfilingUtil.c b/lib/profile/InstrProfilingUtil.c
index fb68f30a5..bed97e526 100644
--- a/lib/profile/InstrProfilingUtil.c
+++ b/lib/profile/InstrProfilingUtil.c
@@ -196,7 +196,8 @@ lprofApplyPathPrefix(char *Dest, const char *PathStr, const char *Prefix,
memcpy(Dest, Prefix, PrefixLen);
- if (!IS_DIR_SEPARATOR(Prefix[PrefixLen - 1]))
+ if (!IS_DIR_SEPARATOR(Prefix[PrefixLen - 1]) &&
+ !IS_DIR_SEPARATOR(StrippedPathStr[0]))
Dest[PrefixLen++] = DIR_SEPARATOR;
memcpy(Dest + PrefixLen, StrippedPathStr, strlen(StrippedPathStr) + 1);