Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clang/lib/CIR/CodeGen/CIRGenDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void CIRGenFunction::emitAutoVarInit(const clang::VarDecl &d) {

void CIRGenFunction::emitAutoVarCleanups(const clang::VarDecl &d) {
// Check the type for a cleanup.
if (QualType::DestructionKind dtorKind = d.needsDestruction(getContext()))
if (d.needsDestruction(getContext()))
cgm.errorNYI(d.getSourceRange(), "emitAutoVarCleanups: type cleanup");

assert(!cir::MissingFeatures::opAllocaPreciseLifetime());
Expand Down
1 change: 1 addition & 0 deletions clang/lib/CIR/CodeGen/CIRGenExprScalar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class ScalarExprEmitter : public StmtVisitor<ScalarExprEmitter, mlir::Value> {

cgf.getCIRGenModule().errorNYI(loc,
"emitScalarConversion for unequal types");
return {};
}
};

Expand Down
12 changes: 5 additions & 7 deletions clang/lib/CIR/CodeGen/CIRGenFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "CIRGenFunction.h"

#include "CIRGenCall.h"
#include "CIRGenValue.h"
#include "mlir/IR/Location.h"
#include "clang/AST/GlobalDecl.h"
#include "clang/CIR/MissingFeatures.h"
Expand Down Expand Up @@ -134,10 +135,9 @@ mlir::Location CIRGenFunction::getLoc(mlir::Location lhs, mlir::Location rhs) {
return mlir::FusedLoc::get(locs, metadata, &getMLIRContext());
}

mlir::LogicalResult CIRGenFunction::declare(mlir::Value addrVal,
const Decl *var, QualType ty,
mlir::Location loc,
CharUnits alignment, bool isParam) {
void CIRGenFunction::declare(mlir::Value addrVal, const Decl *var, QualType ty,
mlir::Location loc, CharUnits alignment,
bool isParam) {
const auto *namedVar = dyn_cast_or_null<NamedDecl>(var);
assert(namedVar && "Needs a named decl");
assert(!cir::MissingFeatures::cgfSymbolTable());
Expand All @@ -147,8 +147,6 @@ mlir::LogicalResult CIRGenFunction::declare(mlir::Value addrVal,
allocaOp.setInitAttr(mlir::UnitAttr::get(&getMLIRContext()));
if (ty->isReferenceType() || ty.isConstQualified())
allocaOp.setConstantAttr(mlir::UnitAttr::get(&getMLIRContext()));

return mlir::success();
}

void CIRGenFunction::startFunction(GlobalDecl gd, QualType returnType,
Expand Down Expand Up @@ -306,7 +304,7 @@ LValue CIRGenFunction::emitLValue(const Expr *e) {
getCIRGenModule().errorNYI(e->getSourceRange(),
std::string("l-value not implemented for '") +
e->getStmtClassName() + "'");
break;
return LValue();
case Expr::DeclRefExprClass:
return emitDeclRefLValue(cast<DeclRefExpr>(e));
}
Expand Down
6 changes: 3 additions & 3 deletions clang/lib/CIR/CodeGen/CIRGenFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ class CIRGenFunction : public CIRGenTypeCache {
private:
/// Declare a variable in the current scope, return success if the variable
/// wasn't declared yet.
mlir::LogicalResult declare(mlir::Value addrVal, const clang::Decl *var,
clang::QualType ty, mlir::Location loc,
clang::CharUnits alignment, bool isParam = false);
void declare(mlir::Value addrVal, const clang::Decl *var, clang::QualType ty,
mlir::Location loc, clang::CharUnits alignment,
bool isParam = false);

public:
mlir::Value emitAlloca(llvm::StringRef name, mlir::Type ty,
Expand Down