[clang] [clang] Parse attribute [[gnu::no_stack_protector]] (PR #75289)

2023-12-12 Thread Sirui Mu via cfe-commits
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

[clang] [clang] Parse attribute [[gnu::no_stack_protector]] (PR #75289)

2023-12-12 Thread Sirui Mu via cfe-commits
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

[clang] [clang] Parse attribute [[gnu::no_stack_protector]] (PR #75289)

2023-12-13 Thread Sirui Mu via 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

[clang] [clang] Parse attribute [[gnu::no_stack_protector]] (PR #75289)

2023-12-13 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [clang] Parse attribute [[gnu::no_stack_protector]] (PR #75289)

2023-12-13 Thread Sirui Mu via 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/3] [clang] Parse attribute [[gnu::no_stack_protector]] This commit a

[clang-tools-extra] [clang-tidy] Treat fields in anonymous records as names in enclosing scope when checking name styles (PR #75701)

2023-12-16 Thread Sirui Mu via cfe-commits
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

[clang-tools-extra] [clang-tidy] Treat fields in anonymous records as names in enclosing scope when checking name styles (PR #75701)

2023-12-16 Thread Sirui Mu via 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/3] [clang-tidy] Check anonymous record field naming in enclosing sco

[clang-tools-extra] [clang-tidy] Treat fields in anonymous records as names in enclosing scope when checking name styles (PR #75701)

2023-12-16 Thread Sirui Mu via 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/4] [clang-tidy] Check anonymous record field naming in enclosing sco

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-19 Thread Sirui Mu via cfe-commits
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

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-19 Thread Sirui Mu via cfe-commits
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

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-19 Thread Sirui Mu via cfe-commits
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

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-19 Thread Sirui Mu via cfe-commits
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

[clang-tools-extra] [clang] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-22 Thread Sirui Mu via cfe-commits
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

[clang] [clang][Sema] deleted overriding function can have lax except spec (PR #76248)

2023-12-22 Thread Sirui Mu via cfe-commits
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

[clang] [clang-tools-extra] [Sema][clangd] add noexcept to override functions during code completion (PR #75937)

2023-12-22 Thread Sirui Mu via cfe-commits
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@

[clang-tools-extra] [clang-tidy] Treat fields in anonymous records as names in enclosing scope when checking name styles (PR #75701)

2023-12-26 Thread Sirui Mu via 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

[clang] [clang][Sema] deleted overriding function can have lax except spec (PR #76248)

2023-12-28 Thread Sirui Mu via 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/2] [clang][Sema] deleted overriding function can have lax except spe

[clang] [clang][Sema] deleted overriding function can have lax except spec (PR #76248)

2023-12-28 Thread Sirui Mu via cfe-commits
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

[clang] [clang][Sema] deleted overriding function can have lax except spec (PR #76248)

2023-12-28 Thread Sirui Mu via 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

[clang] [clang][Sema] deleted overriding function can have lax except spec (PR #76248)

2024-01-04 Thread Sirui Mu via 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/5] [clang][Sema] deleted overriding function can have lax except spe

[clang] [CIR] Build out AST consumer patterns to reach the entry point into CIRGen (PR #91007)

2024-05-13 Thread Sirui Mu via cfe-commits
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

[clang] [Sema] Add code completion for if constexpr (PR #124315)

2025-02-01 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-07 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
@@ -1342,6 +1342,47 @@ def FuncOp : CIR_Op<"func", [ let hasVerifier = 1; } +//===--===// +// CallOp +//===--===// + +class CIR_CallOpBase

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via 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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -1242,6 +1242,43 @@ def FuncOp : CIR_Op<"func", [ let hasVerifier = 1; } +//===--===// +// CallOp +//===--===// + +class CIR_CallOp extr

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via 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);

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-09 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Generate the nsw flag correctly for unary ops (PR #133815)

2025-03-31 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via 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);

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -441,6 +441,87 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { return tryFoldCastChain(*this); } +//===--===// +// CallOp +//===---

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -1242,6 +1242,43 @@ def FuncOp : CIR_Op<"func", [ let hasVerifier = 1; } +//===--===// +// CallOp +//===--===// + +class CIR_CallOp extr

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -441,6 +441,87 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { return tryFoldCastChain(*this); } +//===--===// +// CallOp +//===---

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -441,6 +441,87 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { return tryFoldCastChain(*this); } +//===--===// +// CallOp +//===---

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-08 Thread Sirui Mu via cfe-commits
@@ -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

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

2025-04-17 Thread Sirui Mu via cfe-commits
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

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

2025-04-17 Thread Sirui Mu via 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:

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

2025-04-13 Thread Sirui Mu via cfe-commits
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

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

2025-04-13 Thread Sirui Mu via cfe-commits
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

[clang] [llvm] [RISCV] Add processor definition for XiangShan-KunMingHu-V2R2 (PR #123193)

2025-04-20 Thread Sirui Mu via cfe-commits
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

[clang] [Clang] Add support for GCC bound member functions extension (PR #135649)

2025-04-21 Thread Sirui Mu via 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; +//. +//

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

2025-04-17 Thread Sirui Mu via 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:

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-22 Thread Sirui Mu via cfe-commits
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:

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

2025-04-16 Thread Sirui Mu via cfe-commits
@@ -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

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

2025-04-16 Thread Sirui Mu via cfe-commits
@@ -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

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

2025-04-16 Thread Sirui Mu via cfe-commits
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

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

2025-04-16 Thread Sirui Mu via cfe-commits
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

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

2025-04-16 Thread Sirui Mu via 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:

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

2025-04-16 Thread Sirui Mu via cfe-commits
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

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

2025-04-16 Thread Sirui Mu via cfe-commits
@@ -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

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

2025-04-17 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-05-01 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-05-01 Thread Sirui Mu via 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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-05-01 Thread Sirui Mu via cfe-commits
@@ -446,8 +446,31 @@ OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) { // CallOp //===--===// +mlir::Operation::operand_iterator cir::CallOp::arg_operand_begin() { + assert(!cir::MissingFeatures::opCallI

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-05-01 Thread Sirui Mu via cfe-commits
@@ -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.

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-05-01 Thread Sirui Mu via cfe-commits
@@ -1516,6 +1520,41 @@ class CIR_CallOpBase extra_traits = []> !listconcat(extra_traits, [DeclareOpInterfaceMethods, DeclareOpInterfaceMethods])> { + let extraClassDeclaration = [{ +/// Get the argument operands to the c

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-05-01 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-05-01 Thread Sirui Mu via cfe-commits
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

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

2025-04-15 Thread Sirui Mu via cfe-commits
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

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

2025-04-15 Thread Sirui Mu via 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

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

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -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(); +

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

2025-04-15 Thread Sirui Mu via cfe-commits
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

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

2025-04-15 Thread Sirui Mu via 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

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

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -205,13 +205,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { // Call operators //======// - cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee) { -auto op = create(loc

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

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -205,13 +205,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { // Call operators //======// - cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee) { -auto op = create(loc

[clang] [CIR] Upstream initial function call support (PR #134673)

2025-04-10 Thread Sirui Mu via cfe-commits
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

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

2025-04-15 Thread Sirui Mu via 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

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

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -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

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

2025-04-15 Thread Sirui Mu via cfe-commits
@@ -29,13 +32,29 @@ CIRGenCallee CIRGenCallee::prepareConcreteCallee(CIRGenFunction &cgf) const { return *this; } -static const CIRGenFunctionInfo &arrangeFreeFunctionLikeCall(CIRGenTypes &cgt) { +static const CIRGenFunctionInfo & +arrangeFreeFunctionLikeCall(CIRGenTypes &

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

2025-04-15 Thread Sirui Mu via 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

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

2025-04-15 Thread Sirui Mu via 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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-28 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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. +

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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, +

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -214,14 +214,15 @@ class CIRBaseBuilderTy : public mlir::OpBuilder { //======// cir::CallOp createCallOp(mlir::Location loc, mlir::SymbolRefAttr callee, - mlir::Type returnTyp

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -1516,6 +1520,41 @@ class CIR_CallOpBase extra_traits = []> !listconcat(extra_traits, [DeclareOpInterfaceMethods, DeclareOpInterfaceMethods])> { + let extraClassDeclaration = [{ +/// Get the argument operands to the c

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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, +

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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, +

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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, +

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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, +

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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, +

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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);

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
@@ -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

[clang] [CIR] Upstream cir.call with scalar arguments (PR #136810)

2025-04-26 Thread Sirui Mu via cfe-commits
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   2   >