Switch from assert to CHECK (#975)

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
Jon Meow
2021-12-08 08:38:27 -08:00
committed by GitHub
co-authored by Chandler Carruth
parent e727eb8fe6
commit a562f872e7
14 changed files with 101 additions and 76 deletions
+4 -3
View File
@@ -6,6 +6,7 @@
#include <cstdlib>
#include "common/check.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/Sequence.h"
@@ -119,12 +120,12 @@ auto ParseTree::Print(llvm::raw_ostream& output) const -> void {
}
// This node is finished, so close it up.
assert(n_impl.subtree_size == 1 &&
"Subtree size must always be a positive integer!");
CHECK(n_impl.subtree_size == 1)
<< "Subtree size must always be a positive integer!";
output << "}";
int next_depth = node_stack.empty() ? 0 : node_stack.back().second;
assert(next_depth <= depth && "Cannot have the next depth increase!");
CHECK(next_depth <= depth) << "Cannot have the next depth increase!";
for (int close_children_count : llvm::seq(0, depth - next_depth)) {
(void)close_children_count;
output << "]}";