Commit 8371a291 authored by Stefan Gränitz's avatar Stefan Gränitz Committed by Tom Stellard
Browse files

Wrap `llvm_unreachable` macro in do-while loop

Macros that expand into multiple terms can cause interesting preprocessor hickups depending
on the context they are used in. https://github.com/llvm/llvm-project/issues/56867 reported
a miscompilation of `llvm_unreachable(msg)` inside a `LLVM_DEBUG({ ... })` block. We were
able to fix it by wrapping the expansion in a `do {} while(false)`.

Differential Revision: https://reviews.llvm.org/D131337

(cherry picked from commit 7a66fe10)
parent d6e5bfce
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment