[all-commits] [llvm/llvm-project] 7a66fe: Wrap `llvm_unreachable` macro in do-while loop
Stefan Gränitz via All-commits
all-commits at lists.llvm.org
Mon Aug 8 04:16:20 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 7a66fe1075cfc7568554aeea9c40997dfb581979
https://github.com/llvm/llvm-project/commit/7a66fe1075cfc7568554aeea9c40997dfb581979
Author: Stefan Gränitz <stefan.graenitz at gmail.com>
Date: 2022-08-08 (Mon, 08 Aug 2022)
Changed paths:
M llvm/include/llvm/Support/ErrorHandling.h
Log Message:
-----------
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
More information about the All-commits
mailing list