AmrDeveloper wrote:
> I have mixed feelings about this change. It mostly overlaps with what I am
> working on, which is class `LexicalScope`, which has a bunch of the code for
> handling the return value. I think I would prefer that this PR be dropped, as
> the changes will be part of the PR I
https://github.com/AmrDeveloper closed
https://github.com/llvm/llvm-project/pull/129933
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
dkolsen-pgi wrote:
I have mixed feelings about this change. It mostly overlaps with what I am
working on, which is class `LexicalScope`, which has a bunch of the code for
handling the return value. I think I would prefer that this PR be dropped, as
the changes will be part of the PR I am wor
@@ -195,7 +195,16 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType
returnType,
mlir::Location fnBodyBegin = getLoc(fd->getBody()->getBeginLoc());
builder.CIRBaseBuilderTy::createStore(fnBodyBegin, paramVal, addrVal);
}
+
assert(builder.getInsertionBlo
@@ -312,4 +326,12 @@ LValue CIRGenFunction::emitLValue(const Expr *e) {
}
}
+void CIRGenFunction::emitAndUpdateRetAlloca(QualType ty, mlir::Location loc,
+CharUnits alignment) {
+ if (ty->isVoidType()) {
+return;
+ }
+
--
@@ -13,8 +13,9 @@ void voidret() { return; }
int intfunc() { return 42; }
// CHECK: cir.func @intfunc() -> !cir.int {
-// CHECK: %0 = cir.const #cir.int<42> : !cir.int
-// CHECK: cir.return %0 : !cir.int
+// CHECK: %0 = cir.alloca !cir.int, !cir.ptr>,
["__retval"] {alig
@@ -13,8 +13,9 @@ void voidret() { return; }
int intfunc() { return 42; }
// CHECK: cir.func @intfunc() -> !cir.int {
-// CHECK: %0 = cir.const #cir.int<42> : !cir.int
-// CHECK: cir.return %0 : !cir.int
+// CHECK: %0 = cir.alloca !cir.int, !cir.ptr>,
["__retval"] {alig
@@ -49,6 +49,8 @@ class CIRGenFunction : public CIRGenTypeCache {
public:
clang::QualType fnRetTy;
erichkeane wrote:
Actually I question the need for `fnRetTy` too, particularly since
`fnRetQualTy` and `fnRetTy` are not being set together...
https://githu
@@ -195,7 +195,16 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType
returnType,
mlir::Location fnBodyBegin = getLoc(fd->getBody()->getBeginLoc());
builder.CIRBaseBuilderTy::createStore(fnBodyBegin, paramVal, addrVal);
}
+
assert(builder.getInsertionBlo
@@ -213,6 +222,11 @@ mlir::LogicalResult CIRGenFunction::emitFunctionBody(const
clang::Stmt *body) {
cir::FuncOp CIRGenFunction::generateCode(clang::GlobalDecl gd, cir::FuncOp fn,
cir::FuncType funcType) {
const auto funcDecl = cast(g
@@ -195,7 +195,16 @@ void CIRGenFunction::startFunction(GlobalDecl gd, QualType
returnType,
mlir::Location fnBodyBegin = getLoc(fd->getBody()->getBeginLoc());
builder.CIRBaseBuilderTy::createStore(fnBodyBegin, paramVal, addrVal);
}
+
assert(builder.getInsertionBlo
llvmbot wrote:
@llvm/pr-subscribers-clangir
Author: Amr Hesham (AmrDeveloper)
Changes
This change adds support for the basic case of emitAndUpdateRetAlloca
---
Full diff: https://github.com/llvm/llvm-project/pull/129933.diff
3 Files Affected:
- (modified) clang/lib/CIR/CodeGen/CIRGenFu
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Amr Hesham (AmrDeveloper)
Changes
This change adds support for the basic case of emitAndUpdateRetAlloca
---
Full diff: https://github.com/llvm/llvm-project/pull/129933.diff
3 Files Affected:
- (modified) clang/lib/CIR/CodeGen/CIRGenFunc
https://github.com/AmrDeveloper created
https://github.com/llvm/llvm-project/pull/129933
This change adds support for the basic case of emitAndUpdateRetAlloca
>From 1db2baafe9ed0ab360517810144300db0e7410f6 Mon Sep 17 00:00:00 2001
From: AmrDeveloper
Date: Wed, 5 Mar 2025 18:18:07 +0100
Subject
14 matches
Mail list logo