llvm-project/clang/test/AST/Interp
Timm Bäder 7c215a4571 [clang][Interp] Explicitly handle RVO Pointer
The calling convention is:

[RVO pointer]
[instance pointer]
[... args ...]

We handle the instance pointer ourselves, BUT for the RVO pointer, we
just assumed in visitReturnStmt() that it is on top of the stack. Which
isn't true if there are other args present (and a this pointer, maybe).

Fix this by recording the RVO pointer explicitly when creating an
InterpFrame, just like we do with the instance/This pointer.

There is already a "RVOAndParams()" test in test/AST/Inter/records.cpp,
that was supposed to test this, however, it didn't trigger any
problematic behavior because the parameter and the return value have the
same type.

Differential Revision: https://reviews.llvm.org/D137392
2022-11-30 10:37:57 +01:00
..
arrays.cpp [clang][Interp] Array initialization via CXXConstructExpr 2022-11-30 10:09:52 +01:00
class-layout.cpp [clang][Interp] Support alignof() 2022-11-11 08:38:06 +01:00
cond.cpp
cxx20.cpp [clang][Interp] Support alignof() 2022-11-11 08:38:06 +01:00
enums-targets.cpp [clang][Interp] Handle enums 2022-09-30 08:18:14 +02:00
enums.cpp [clang][Interp] Handle enums 2022-09-30 08:18:14 +02:00
functions.cpp [clang][Interp] Handle undefined functions better 2022-11-30 10:09:52 +01:00
if.cpp [clang][Interp][NFC] Add more tests for if expressions 2022-10-14 10:21:53 +02:00
literals.cpp [clang][Interp] Implement bitXor opcode 2022-10-30 09:23:33 +01:00
loops.cpp [clang][Interp] Implement for loops 2022-10-26 08:48:36 +02:00
records.cpp [clang][Interp] Explicitly handle RVO Pointer 2022-11-30 10:37:57 +01:00
references.cpp [clang][Interp] Fix record members of reference type 2022-10-28 16:34:45 +02:00
shifts.cpp [clang][Interp] Implement left and right shifts 2022-10-30 08:59:55 +01:00