llvm-project/clang/lib/AST/Interp
Owen Pan 7cd441ff53 [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
2022-01-24 09:05:27 -08:00
..
Boolean.h
ByteCodeEmitter.cpp [Clang interpreter] Avoid storing pointers at unaligned locations 2021-07-28 16:03:41 +01:00
ByteCodeEmitter.h
ByteCodeExprGen.cpp [clang] Fix bugprone argument comments (NFC) 2022-01-09 00:19:49 -08:00
ByteCodeExprGen.h [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
ByteCodeGenError.cpp
ByteCodeGenError.h
ByteCodeStmtGen.cpp Implement if consteval (P1938) 2021-10-05 08:04:14 -04:00
ByteCodeStmtGen.h [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
Context.cpp
Context.h [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
Descriptor.cpp
Descriptor.h [clang] Fix a few more comment typos to cycle bots 2021-09-20 20:06:03 -04:00
Disasm.cpp [Clang interpreter] Avoid storing pointers at unaligned locations 2021-07-28 16:03:41 +01:00
EvalEmitter.cpp
EvalEmitter.h
Frame.cpp
Frame.h
Function.cpp
Function.h [clang] Fix a few more comment typos to cycle bots 2021-09-20 20:06:03 -04:00
Integral.h
Interp.cpp
Interp.h Fix typo in two files in Clang, patch by FusionBolt 2021-08-31 12:33:37 +05:30
InterpBlock.cpp
InterpBlock.h [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
InterpFrame.cpp
InterpFrame.h
InterpStack.cpp
InterpStack.h [clang] Fix a few more comment typos to cycle bots 2021-09-20 20:06:03 -04:00
InterpState.cpp
InterpState.h [clang] Fix a few more comment typos to cycle bots 2021-09-20 20:06:03 -04:00
Opcode.h
Opcodes.td [clang] Fix a few more comment typos to cycle bots 2021-09-20 20:06:03 -04:00
Pointer.cpp
Pointer.h [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
PrimType.cpp
PrimType.h [clang][NFC] Wrap TYPE_SWITCH in "do while (0)" in the interpreter 2022-01-24 09:05:27 -08:00
Program.cpp [clang] Fix a few more comment typos to cycle bots 2021-09-20 20:06:03 -04:00
Program.h [clang] Remove unused forward declarations (NFC) 2022-01-08 11:56:40 -08:00
Record.cpp
Record.h
Source.cpp
Source.h [Clang interpreter] Avoid storing pointers at unaligned locations 2021-07-28 16:03:41 +01:00
State.cpp [clang][NFC] Use SmallString instead of SmallVector<char 2020-11-17 13:02:58 +00:00
State.h