[clang] [llvm] [RISCV][VLS] Support RISCV VLS calling convention (PR #100346)
Brandon Wu via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 9 10:02:47 PST 2024
================
@@ -8031,6 +8034,28 @@ static bool handleFunctionTypeAttr(TypeProcessingState &state, ParsedAttr &attr,
CallingConv CCOld = fn->getCallConv();
Attr *CCAttr = getCCTypeAttr(S.Context, attr);
+ if (attr.getKind() == ParsedAttr::AT_RISCVVLSCC) {
+ // If the riscv_abi_vlen doesn't have any argument, we set set it to 2 to
+ // differentiate from functions without attribute.
+ unsigned ABIVLen = 2;
+ if (attr.getNumArgs() &&
+ !S.checkUInt32Argument(attr, attr.getArgAsExpr(0), ABIVLen))
+ return false;
+ if (ABIVLen != 2 && (ABIVLen < 32 || ABIVLen > 65536)) {
----------------
4vtomat wrote:
Correct, let me use another way to check lol
https://github.com/llvm/llvm-project/pull/100346
More information about the llvm-commits
mailing list