clang 22.0.0git
CIRGenCXX.cpp
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This contains code dealing with C++ code generation.
10//
11//===----------------------------------------------------------------------===//
12
13#include "CIRGenFunction.h"
14#include "CIRGenModule.h"
15
18
19using namespace clang;
20using namespace clang::CIRGen;
21
23 const CIRGenFunctionInfo &fnInfo =
25 cir::FuncType funcType = getTypes().getFunctionType(fnInfo);
26 cir::FuncOp fn = getAddrOfCXXStructor(gd, &fnInfo, /*FnType=*/nullptr,
27 /*DontDefer=*/true, ForDefinition);
28 setFunctionLinkage(gd, fn);
29 CIRGenFunction cgf{*this, builder};
30 curCGF = &cgf;
31 {
32 mlir::OpBuilder::InsertionGuard guard(builder);
33 cgf.generateCode(gd, fn, funcType);
34 }
35 curCGF = nullptr;
36
37 setNonAliasAttributes(gd, fn);
39 return fn;
40}
cir::FuncOp getAddrOfCXXStructor(clang::GlobalDecl gd, const CIRGenFunctionInfo *fnInfo=nullptr, cir::FuncType fnType=nullptr, bool dontDefer=false, ForDefinition_t isForDefinition=NotForDefinition)
Definition: CIRGenModule.h:240
cir::FuncOp codegenCXXStructor(clang::GlobalDecl gd)
Definition: CIRGenCXX.cpp:22
void setFunctionLinkage(GlobalDecl gd, cir::FuncOp f)
Definition: CIRGenModule.h:418
const CIRGenFunctionInfo & arrangeCXXStructorDeclaration(clang::GlobalDecl gd)
Definition: CIRGenCall.cpp:179
cir::FuncType getFunctionType(const CIRGenFunctionInfo &info)
Get the CIR function type for.
Definition: CIRGenCall.cpp:50
GlobalDecl - represents a global declaration.
Definition: GlobalDecl.h:57
The JSON file list parser is used to communicate input to InstallAPI.
static bool opFuncAttributesForDefinition()