fix(compiler): Handle size_t explicitly in JITLambdaArgumentAdaptor::addArgument

On some systems, size_t does not alias any of the fixed-size, unsigned
integer types and therefore needs to be treated explicitly in
`JITLambdaArgumentAdaptor::addArgument` to prevent the function from
failing with an unknown argument type.

Closes issue #369: Bug: MacOS tests failing on master due to
IntLambdaArgument<size_t>.
This commit is contained in:
Andi Drebes
2022-01-10 16:54:48 +01:00
parent 2d852165f6
commit 7fdeb61aa8

View File

@@ -199,9 +199,12 @@ public:
// to `jla` failed.
static inline llvm::Error addArgument(JITLambda::Argument &jla, size_t pos,
const LambdaArgument &arg) {
// Try the supported integer types; size_t needs explicit
// treatment, since it may alias none of the fixed size integer
// types
llvm::Expected<bool> successOrError =
JITLambdaArgumentAdaptor::tryAddArg<uint64_t, uint32_t, uint16_t,
uint8_t>(jla, pos, arg);
uint8_t, size_t>(jla, pos, arg);
if (!successOrError)
return std::move(successOrError.takeError());