Skip to content

Commit ef0c163

Browse files
committed
Address code review comments
1 parent 2858cdc commit ef0c163

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/lib/CIR/CodeGen/CIRGenFunction.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,7 +923,7 @@ CIRGenFunction::emitArrayLength(const clang::ArrayType *origArrayType,
923923
return builder.getConstInt(*currSrcLoc, SizeTy, countFromCLAs);
924924
}
925925

926-
// TODO(cir): most part of this function can be shared between CIRGen
926+
// TODO(cir): Most of this function can be shared between CIRGen
927927
// and traditional LLVM codegen
928928
void CIRGenFunction::emitVariablyModifiedType(QualType type) {
929929
assert(type->isVariablyModifiedType() &&
@@ -942,15 +942,16 @@ void CIRGenFunction::emitVariablyModifiedType(QualType type) {
942942
case Type::HLSLAttributedResource:
943943
case Type::HLSLInlineSpirv:
944944
case Type::PredefinedSugar:
945-
llvm_unreachable("NYI");
945+
cgm.errorNYI("CIRGenFunction::emitVariablyModifiedType");
946946

947947
#define TYPE(Class, Base)
948948
#define ABSTRACT_TYPE(Class, Base)
949949
#define NON_CANONICAL_TYPE(Class, Base)
950950
#define DEPENDENT_TYPE(Class, Base) case Type::Class:
951951
#define NON_CANONICAL_UNLESS_DEPENDENT_TYPE(Class, Base)
952952
#include "clang/AST/TypeNodes.inc"
953-
llvm_unreachable("unexpected dependent type!");
953+
llvm_unreachable(
954+
"dependent type must be resolved before the CIR codegen");
954955

955956
// These types are never variably-modified.
956957
case Type::Builtin:

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,6 @@ cir::GlobalOp CIRGenModule::getGlobalForStringLiteral(const StringLiteral *s,
12101210

12111211
void CIRGenModule::emitExplicitCastExprType(const ExplicitCastExpr *e,
12121212
CIRGenFunction *cgf) {
1213-
// Bind VLAs in the cast type.
12141213
if (cgf && e->getType()->isVariablyModifiedType())
12151214
cgf->emitVariablyModifiedType(e->getType());
12161215

0 commit comments

Comments
 (0)