[clang] [CIR] cir.call with scalar return type (PR #135552)

Sirui Mu via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 16 07:23:00 PDT 2025


================
@@ -0,0 +1,92 @@
+//==-- ABIArgInfo.h - Abstract info regarding ABI-specific arguments -------==//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Defines ABIArgInfo and associated types used by CIR to track information
+// regarding ABI-coerced types for function arguments and return values. This
+// was moved to the common library as it might be used by both CIRGen and
+// passes.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_CIR_ABIARGINFO_H
+#define CLANG_CIR_ABIARGINFO_H
+
+#include "mlir/IR/Types.h"
+#include "clang/CIR/MissingFeatures.h"
+
+namespace cir {
+
+class ABIArgInfo {
+public:
+  enum Kind : uint8_t {
+    /// Pass the argument directly using the normal converted CIR type,
+    /// or by coercing to another specified type stored in 'CoerceToType'). If
+    /// an offset is specified (in UIntData), then the argument passed is offset
+    /// by some number of bytes in the memory representation. A dummy argument
+    /// is emitted before the real argument if the specified type stored in
+    /// "PaddingType" is not zero.
+    Direct,
+
+    /// Ignore the argument (treat as void). Useful for void and empty
+    /// structs.
+    Ignore,
+
+    // TODO: more argument kind will be added as the upstreaming proceeds.
----------------
Lancern wrote:

Updated.

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


More information about the cfe-commits mailing list