You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 12, 2024. It is now read-only.
While returning composite types by value (i.e. ret %Range %r) seems to be valid LLVM's IR, Clang doesn't generate correct assembly code from it and returned value isn't placed on the stack where the caller expects to find it. For C++ functions that return custom types by value, Clang generates IR with an output parameter:
struct Foo { long long a; long long b; long long c; };
Foo ReturnByValue(long long x) { return {x, 3, 7}; }
define void @ReturnByValue(%struct.Foo* noalias sret %0, i64 %1) {
...
ret void
}
However, the spec requires to always pass and return %Range by value.