Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/AST/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4911,8 +4911,8 @@ std::optional<NullabilityKind> Type::getNullability() const {
bool Type::canHaveNullability(bool ResultIfUnknown) const {
QualType type = getCanonicalTypeInternal();

// We'll only see canonical types here.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, maybe move this inside the define, like:

#define NON_CANONICAL_TYPE(Class, Parent)                                      \
  // We'll only see canonical types here.                                      \
  case Type::Class:                                                            \
    llvm_unreachable("non-canonical type");

(Not that the comment is really useful, but I don't want to modify it in a format-fixing commit.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in latest commit, thanks!

switch (type->getTypeClass()) {
// We'll only see canonical types here.
#define NON_CANONICAL_TYPE(Class, Parent) \
case Type::Class: \
llvm_unreachable("non-canonical type");
Expand Down
28 changes: 14 additions & 14 deletions clang/lib/CodeGen/CGCall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,10 @@ arrangeFreeFunctionLikeCall(CodeGenTypes &CGT, CodeGenModule &CGM,
addExtParameterInfosForCall(paramInfos, proto, numExtraRequiredArgs,
args.size());

// If we don't have a prototype at all, but we're supposed to
// explicitly use the variadic convention for unprototyped calls,
// treat all of the arguments as required but preserve the nominal
// possibility of variadics.
// If we don't have a prototype at all, but we're supposed to
// explicitly use the variadic convention for unprototyped calls,
// treat all of the arguments as required but preserve the nominal
// possibility of variadics.
} else if (CGM.getTargetCodeGenInfo().isNoProtoCallVariadic(
args, cast<FunctionNoProtoType>(fnType))) {
required = RequiredArgs(args.size());
Expand Down Expand Up @@ -4064,7 +4064,7 @@ void CodeGenFunction::EmitFunctionEpilog(const CGFunctionInfo &FI,
if (results.size() == 1) {
RV = results[0];

// Otherwise, we need to make a first-class aggregate.
// Otherwise, we need to make a first-class aggregate.
} else {
// Construct a return type that lacks padding elements.
llvm::Type *returnType = RetAI.getUnpaddedCoerceAndExpandType();
Expand Down Expand Up @@ -4203,11 +4203,11 @@ void CodeGenFunction::EmitDelegateCallArg(CallArgList &args,
if (type->isReferenceType()) {
args.add(RValue::get(Builder.CreateLoad(local)), type);

// In ARC, move out of consumed arguments so that the release cleanup
// entered by StartFunction doesn't cause an over-release. This isn't
// optimal -O0 code generation, but it should get cleaned up when
// optimization is enabled. This also assumes that delegate calls are
// performed exactly once for a set of arguments, but that should be safe.
// In ARC, move out of consumed arguments so that the release cleanup
// entered by StartFunction doesn't cause an over-release. This isn't
// optimal -O0 code generation, but it should get cleaned up when
// optimization is enabled. This also assumes that delegate calls are
// performed exactly once for a set of arguments, but that should be safe.
} else if (getLangOpts().ObjCAutoRefCount &&
param->hasAttr<NSConsumedAttr>() && type->isObjCRetainableType()) {
llvm::Value *ptr = Builder.CreateLoad(local);
Expand All @@ -4216,8 +4216,8 @@ void CodeGenFunction::EmitDelegateCallArg(CallArgList &args,
Builder.CreateStore(null, local);
args.add(RValue::get(ptr), type);

// For the most part, we just need to load the alloca, except that
// aggregate r-values are actually pointers to temporaries.
// For the most part, we just need to load the alloca, except that
// aggregate r-values are actually pointers to temporaries.
} else {
args.add(convertTempToRValue(local, type, loc), type);
}
Expand Down Expand Up @@ -4309,7 +4309,7 @@ static void emitWriteback(CodeGenFunction &CGF,
// Release the old value.
CGF.EmitARCRelease(oldValue, srcLV.isARCPreciseLifetime());

// Otherwise, we can just do a normal lvalue store.
// Otherwise, we can just do a normal lvalue store.
} else {
CGF.EmitStoreThroughLValue(RValue::get(value), srcLV);
}
Expand Down Expand Up @@ -4350,7 +4350,7 @@ static void emitWritebackArg(CodeGenFunction &CGF, CallArgList &args,
if (const Expr *lvExpr = maybeGetUnaryAddrOfOperand(CRE->getSubExpr())) {
srcLV = CGF.EmitLValue(lvExpr);

// Otherwise, just emit it as a scalar.
// Otherwise, just emit it as a scalar.
} else {
Address srcAddr = CGF.EmitPointerWithAlignment(CRE->getSubExpr());

Expand Down
Loading