[clang] [llvm] [RISCV][VLS] Support RISCV VLS calling convention (PR #100346)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 21:58:23 PDT 2024


================
@@ -7920,6 +7923,18 @@ 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, default ABI_VLEN is 128.
+    unsigned ABIVLen = 128;
+    if (attr.getNumArgs() &&
+        !S.checkUInt32Argument(attr, attr.getArgAsExpr(0), ABIVLen))
+      return false;
+
+    auto EI = unwrapped.get()->getExtInfo().withLog2RISCVABIVLen(
----------------
topperc wrote:

Is `unwrapped.get()` the same as `fn`?

https://github.com/llvm/llvm-project/pull/100346


More information about the llvm-commits mailing list