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: 2 additions & 0 deletions clang/include/clang/CIR/MissingFeatures.h
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,8 @@ struct MissingFeatures {

// This Itanium bit is currently being skipped in cir.
static bool itaniumRecordLayoutBuilderFinishLayout() { return false; }

static bool mustProgress() { return false; }
};

} // namespace cir
Expand Down
3 changes: 3 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,9 @@ void CIRGenFunction::buildStaticVarDecl(const VarDecl &D,
else if (D.hasAttr<UsedAttr>())
llvm_unreachable("llvm.compiler.used metadata is NYI");

if (CGM.getCodeGenOpts().KeepPersistentStorageVariables)
llvm_unreachable("NYI");

// From traditional codegen:
// We may have to cast the constant because of the initializer
// mismatch above.
Expand Down
10 changes: 9 additions & 1 deletion clang/lib/CIR/CodeGen/CIRGenFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,8 +699,16 @@ CIRGenFunction::generateCode(clang::GlobalDecl GD, mlir::cir::FuncOp Fn,
if (Body && isa_and_nonnull<CoroutineBodyStmt>(Body))
llvm::append_range(FnArgs, FD->parameters());

// Ensure that the function adheres to the forward progress guarantee, which
// is required by certain optimizations.
// In C++11 and up, the attribute will be removed if the body contains a
// trivial empty loop.
if (MissingFeatures::mustProgress())
llvm_unreachable("NYI");

// Generate the body of the function.
// TODO: PGO.assignRegionCounters
assert(!MissingFeatures::shouldInstrumentFunction());
if (isa<CXXDestructorDecl>(FD))
buildDestructorBody(Args);
else if (isa<CXXConstructorDecl>(FD))
Expand Down Expand Up @@ -751,7 +759,7 @@ mlir::Value CIRGenFunction::createLoad(const VarDecl *VD, const char *Name) {
}

void CIRGenFunction::buildConstructorBody(FunctionArgList &Args) {
// TODO: EmitAsanPrologueOrEpilogue(true);
assert(!MissingFeatures::emitAsanPrologueOrEpilogue());
const auto *Ctor = cast<CXXConstructorDecl>(CurGD.getDecl());
auto CtorType = CurGD.getCtorType();

Expand Down
2 changes: 2 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2434,6 +2434,8 @@ mlir::cir::FuncOp CIRGenModule::createRuntimeFunction(
if (AssumeConvergent) {
llvm_unreachable("NYI");
}
if (Local)
llvm_unreachable("NYI");

auto entry = GetOrCreateCIRFunction(Name, Ty, GlobalDecl(),
/*ForVtable=*/false);
Expand Down