[PATCH] D60572: creduce-clang-crash: Use `!` instead of `not`

2019-04-11 Thread Amy Huang via Phabricator via cfe-commits
akhuang added a comment.

Looks good- if we remove `not` there are a few other things that should be 
removed




Comment at: clang/utils/creduce-clang-crash.py:138
 if "fatal error:" in msg_re:
   self.is_crash = False
 break

also wouldn't need `self.is_crash`



Comment at: clang/utils/creduce-clang-crash.py:178
 
 crash_flag = "--crash" if self.is_crash else ""
 

We should remove `crash_flag` as well


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

https://reviews.llvm.org/D60572



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60572: creduce-clang-crash: Use `!` instead of `not`

2019-04-11 Thread Nico Weber via Phabricator via cfe-commits
thakis abandoned this revision.
thakis added a comment.

This seems to break the script, nevermind!


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

https://reviews.llvm.org/D60572



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D60572: creduce-clang-crash: Use `!` instead of `not`

2019-04-11 Thread Nico Weber via Phabricator via cfe-commits
thakis created this revision.
thakis added a reviewer: akhuang.

The run script runs in bash, so no need to depend on llvm's `not` binary.


https://reviews.llvm.org/D60572

Files:
  clang/utils/creduce-clang-crash.py


Index: clang/utils/creduce-clang-crash.py
===
--- clang/utils/creduce-clang-crash.py
+++ clang/utils/creduce-clang-crash.py
@@ -23,7 +23,6 @@
 verbose = False
 creduce_cmd = None
 clang_cmd = None
-not_cmd = None
 
 def verbose_print(*args, **kwargs):
   if verbose:
@@ -178,8 +177,8 @@
 
 crash_flag = "--crash" if self.is_crash else ""
 
-output = "#!/bin/bash\n%s %s %s >& t.log || exit 1\n" % \
-(pipes.quote(not_cmd), crash_flag, quote_cmd(self.get_crash_cmd()))
+output = "#!/bin/bash\n! %s %s >& t.log || exit 1\n" % \
+(crash_flag, quote_cmd(self.get_crash_cmd()))
 
 for msg in self.expected_output:
   output += 'grep %s t.log || exit 1\n' % pipes.quote(msg)
@@ -360,7 +359,6 @@
   global verbose
   global creduce_cmd
   global clang_cmd
-  global not_cmd
 
   parser = ArgumentParser(description=__doc__,
   formatter_class=RawTextHelpFormatter)
@@ -370,9 +368,6 @@
   help="Name of the file to be reduced.")
   parser.add_argument('--llvm-bin', dest='llvm_bin', type=str,
   help="Path to the LLVM bin directory.")
-  parser.add_argument('--llvm-not', dest='llvm_not', type=str,
-  help="The path to the `not` executable. "
-  "By default uses the llvm-bin directory.")
   parser.add_argument('--clang', dest='clang', type=str,
   help="The path to the `clang` executable. "
   "By default uses the llvm-bin directory.")
@@ -386,7 +381,6 @@
   llvm_bin = os.path.abspath(args.llvm_bin) if args.llvm_bin else None
   creduce_cmd = check_cmd('creduce', None, args.creduce)
   clang_cmd = check_cmd('clang', llvm_bin, args.clang)
-  not_cmd = check_cmd('not', llvm_bin, args.llvm_not)
 
   crash_script = check_file(args.crash_script[0])
   file_to_reduce = check_file(args.file_to_reduce[0])


Index: clang/utils/creduce-clang-crash.py
===
--- clang/utils/creduce-clang-crash.py
+++ clang/utils/creduce-clang-crash.py
@@ -23,7 +23,6 @@
 verbose = False
 creduce_cmd = None
 clang_cmd = None
-not_cmd = None
 
 def verbose_print(*args, **kwargs):
   if verbose:
@@ -178,8 +177,8 @@
 
 crash_flag = "--crash" if self.is_crash else ""
 
-output = "#!/bin/bash\n%s %s %s >& t.log || exit 1\n" % \
-(pipes.quote(not_cmd), crash_flag, quote_cmd(self.get_crash_cmd()))
+output = "#!/bin/bash\n! %s %s >& t.log || exit 1\n" % \
+(crash_flag, quote_cmd(self.get_crash_cmd()))
 
 for msg in self.expected_output:
   output += 'grep %s t.log || exit 1\n' % pipes.quote(msg)
@@ -360,7 +359,6 @@
   global verbose
   global creduce_cmd
   global clang_cmd
-  global not_cmd
 
   parser = ArgumentParser(description=__doc__,
   formatter_class=RawTextHelpFormatter)
@@ -370,9 +368,6 @@
   help="Name of the file to be reduced.")
   parser.add_argument('--llvm-bin', dest='llvm_bin', type=str,
   help="Path to the LLVM bin directory.")
-  parser.add_argument('--llvm-not', dest='llvm_not', type=str,
-  help="The path to the `not` executable. "
-  "By default uses the llvm-bin directory.")
   parser.add_argument('--clang', dest='clang', type=str,
   help="The path to the `clang` executable. "
   "By default uses the llvm-bin directory.")
@@ -386,7 +381,6 @@
   llvm_bin = os.path.abspath(args.llvm_bin) if args.llvm_bin else None
   creduce_cmd = check_cmd('creduce', None, args.creduce)
   clang_cmd = check_cmd('clang', llvm_bin, args.clang)
-  not_cmd = check_cmd('not', llvm_bin, args.llvm_not)
 
   crash_script = check_file(args.crash_script[0])
   file_to_reduce = check_file(args.file_to_reduce[0])
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits