[PATCH] D59440: add steps to preprocess file and reduce command line args

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 19 01:49:18 PDT 2019


serge-sans-paille added inline comments.


================
Comment at: clang/utils/creduce-clang-crash.py:45
+  result = []
+  for i, arg in enumerate(cmd):
+    if arg.startswith('$'):
----------------
Useless enumerate here. You could even use a list comprehension here

```
return ' '.join(arg if arg.startswith('$') else pipes.quote(arg) for arg in cmd)
```


================
Comment at: clang/utils/creduce-clang-crash.py:161
+  for arg in args:
+    if (any(arg.startswith(a) for a in opts_startswith)):
+      continue
----------------
useless parenthesis around test

could be a list comprehension

```
result = [arg for arg in args if all(not arg.startswith(a) for a in opts_startswith)]
```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59440/new/

https://reviews.llvm.org/D59440





More information about the cfe-commits mailing list