[CSA] Improve error message with non-bound or unused labels
Change-Id: Ic2c4d90dbf91b43e6e4d9cba580385bfd61802ca Reviewed-on: https://chromium-review.googlesource.com/518044 Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Commit-Queue: Camillo Bruni <cbruni@chromium.org> Cr-Commit-Position: refs/heads/master@{#45621}
This commit is contained in:
parent
f87271ccd0
commit
98dc35b95f
@ -405,9 +405,17 @@ Node* RawMachineAssembler::MakeNode(const Operator* op, int input_count,
|
||||
}
|
||||
|
||||
RawMachineLabel::~RawMachineLabel() {
|
||||
// If this DCHECK fails, it means that the label has been bound but it's not
|
||||
// used, or the opposite. This would cause the register allocator to crash.
|
||||
DCHECK_EQ(bound_, used_);
|
||||
#if DEBUG
|
||||
if (bound_ == used_) return;
|
||||
std::stringstream str;
|
||||
if (bound_) {
|
||||
str << "A label has been bound but it's not used."
|
||||
<< "\n# label: " << *block_;
|
||||
} else {
|
||||
str << "A label has been used but it's not bound.";
|
||||
}
|
||||
FATAL(str.str().c_str());
|
||||
#endif // DEBUG
|
||||
}
|
||||
|
||||
} // namespace compiler
|
||||
|
Loading…
Reference in New Issue
Block a user