Skip to content

Commit f20ef85

Browse files
authored
[CIR][NFC] Fix init llvm::ArrayRef warning (#146147)
Fix init llvm::ArrayRef deprecation warning when initialized with std::nullopt
1 parent 98f7d75 commit f20ef85

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

clang/lib/CIR/CodeGen/CIRGenCall.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ CIRGenTypes::arrangeFunctionDeclaration(const FunctionDecl *fd) {
404404
funcTy.getAs<FunctionNoProtoType>()) {
405405
assert(!cir::MissingFeatures::opCallCIRGenFuncInfoExtParamInfo());
406406
assert(!cir::MissingFeatures::opCallFnInfoOpts());
407-
return arrangeCIRFunctionInfo(noProto->getReturnType(), std::nullopt,
407+
return arrangeCIRFunctionInfo(noProto->getReturnType(), {},
408408
RequiredArgs::All);
409409
}
410410

clang/lib/CIR/CodeGen/CIRGenFunction.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -894,9 +894,8 @@ class CIRGenFunction : public CIRGenTypeCache {
894894

895895
// Build CIR for a statement. useCurrentScope should be true if no
896896
// new scopes need be created when finding a compound statement.
897-
mlir::LogicalResult
898-
emitStmt(const clang::Stmt *s, bool useCurrentScope,
899-
llvm::ArrayRef<const Attr *> attrs = std::nullopt);
897+
mlir::LogicalResult emitStmt(const clang::Stmt *s, bool useCurrentScope,
898+
llvm::ArrayRef<const Attr *> attrs = {});
900899

901900
mlir::LogicalResult emitSimpleStmt(const clang::Stmt *s,
902901
bool useCurrentScope);

0 commit comments

Comments
 (0)