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.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/clang/lib/CIR/CodeGen/CIRGenModule.cpp b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
index b4e27bc..bd3aa37 100644
--- a/clang/lib/CIR/CodeGen/CIRGenModule.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenModule.cpp
@@ -249,21 +249,8 @@ void CIRGenModule::emitGlobalFunctionDefinition(clang::GlobalDecl gd,
return;
}
- cir::FuncType funcType;
- // TODO: Move this to arrangeFunctionDeclaration when it is
- // implemented.
- // When declaring a function without a prototype, always use a
- // non-variadic type.
- if (CanQual<FunctionNoProtoType> noProto =
- funcDecl->getType()
- ->getCanonicalTypeUnqualified()
- .getAs<FunctionNoProtoType>()) {
- const CIRGenFunctionInfo &fi = getTypes().arrangeCIRFunctionInfo(
- noProto->getReturnType(), {}, RequiredArgs::All);
- funcType = getTypes().getFunctionType(fi);
- } else {
- funcType = cast<cir::FuncType>(convertType(funcDecl->getType()));
- }
+ 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) {