Skip to content

Commit 5a07490

Browse files
committed
[ABI][NFC] Fix the confusion of ByVal and ByRef argument names
The second argument of getNaturalAlignIndirect() was `bool ByRef`, but the implementation was just delegating to getIndirect() with `ByRef` passed unchanged to `bool ByVal` parameter of getIndirect(). Fix a couple of /*ByRef=*/ comments as well. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D85113
1 parent 3d10050 commit 5a07490

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

clang/lib/CodeGen/ABIInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ namespace swiftcall {
111111
/// A convenience method to return an indirect ABIArgInfo with an
112112
/// expected alignment equal to the ABI alignment of the given type.
113113
CodeGen::ABIArgInfo
114-
getNaturalAlignIndirect(QualType Ty, bool ByRef = true,
114+
getNaturalAlignIndirect(QualType Ty, bool ByVal = true,
115115
bool Realign = false,
116116
llvm::Type *Padding = nullptr) const;
117117

clang/lib/CodeGen/TargetInfo.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,17 @@ static bool isAggregateTypeForABI(QualType T) {
8080
T->isMemberFunctionPointerType();
8181
}
8282

83-
ABIArgInfo
84-
ABIInfo::getNaturalAlignIndirect(QualType Ty, bool ByRef, bool Realign,
85-
llvm::Type *Padding) const {
86-
return ABIArgInfo::getIndirect(getContext().getTypeAlignInChars(Ty),
87-
ByRef, Realign, Padding);
83+
ABIArgInfo ABIInfo::getNaturalAlignIndirect(QualType Ty, bool ByVal,
84+
bool Realign,
85+
llvm::Type *Padding) const {
86+
return ABIArgInfo::getIndirect(getContext().getTypeAlignInChars(Ty), ByVal,
87+
Realign, Padding);
8888
}
8989

9090
ABIArgInfo
9191
ABIInfo::getNaturalAlignIndirectInReg(QualType Ty, bool Realign) const {
9292
return ABIArgInfo::getIndirectInReg(getContext().getTypeAlignInChars(Ty),
93-
/*ByRef*/ false, Realign);
93+
/*ByVal*/ false, Realign);
9494
}
9595

9696
Address ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr,
@@ -8555,7 +8555,7 @@ ABIArgInfo LanaiABIInfo::classifyArgumentType(QualType Ty,
85558555
if (RAA == CGCXXABI::RAA_Indirect) {
85568556
return getIndirectResult(Ty, /*ByVal=*/false, State);
85578557
} else if (RAA == CGCXXABI::RAA_DirectInMemory) {
8558-
return getNaturalAlignIndirect(Ty, /*ByRef=*/true);
8558+
return getNaturalAlignIndirect(Ty, /*ByVal=*/true);
85598559
}
85608560
}
85618561

0 commit comments

Comments
 (0)