[compiler-rt] r310907 - Revert r310857 due to internal test failure
Xinliang David Li via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 14 20:13:01 PDT 2017
Author: davidxl
Date: Mon Aug 14 20:13:01 2017
New Revision: 310907
URL: http://llvm.org/viewvc/llvm-project?rev=310907&view=rev
Log:
Revert r310857 due to internal test failure
Modified:
compiler-rt/trunk/lib/profile/InstrProfilingFile.c
compiler-rt/trunk/lib/profile/InstrProfilingUtil.c
compiler-rt/trunk/test/profile/instrprof-path.c
Modified: compiler-rt/trunk/lib/profile/InstrProfilingFile.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingFile.c?rev=310907&r1=310906&r2=310907&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingFile.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingFile.c Mon Aug 14 20:13:01 2017
@@ -513,29 +513,23 @@ const char *__llvm_profile_get_path_pref
COMPILER_RT_VISIBILITY
void __llvm_profile_initialize_file(void) {
const char *EnvFilenamePat;
+ const char *SelectedPat = NULL;
+ ProfileNameSpecifier PNS = PNS_unknown;
int hasCommandLineOverrider = (INSTR_PROF_PROFILE_NAME_VAR[0] != 0);
EnvFilenamePat = getFilenamePatFromEnv();
- if (EnvFilenamePat)
- parseAndSetFilename(EnvFilenamePat, PNS_environment, 0);
- else if (hasCommandLineOverrider) {
- const char *SelectedPat = INSTR_PROF_PROFILE_NAME_VAR;
-
- size_t PrefixLen;
- int StripLen;
- const char *Prefix = lprofGetPathPrefix(&StripLen, &PrefixLen);
- if (Prefix != NULL) {
- char *StripPat =
- COMPILER_RT_ALLOCA(PrefixLen + 1 + strlen(SelectedPat) + 1);
- lprofApplyPathPrefix(StripPat, SelectedPat, Prefix, PrefixLen, StripLen);
- SelectedPat = StripPat;
- }
-
- parseAndSetFilename(SelectedPat, PNS_command_line, Prefix ? 1 : 0);
+ if (EnvFilenamePat) {
+ SelectedPat = EnvFilenamePat;
+ PNS = PNS_environment;
+ } else if (hasCommandLineOverrider) {
+ SelectedPat = INSTR_PROF_PROFILE_NAME_VAR;
+ PNS = PNS_command_line;
} else {
- parseAndSetFilename(NULL, PNS_default, 0);
+ SelectedPat = NULL;
+ PNS = PNS_default;
}
+ parseAndSetFilename(SelectedPat, PNS, 0);
}
/* This API is directly called by the user application code. It has the
Modified: compiler-rt/trunk/lib/profile/InstrProfilingUtil.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingUtil.c?rev=310907&r1=310906&r2=310907&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingUtil.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingUtil.c Mon Aug 14 20:13:01 2017
@@ -196,8 +196,7 @@ lprofApplyPathPrefix(char *Dest, const c
memcpy(Dest, Prefix, PrefixLen);
- if (!IS_DIR_SEPARATOR(Prefix[PrefixLen - 1]) &&
- !IS_DIR_SEPARATOR(StrippedPathStr[0]))
+ if (!IS_DIR_SEPARATOR(Prefix[PrefixLen - 1]))
Dest[PrefixLen++] = DIR_SEPARATOR;
memcpy(Dest + PrefixLen, StrippedPathStr, strlen(StrippedPathStr) + 1);
Modified: compiler-rt/trunk/test/profile/instrprof-path.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/profile/instrprof-path.c?rev=310907&r1=310906&r2=310907&view=diff
==============================================================================
--- compiler-rt/trunk/test/profile/instrprof-path.c (original)
+++ compiler-rt/trunk/test/profile/instrprof-path.c Mon Aug 14 20:13:01 2017
@@ -1,8 +1,6 @@
// RUN: %clang_pgogen -O2 -o %t.0 %s
// RUN: %clang_pgogen=%t.d1 -O2 -o %t.1 %s
// RUN: %clang_pgogen=%t.d1/%t.d2 -O2 -o %t.2 %s
-// RUN: %clang_pgogen=a/b/c/d -O2 -o %t.3 %s
-// RUN: %clang_pgogen=/a/b/c/d -O2 -o %t.4 %s
//
// RUN: %run %t.0 ""
// RUN: env LLVM_PROFILE_FILE=%t.d1/default.profraw %run %t.0 %t.d1/
@@ -11,17 +9,6 @@
// RUN: %run %t.2 %t.d1/%t.d2/
// RUN: %run %t.2 %t.d1/%t.d2/ %t.d1/%t.d2/%t.d3/blah.profraw %t.d1/%t.d2/%t.d3/
-// RUN: env GCOV_PREFIX=%t.prefix %run %t.3 %t.prefix/a/b/c/d/
-// RUN: env GCOV_PREFIX=%t.prefix env GCOV_PREFIX_STRIP=1 %run %t.3 %t.prefix/b/c/d/
-// RUN: env GCOV_PREFIX=%t.prefix env GCOV_PREFIX_STRIP=2 %run %t.3 %t.prefix/c/d/
-// RUN: env GCOV_PREFIX=%t.prefix env GCOV_PREFIX_STRIP=3 %run %t.3 %t.prefix/d/
-
-// RUN: env GCOV_PREFIX=%t.prefix %run %t.4 %t.prefix/a/b/c/d/
-// RUN: env GCOV_PREFIX=%t.prefix env GCOV_PREFIX_STRIP=1 %run %t.4 %t.prefix/b/c/d/
-// RUN: env GCOV_PREFIX=%t.prefix env GCOV_PREFIX_STRIP=2 %run %t.4 %t.prefix/c/d/
-// RUN: env GCOV_PREFIX=%t.prefix env GCOV_PREFIX_STRIP=3 %run %t.4 %t.prefix/d/
-
-#include <stdio.h>
#include <string.h>
const char *__llvm_profile_get_path_prefix();
@@ -37,11 +24,8 @@ int main(int argc, const char *argv[]) {
expected = argv[1];
prefix = __llvm_profile_get_path_prefix();
- if (strcmp(prefix, expected)) {
- fprintf(stderr, "Expected = %s\n", expected);
- fprintf(stderr, " Actual = %s\n", prefix);
+ if (strcmp(prefix, expected))
return 1;
- }
if (argc == 4) {
__llvm_profile_set_filename(argv[2]);
More information about the llvm-commits
mailing list