aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CIR/CodeGen/CIRGenModule.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CIR/CodeGen/CIRGenModule.cpp')
-rw-r--r--clang/lib/CIR/CodeGen/CIRGenModule.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index bd3aa37..e170498 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -61,7 +61,6 @@ CIRGenCXXABI *CreateCIRGenItaniumCXXABI(CIRGenModule &cgm) {
return new CIRGenCXXABI(cgm);
}
} // namespace clang::CIRGen
-CIRGenCXXABI::~CIRGenCXXABI() {}
CIRGenModule::CIRGenModule(mlir::MLIRContext &mlirContext,
clang::ASTContext &astContext,
@@ -251,7 +250,6 @@ void CIRGenModule::emitGlobalFunctionDefinition(clang::GlobalDecl gd,
const CIRGenFunctionInfo &fi = getTypes().arrangeGlobalDeclaration(gd);
cir::FuncType funcType = getTypes().getFunctionType(fi);
-
cir::FuncOp funcOp = dyn_cast_if_present<cir::FuncOp>(op);
if (!funcOp || funcOp.getFunctionType() != funcType) {
funcOp = getAddrOfFunction(gd, funcType, /*ForVTable=*/false,
@@ -539,8 +537,16 @@ void CIRGenModule::emitGlobalDefinition(clang::GlobalDecl gd,
if (const auto *method = dyn_cast<CXXMethodDecl>(decl)) {
// Make sure to emit the definition(s) before we emit the thunks. This is
// necessary for the generation of certain thunks.
- (void)method;
- errorNYI(method->getSourceRange(), "member function");
+ if (isa<CXXConstructorDecl>(method) || isa<CXXDestructorDecl>(method))
+ errorNYI(method->getSourceRange(), "C++ ctor/dtor");
+ else if (fd->isMultiVersion())
+ errorNYI(method->getSourceRange(), "multiversion functions");
+ else
+ emitGlobalFunctionDefinition(gd, op);
+
+ if (method->isVirtual())
+ errorNYI(method->getSourceRange(), "virtual member function");
+
return;
}
@@ -770,6 +776,7 @@ void CIRGenModule::emitTopLevelDecl(Decl *decl) {
decl->getDeclKindName());
break;
+ case Decl::CXXMethod:
case Decl::Function: {
auto *fd = cast<FunctionDecl>(decl);
// Consteval functions shouldn't be emitted.