[PATCH] D96193: [ELF] Rewriting the path of sample profile file for --reproduce response.txt

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 5 17:57:42 PST 2021


hoy created this revision.
Herald added subscribers: wenlei, steven_wu, hiraditya, arichardson, emaste.
Herald added a reviewer: MaskRay.
hoy requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Rewritting the path of the sample profile file in response.txt to be relative to the repro tar.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96193

Files:
  lld/ELF/DriverUtils.cpp
  lld/test/ELF/reproduce-lto.s


Index: lld/test/ELF/reproduce-lto.s
===================================================================
--- lld/test/ELF/reproduce-lto.s
+++ lld/test/ELF/reproduce-lto.s
@@ -10,8 +10,13 @@
 # RUN: cd %t.dir
 # RUN: ld.lld build1/foo.o -o /dev/null --reproduce repro1.tar --lto-sample-profile=%t.dir/build1/empty_profile.txt
 # RUN: tar tvf repro1.tar | FileCheck %s --implicit-check-not={{.}}
+# RUN: tar xvf repro1.tar &> %t2
+# RUN: cat repro1/response.txt >> %t2
+# RUN: FileCheck %s --check-prefix=RSP < %t2
 
 # CHECK-DAG: {{.*}} repro1/{{.*}}/empty_profile.txt
 # CHECK-DAG: {{.*}} repro1/response.txt
 # CHECK-DAG: {{.*}} repro1/version.txt
 # CHECK-DAG: {{.*}} repro1/{{.*}}/foo.o
+# RSP:       repro1/[[PATH:.*]]/empty_profile.txt
+# RSP:       --lto-sample-profile=[[PATH]]/empty_profile.txt
Index: lld/ELF/DriverUtils.cpp
===================================================================
--- lld/ELF/DriverUtils.cpp
+++ lld/ELF/DriverUtils.cpp
@@ -179,6 +179,9 @@
     case OPT_INPUT:
       os << quote(rewritePath(arg->getValue())) << "\n";
       break;
+    case OPT_lto_sample_profile:
+      os << arg->getSpelling() << quote(rewritePath(arg->getValue())) << "\n";
+      break;
     case OPT_o:
       // If -o path contains directories, "lld @response.txt" will likely
       // fail because the archive we are creating doesn't contain empty


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96193.321906.patch
Type: text/x-patch
Size: 1363 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210206/3a09b5cd/attachment.bin>


More information about the llvm-commits mailing list