Skip to content

Commit abe3b90

Browse files
authored
[CIR] Fix warnings, again! (#135284)
The calleeDecl var will be used in the near future, so I left it. At least for clang, the [[maybe_unused]] attribute takes care of the warnings related to that variable. The other warning was a simple lack of return after errorNYI.
1 parent cb974dc commit abe3b90

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

clang/lib/CIR/CodeGen/CIRGenFunction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class CIRGenFunction : public CIRGenTypeCache {
164164
/// An abstract representation of regular/ObjC call/message targets.
165165
class AbstractCallee {
166166
/// The function declaration of the callee.
167-
const clang::Decl *calleeDecl;
167+
[[maybe_unused]] const clang::Decl *calleeDecl;
168168

169169
public:
170170
AbstractCallee() : calleeDecl(nullptr) {}

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ CIRGenModule::getOrCreateCIRGlobal(StringRef mangledName, mlir::Type ty,
262262
}
263263

264264
errorNYI(d->getSourceRange(), "reference of undeclared global");
265+
return {};
265266
}
266267

267268
cir::GlobalOp

0 commit comments

Comments
 (0)