[clang] 03689fe - [perf-training] Ignore ' (in-process)' prefix from -###

Francis Visoiu Mistrih via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 17 09:39:28 PST 2020


Author: Francis Visoiu Mistrih
Date: 2020-01-17T09:38:35-08:00
New Revision: 03689fe97f2377a3b19864de98b5c14b7fbd85ab

URL: https://github.com/llvm/llvm-project/commit/03689fe97f2377a3b19864de98b5c14b7fbd85ab
DIFF: https://github.com/llvm/llvm-project/commit/03689fe97f2377a3b19864de98b5c14b7fbd85ab.diff

LOG: [perf-training] Ignore ' (in-process)' prefix from -###

After D69825, the output of clang -### when running in process can be
prefixed by ' (in-process)'. Skip it.

Added: 
    

Modified: 
    clang/utils/perf-training/perf-helper.py

Removed: 
    


################################################################################
diff  --git a/clang/utils/perf-training/perf-helper.py b/clang/utils/perf-training/perf-helper.py
index 3ab193ee76c0..58eef65c6e73 100644
--- a/clang/utils/perf-training/perf-helper.py
+++ b/clang/utils/perf-training/perf-helper.py
@@ -131,7 +131,15 @@ def get_cc1_command_for_args(cmd, env):
       print('Fatal error: unable to determine cc1 command: %r' % cc_output)
       exit(1)
 
-  cc1_cmd = shlex.split(cc_commands[0])
+  cc_command = cc_commands[0]
+
+  # When cc1 runs in the same process as the driver, it prefixes the cc1
+  # invocation with ' (in-process)'. Skip it.
+  skip_pfx_line = ' (in-process)'
+  if cc_command.startswith(skip_pfx_line):
+      cc_command = cc_command[len(skip_pfx_line):]
+
+  cc1_cmd = shlex.split(cc_command)
   if not cc1_cmd:
       print('Fatal error: unable to determine cc1 command: %r' % cc_output)
       exit(1)


        


More information about the cfe-commits mailing list