From 80983ca1ca5cdcbd5ce7db017c1987d75cc8184b Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 16 May 2019 16:32:24 -0400 Subject: fixups to the previous commit --- src/codegen.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'src/codegen.cpp') diff --git a/src/codegen.cpp b/src/codegen.cpp index fd7134362f..c8903b7dbf 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -4126,19 +4126,11 @@ static LLVMValueRef get_int_builtin_fn(CodeGen *g, ZigType *int_type, BuiltinFnI char llvm_name[64]; sprintf(llvm_name, "llvm.%s.i%" PRIu32, fn_name, int_type->data.integral.bit_count); - LLVMTypeRef param_types[3]; - switch (n_args) { - case 1: - param_types[0] = get_llvm_type(g, int_type); - break; - case 2: // clz and ctz - param_types[0] = get_llvm_type(g, int_type); - param_types[1] = LLVMInt1Type(); - break; - default: - zig_unreachable(); - } - LLVMTypeRef fn_type = LLVMFunctionType(get_llvm_type(g, int_type), ¶m_types[0], n_args, false); + LLVMTypeRef param_types[] = { + get_llvm_type(g, int_type), + LLVMInt1Type(), + }; + LLVMTypeRef fn_type = LLVMFunctionType(get_llvm_type(g, int_type), param_types, n_args, false); LLVMValueRef fn_val = LLVMAddFunction(g->module, llvm_name, fn_type); assert(LLVMGetIntrinsicID(fn_val)); -- cgit v1.2.3