mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Switch from assert to CHECK (#975)
Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
This commit is contained in:
committed by
GitHub
co-authored by
Chandler Carruth
parent
e727eb8fe6
commit
a562f872e7
@@ -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 << "]}";
|
||||
|
||||
Reference in New Issue
Block a user