-
Notifications
You must be signed in to change notification settings - Fork 11.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[clang][NFC] Wrap TYPE_SWITCH in "do while (0)" in the interpreter
Wraps the expansions of TYPE_SWITCH and COMPOSITE_TYPE_SWITCH in the constexpr interpreter with "do { ... } while (0)" so that these macros can be used like this: if (llvm::Optional<PrimType> T = Ctx.classify(FieldTy)) TYPE_SWITCH(*T, Ok &= ReturnValue<T>(FP.deref<T>(), Value)); else Ok &= Composite(FieldTy, FP, Value); This bug was found while testing D116316. See also review comment: https://reviews.llvm.org/D64146?id=208520#inline-584131 Also cleaned up the macro definitions by removing the superfluous do-while statements and removed the unused INT_TPYE_SWITCH macro. Differential Revision: https://reviews.llvm.org/D117301
- Loading branch information
Showing
1 changed file
with
21 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters