atrosinenko created this revision. atrosinenko added reviewers: majnemer, rjmccall, jpienaar. Herald added a project: clang. atrosinenko requested review of this revision.
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 the comment in getNaturalAlignIndirectInReg() as well. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D85113 Files: clang/lib/CodeGen/ABIInfo.h clang/lib/CodeGen/TargetInfo.cpp Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -80,17 +80,17 @@ T->isMemberFunctionPointerType(); } -ABIArgInfo -ABIInfo::getNaturalAlignIndirect(QualType Ty, bool ByRef, bool Realign, - llvm::Type *Padding) const { - return ABIArgInfo::getIndirect(getContext().getTypeAlignInChars(Ty), - ByRef, Realign, Padding); +ABIArgInfo ABIInfo::getNaturalAlignIndirect(QualType Ty, bool ByVal, + bool Realign, + llvm::Type *Padding) const { + return ABIArgInfo::getIndirect(getContext().getTypeAlignInChars(Ty), ByVal, + Realign, Padding); } ABIArgInfo ABIInfo::getNaturalAlignIndirectInReg(QualType Ty, bool Realign) const { return ABIArgInfo::getIndirectInReg(getContext().getTypeAlignInChars(Ty), - /*ByRef*/ false, Realign); + /*ByVal*/ false, Realign); } Address ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, @@ -8557,7 +8557,7 @@ if (RAA == CGCXXABI::RAA_Indirect) { return getIndirectResult(Ty, /*ByVal=*/false, State); } else if (RAA == CGCXXABI::RAA_DirectInMemory) { - return getNaturalAlignIndirect(Ty, /*ByRef=*/true); + return getNaturalAlignIndirect(Ty, /*ByVal=*/true); } } Index: clang/lib/CodeGen/ABIInfo.h =================================================================== --- clang/lib/CodeGen/ABIInfo.h +++ clang/lib/CodeGen/ABIInfo.h @@ -111,7 +111,7 @@ /// A convenience method to return an indirect ABIArgInfo with an /// expected alignment equal to the ABI alignment of the given type. CodeGen::ABIArgInfo - getNaturalAlignIndirect(QualType Ty, bool ByRef = true, + getNaturalAlignIndirect(QualType Ty, bool ByVal = true, bool Realign = false, llvm::Type *Padding = nullptr) const;
Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -80,17 +80,17 @@ T->isMemberFunctionPointerType(); } -ABIArgInfo -ABIInfo::getNaturalAlignIndirect(QualType Ty, bool ByRef, bool Realign, - llvm::Type *Padding) const { - return ABIArgInfo::getIndirect(getContext().getTypeAlignInChars(Ty), - ByRef, Realign, Padding); +ABIArgInfo ABIInfo::getNaturalAlignIndirect(QualType Ty, bool ByVal, + bool Realign, + llvm::Type *Padding) const { + return ABIArgInfo::getIndirect(getContext().getTypeAlignInChars(Ty), ByVal, + Realign, Padding); } ABIArgInfo ABIInfo::getNaturalAlignIndirectInReg(QualType Ty, bool Realign) const { return ABIArgInfo::getIndirectInReg(getContext().getTypeAlignInChars(Ty), - /*ByRef*/ false, Realign); + /*ByVal*/ false, Realign); } Address ABIInfo::EmitMSVAArg(CodeGenFunction &CGF, Address VAListAddr, @@ -8557,7 +8557,7 @@ if (RAA == CGCXXABI::RAA_Indirect) { return getIndirectResult(Ty, /*ByVal=*/false, State); } else if (RAA == CGCXXABI::RAA_DirectInMemory) { - return getNaturalAlignIndirect(Ty, /*ByRef=*/true); + return getNaturalAlignIndirect(Ty, /*ByVal=*/true); } } Index: clang/lib/CodeGen/ABIInfo.h =================================================================== --- clang/lib/CodeGen/ABIInfo.h +++ clang/lib/CodeGen/ABIInfo.h @@ -111,7 +111,7 @@ /// A convenience method to return an indirect ABIArgInfo with an /// expected alignment equal to the ABI alignment of the given type. CodeGen::ABIArgInfo - getNaturalAlignIndirect(QualType Ty, bool ByRef = true, + getNaturalAlignIndirect(QualType Ty, bool ByVal = true, bool Realign = false, llvm::Type *Padding = nullptr) const;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits