https://github.com/Lancern created
https://github.com/llvm/llvm-project/pull/75289
This commit adds relative TableGen definitions to parse the
[[gnu::no_stack_protector]] attribute.
This PR addresses issue #75235.
>From d8de529580101ba68dc1c981aec8711aa0c58da4 Mon Sep 17 00:00:00 2001
From: S
https://github.com/Lancern edited
https://github.com/llvm/llvm-project/pull/75289
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/75289
>From d8de529580101ba68dc1c981aec8711aa0c58da4 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Wed, 13 Dec 2023 06:51:09 +
Subject: [PATCH 1/2] [clang] Parse attribute [[gnu::no_stack_protector]]
This commit a
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -fsyntax-only -verify -std=c23 %s
Lancern wrote:
My concern is that names such as `attr-no-stack-protector.cpp` are too
"specific". No other single attribute has its dedicated test file under the
test directory.
https://gith
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/75289
>From d8de529580101ba68dc1c981aec8711aa0c58da4 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Wed, 13 Dec 2023 06:51:09 +
Subject: [PATCH 1/3] [clang] Parse attribute [[gnu::no_stack_protector]]
This commit a
https://github.com/Lancern created
https://github.com/llvm/llvm-project/pull/75701
Currently, fields in anonymous records are treated as normal record members
during naming style check. This can be undesirable in certain situations since
these fields are used just like names in their enclosing
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/75701
>From 5d04ca8091fc81fad8e33355a0afcce290bf34f0 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sat, 16 Dec 2023 21:55:24 +0800
Subject: [PATCH 1/3] [clang-tidy] Check anonymous record field naming in
enclosing sco
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/75701
>From 5d04ca8091fc81fad8e33355a0afcce290bf34f0 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sat, 16 Dec 2023 21:55:24 +0800
Subject: [PATCH 1/4] [clang-tidy] Check anonymous record field naming in
enclosing sco
https://github.com/Lancern created
https://github.com/llvm/llvm-project/pull/75937
If a virtual function is declared with `noexcept`, functions that override this
function in the derived classes must be declared with `noexcept` as well. This
PR updates code completion in clang Sema. It adds `n
Lancern wrote:
> I didn't see anything reflecting this condition; are you still working on
> this patch?
No, this is not a WIP. I primarily changed the
`CodeCompletionResult::createCodeCompletionStringForDecl` function, which is
called during code completion to generate the override function
Lancern wrote:
> For the test, it would be better to write it in [this
> format](https://github.com/llvm/llvm-project/tree/main/clang/test/CodeCompletion)
> rather than using clangd.
Thanks for your helpful review. I'll move the test to
[clang/test/CodeCompletion/overrides.cpp](https://github
Lancern wrote:
> The place you're patching is not only specific to "completing override
> functions", but handles all completion strings involving function
> declarations.
OK. I'll move the changes to the
`CodeCompletionResult::createCodeCompletionStringForOverride` function which
seems like
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/75937
>From 6e5e6986559a8d8a72901baf60cbc3b9163a7cd7 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Tue, 19 Dec 2023 22:24:23 +0800
Subject: [PATCH 1/3] [clangd][Sema] add noexcept to override functions during
code com
https://github.com/Lancern created
https://github.com/llvm/llvm-project/pull/76248
According to [CWG1351](https://cplusplus.github.io/CWG/issues/1351.html),
overriding functions that are defined as deleted can have more lax exception
specifications compared to the base version. For example, th
Lancern wrote:
> Feel free to put up a PR / issue for this if you are interested.
Hi Younan. FYI, I have opened a new PR that addresses this problem. See #76248.
https://github.com/llvm/llvm-project/pull/75937
___
cfe-commits mailing list
cfe-commits@
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/75701
>From 5d04ca8091fc81fad8e33355a0afcce290bf34f0 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sat, 16 Dec 2023 21:55:24 +0800
Subject: [PATCH 1/5] [clang-tidy] Check anonymous record field naming in
enclosing sco
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/76248
>From c219e38a7953b5bd494554760043053ae3b8ff60 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sat, 23 Dec 2023 00:02:08 +0800
Subject: [PATCH 1/2] [clang][Sema] deleted overriding function can have lax
except spe
Lancern wrote:
Oops, code formatter formats unrelated code. Revert and re-commit.
https://github.com/llvm/llvm-project/pull/76248
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/76248
>From c219e38a7953b5bd494554760043053ae3b8ff60 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sat, 23 Dec 2023 00:02:08 +0800
Subject: [PATCH 1/4] [clang][Sema] deleted overriding function can have lax
except spe
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/76248
>From c219e38a7953b5bd494554760043053ae3b8ff60 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sat, 23 Dec 2023 00:02:08 +0800
Subject: [PATCH 1/5] [clang][Sema] deleted overriding function can have lax
except spe
Lancern wrote:
FWIW, the current practice uses CamelCase for CIRGen and camelBack for all
other CIR stuff. Most code in CIRGen is directly ported from clang CodeGen and
the code style is kept as-is, while other part of CIR is invented from scratch
and we follow MLIR style guides. I'm not sure
https://github.com/Lancern requested changes to this pull request.
Thanks for working on this! Please add a test for your patch. You can take
tests under `clang/test/CodeCompletion` for reference.
https://github.com/llvm/llvm-project/pull/124315
___
c
https://github.com/Lancern created
https://github.com/llvm/llvm-project/pull/134673
This PR upstreams initial support for making function calls in CIR. Function
arguments and return values are not included to keep the patch small for review.
Related to #132487
>From 82f6ce93ca22dd778173100231
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/134673
>From 88a41a88abbc32e02fb65efc64c830a723932302 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Tue, 8 Apr 2025 22:54:24 +0800
Subject: [PATCH] [CIR] Upstream initial function call support
---
.../CIR/Dialect/Bui
@@ -1342,6 +1342,47 @@ def FuncOp : CIR_Op<"func", [
let hasVerifier = 1;
}
+//===--===//
+// CallOp
+//===--===//
+
+class CIR_CallOpBase
Lancern wrote:
I'm going to merge this once the CI is green.
https://github.com/llvm/llvm-project/pull/134673
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Lancern closed
https://github.com/llvm/llvm-project/pull/134673
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1242,6 +1242,43 @@ def FuncOp : CIR_Op<"func", [
let hasVerifier = 1;
}
+//===--===//
+// CallOp
+//===--===//
+
+class CIR_CallOp extr
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) {
llvm_unreachable("bad evaluation kind");
}
+static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) {
+ assert(!cir::MissingFeatures::weakRefReference());
+ return cgm.getAddrOfF
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) {
llvm_unreachable("bad evaluation kind");
}
+static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) {
+ assert(!cir::MissingFeatures::weakRefReference());
+ return cgm.getAddrOfF
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) {
llvm_unreachable("bad evaluation kind");
}
+static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) {
+ assert(!cir::MissingFeatures::weakRefReference());
+ return cgm.getAddrOfF
@@ -304,6 +305,102 @@ RValue CIRGenFunction::emitAnyExpr(const Expr *e) {
llvm_unreachable("bad evaluation kind");
}
+static cir::FuncOp emitFunctionDeclPointer(CIRGenModule &cgm, GlobalDecl gd) {
+ assert(!cir::MissingFeatures::weakRefReference());
+ return cgm.getAddrOfF
@@ -281,3 +281,33 @@ bool CIRGenTypes::isZeroInitializable(clang::QualType t) {
return true;
}
+
+const CIRGenFunctionInfo &CIRGenTypes::arrangeCIRFunctionInfo() {
+ // Lookup or create unique function info.
+ llvm::FoldingSetNodeID id;
+ CIRGenFunctionInfo::Profile(id);
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/134673
>From 6995ca5f0ecd34a9f1c2e28de93d0b555264de25 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Tue, 8 Apr 2025 22:54:24 +0800
Subject: [PATCH] [CIR] Upstream initial function call support
---
.../CIR/Dialect/Bui
@@ -0,0 +1,34 @@
+//==-- CIRGenFunctionInfo.h - Representation of fn argument/return types
---==//
+//
+// 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: Apa
https://github.com/Lancern approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/133815
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -281,3 +281,33 @@ bool CIRGenTypes::isZeroInitializable(clang::QualType t) {
return true;
}
+
+const CIRGenFunctionInfo &CIRGenTypes::arrangeCIRFunctionInfo() {
+ // Lookup or create unique function info.
+ llvm::FoldingSetNodeID id;
+ CIRGenFunctionInfo::Profile(id);
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/134673
>From c2f4fa2b38b13665039509e04d8d364df2899754 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Tue, 8 Apr 2025 22:54:24 +0800
Subject: [PATCH] [CIR] Upstream initial function call support
---
.../CIR/Dialect/Bui
@@ -441,6 +441,87 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) {
return tryFoldCastChain(*this);
}
+//===--===//
+// CallOp
+//===---
@@ -1242,6 +1242,43 @@ def FuncOp : CIR_Op<"func", [
let hasVerifier = 1;
}
+//===--===//
+// CallOp
+//===--===//
+
+class CIR_CallOp extr
@@ -441,6 +441,87 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) {
return tryFoldCastChain(*this);
}
+//===--===//
+// CallOp
+//===---
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/134673
>From 8cd0b282523a602b0e4677d9b2f556c8014ca72d Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Tue, 8 Apr 2025 22:54:24 +0800
Subject: [PATCH] [CIR] Upstream initial function call support
---
.../CIR/Dialect/Bui
@@ -403,6 +403,26 @@ class CIRGenFunction : public CIRGenTypeCache {
mlir::LogicalResult emitContinueStmt(const clang::ContinueStmt &s);
mlir::LogicalResult emitDoStmt(const clang::DoStmt &s);
+ /// An abstract representation of regular/ObjC call/message targets.
+ class
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/134673
>From cd34ab6e29c88a617b5e9b943be6670ed5a5792b Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Tue, 8 Apr 2025 22:54:24 +0800
Subject: [PATCH] [CIR] Upstream initial function call support
---
.../CIR/Dialect/Bui
@@ -403,6 +403,26 @@ class CIRGenFunction : public CIRGenTypeCache {
mlir::LogicalResult emitContinueStmt(const clang::ContinueStmt &s);
mlir::LogicalResult emitDoStmt(const clang::DoStmt &s);
+ /// An abstract representation of regular/ObjC call/message targets.
+ class
@@ -441,6 +441,87 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) {
return tryFoldCastChain(*this);
}
+//===--===//
+// CallOp
+//===---
@@ -466,8 +468,17 @@ CIRGenModule::createCIRFunction(mlir::Location loc,
StringRef name,
{
mlir::OpBuilder::InsertionGuard guard(builder);
+// Some global emissions are triggered while emitting a function, e.g.
+// void s() { x.method() }
+//
+// Be sure
https://github.com/Lancern closed
https://github.com/llvm/llvm-project/pull/135552
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -18,9 +18,12 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create() {
- // For now we just create an empty CIRGenFunctionInfo.
- CIRGenFunctionInfo *fi = new CIRGenFunctionInfo();
+CIRGenFunctionInfo *CIRGenFunctionInfo:
https://github.com/Lancern created
https://github.com/llvm/llvm-project/pull/135552
This PR introduces support for calling functions with a scalar return type to
the upstream. This PR also includes an initial version of `CIRGenTargetInfo`
and related definitions which are essential for the CIR
Lancern wrote:
The CI failure on code formatting seems to be a problem in the code formatter
script itself rather than in the patch content.
https://github.com/llvm/llvm-project/pull/135552
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https
https://github.com/Lancern closed
https://github.com/llvm/llvm-project/pull/123193
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,105 @@
+// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
UTC_ARGS: --check-globals all --version 5
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -Wno-pmf-conversions %s -O3
-emit-llvm -o - | FileCheck %s
+
+struct A {
+ int data;
+//.
+//
@@ -18,9 +18,12 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create() {
- // For now we just create an empty CIRGenFunctionInfo.
- CIRGenFunctionInfo *fi = new CIRGenFunctionInfo();
+CIRGenFunctionInfo *CIRGenFunctionInfo:
https://github.com/Lancern created
https://github.com/llvm/llvm-project/pull/136810
This PR upstreams support for scalar arguments in `cir.call` operation.
Related to #132487 .
>From 557cae2daea53723010390cdf545721dd9ad7de4 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Wed, 23 Apr 2025 12:14:
@@ -14,9 +14,14 @@ using namespace clang::CIRGen;
CIRGenTypes::CIRGenTypes(CIRGenModule &genModule)
: cgm(genModule), astContext(genModule.getASTContext()),
- builder(cgm.getBuilder()) {}
+ builder(cgm.getBuilder()),
+ theABIInfo(cgm.getTargetCIRGenInfo().ge
@@ -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: Apa
Lancern wrote:
> I'd still love it if we could get one of the Code gen owners to let us know
> what is going on with this/see if this is somethign they want for classic
> codegen, but they can RAC.
Could we open an issue to track this?
https://github.com/llvm/llvm-project/pull/135552
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/135552
>From cf894c58a8058956b296e499c84ccd528121addf Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sun, 13 Apr 2025 23:34:21 +0800
Subject: [PATCH] [CIR] cir.call with scalar return type
This patch introduces support
@@ -18,9 +18,12 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create() {
- // For now we just create an empty CIRGenFunctionInfo.
- CIRGenFunctionInfo *fi = new CIRGenFunctionInfo();
+CIRGenFunctionInfo *CIRGenFunctionInfo:
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/135552
>From fcb21d172d382a3b6608bb3c4dcb4ede3f43611c Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sun, 13 Apr 2025 23:34:21 +0800
Subject: [PATCH] [CIR] cir.call with scalar return type
This patch introduces support
@@ -303,14 +305,23 @@ const CIRGenFunctionInfo
&CIRGenTypes::arrangeCIRFunctionInfo() {
assert(!cir::MissingFeatures::opCallCallConv());
// Construction the function info. We co-allocate the ArgInfos.
- fi = CIRGenFunctionInfo::create();
+ fi = CIRGenFunctionInfo::creat
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/135552
>From 0d5b4290c6bbcf8654e6898bb20182c252243e07 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sun, 13 Apr 2025 23:34:21 +0800
Subject: [PATCH] [CIR] cir.call with scalar return type
This patch introduces support
https://github.com/Lancern closed
https://github.com/llvm/llvm-project/pull/136810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/136810
>From e5e7bd931dd409546d04237bd61eab67d6ba6451 Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Fri, 2 May 2025 00:31:08 +0800
Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments
---
.../CIR/Dialect/Bu
@@ -446,8 +446,31 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) {
// CallOp
//===--===//
+mlir::Operation::operand_iterator cir::CallOp::arg_operand_begin() {
+ assert(!cir::MissingFeatures::opCallI
@@ -21,9 +21,24 @@ let cppNamespace = "::cir" in {
// The CIRCallOpInterface must be used instead of CallOpInterface when
looking
// at arguments and other bits of CallOp. This creates a level of abstraction
// that's useful for handling indirect calls and other details.
@@ -1516,6 +1520,41 @@ class CIR_CallOpBase
extra_traits = []>
!listconcat(extra_traits,
[DeclareOpInterfaceMethods,
DeclareOpInterfaceMethods])> {
+ let extraClassDeclaration = [{
+/// Get the argument operands to the c
Lancern wrote:
Rebased onto the latest `main`. Will land later if no one have more comments.
https://github.com/llvm/llvm-project/pull/136810
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/136810
>From e9334137d0d1b968ac4d0e59af9f1b04e6b639ac Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Fri, 2 May 2025 00:31:08 +0800
Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments
---
.../CIR/Dialect/Bu
https://github.com/Lancern edited
https://github.com/llvm/llvm-project/pull/135552
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,89 @@
+//==-- 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: Apa
@@ -0,0 +1,50 @@
+#include "TargetInfo.h"
+#include "ABIInfo.h"
+#include "CIRGenFunctionInfo.h"
+#include "clang/CIR/MissingFeatures.h"
+
+using namespace clang;
+using namespace clang::CIRGen;
+
+static bool testIfIsVoidTy(QualType ty) {
+ const auto *builtinTy = ty->getAs();
+
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/135552
>From f930508ec33ca9c2f1d0b68e14901bffa10af9da Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Sun, 13 Apr 2025 23:34:21 +0800
Subject: [PATCH] [CIR] cir.call with scalar return type
This patch introduces support
@@ -0,0 +1,89 @@
+//==-- 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: Apa
@@ -205,13 +205,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
// Call operators
//======//
- cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee) {
-auto op = create(loc
@@ -205,13 +205,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
// Call operators
//======//
- cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee) {
-auto op = create(loc
Lancern wrote:
Resolved conflicts.
https://github.com/llvm/llvm-project/pull/134673
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -87,9 +110,48 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
assert(!cir::MissingFeatures::opCallMustTail());
assert(!cir::MissingFeatures::opCallReturn());
- // For now we just return nothing because we don't have support for return
- // valu
@@ -515,9 +519,32 @@ verifyCallCommInSymbolUses(mlir::Operation *op,
return op->emitOpError() << "'" << fnAttr.getValue()
<< "' does not reference a valid function";
- // TODO(cir): verify function arguments and return type
+ auto callIf = dy
@@ -29,13 +32,29 @@ CIRGenCallee
CIRGenCallee::prepareConcreteCallee(CIRGenFunction &cgf) const {
return *this;
}
-static const CIRGenFunctionInfo &arrangeFreeFunctionLikeCall(CIRGenTypes &cgt)
{
+static const CIRGenFunctionInfo &
+arrangeFreeFunctionLikeCall(CIRGenTypes &
@@ -0,0 +1,89 @@
+//==-- 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: Apa
@@ -0,0 +1,89 @@
+//==-- 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: Apa
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
@@ -1496,6 +1496,10 @@ def FuncOp : CIR_Op<"func", [
return getFunctionType().getReturnTypes();
}
+// TODO(cir): this should be an operand attribute, but for now we just
hard-
+// wire this as a function. Will later add a $no_proto argument to this op.
+
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/136810
>From 8f7b72f8dfe2e4fb32669a344f95be7ce04dae3d Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Wed, 23 Apr 2025 12:14:40 +0800
Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments
---
.../CIR/Dialect/B
@@ -214,14 +214,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder {
//======//
cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee,
- mlir::Type returnTyp
@@ -152,3 +303,105 @@ RValue CIRGenFunction::emitCall(const CIRGenFunctionInfo
&funcInfo,
return ret;
}
+
+void CIRGenFunction::emitCallArg(CallArgList &args, const clang::Expr *e,
+ clang::QualType argType) {
+ assert(argType->isReferenceTy
@@ -1516,6 +1520,41 @@ class CIR_CallOpBase
extra_traits = []>
!listconcat(extra_traits,
[DeclareOpInterfaceMethods,
DeclareOpInterfaceMethods])> {
+ let extraClassDeclaration = [{
+/// Get the argument operands to the c
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -68,20 +168,70 @@ static cir::CIRCallOpInterface
emitCallLikeOp(CIRGenFunction &cgf,
assert(builder.getInsertionBlock() && "expected valid basic block");
assert(!cir::MissingFeatures::opCallIndirect());
- return builder.createCallOp(callLoc, directFuncOp);
+ return b
@@ -18,22 +18,118 @@
using namespace clang;
using namespace clang::CIRGen;
-CIRGenFunctionInfo *CIRGenFunctionInfo::create(CanQualType resultType) {
- void *buffer = operator new(totalSizeToAlloc(1));
+CIRGenFunctionInfo *
+CIRGenFunctionInfo::create(CanQualType resultType,
+
@@ -17,3 +17,15 @@ int f4() {
// CHECK-LABEL: cir.func @f4() -> !s32i
// CHECK: %[[#x:]] = cir.call @f3() : () -> !s32i
// CHECK-NEXT:cir.store %[[#x]], %{{.+}} : !s32i, !cir.ptr
+
+int f5(int a, int *b, bool c);
+int f6() {
+ int b = 1;
+ return f5(2, &b, false);
@@ -32,7 +32,13 @@ void X8664ABIInfo::computeInfo(CIRGenFunctionInfo &funcInfo)
const {
// Top level CIR has unlimited arguments and return types. Lowering for ABI
// specific concerns should happen during a lowering phase. Assume everything
// is direct for now.
- asse
https://github.com/Lancern updated
https://github.com/llvm/llvm-project/pull/136810
>From 6fa07927f48cc820fe7babe6d85a32e8e6cc781b Mon Sep 17 00:00:00 2001
From: Sirui Mu
Date: Wed, 23 Apr 2025 12:14:40 +0800
Subject: [PATCH] [CIR] Upstream cir.call with scalar arguments
---
.../CIR/Dialect/B
1 - 100 of 135 matches
Mail list logo