[PATCH] D41999: Refactor handling of signext/zeroext in ABIArgInfo
Alex Bradbury via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 12 10:21:50 PST 2018
asb created this revision.
asb added a reviewer: rjmccall.
Herald added subscribers: cfe-commits, arichardson.
As @rjmccall suggested in https://reviews.llvm.org/D40023, we can get rid of ABIInfo::shouldSignExtUnsignedType (used to handle cases like the Mips calling convention where 32-bit integers are always sign extended regardless of the sign of the type) by adding a SignExt field to ABIArgInfo. In the common case, this new field is set automatically by ABIArgInfo::getExtend based on the sign of the type. For targets that want greater control, they can use ABIArgInfo::getSignExtend or ABIArgInfo::getZeroExtend when necessary. This change also cleans up logic in CGCall.cpp.
There is no functional change intended in this patch, and all tests pass unchanged. As noted in https://reviews.llvm.org/D40023, Mips might want to 32-bit integer return types. A future patch might modify MipsABIInfo::classifyReturnType to use MipsABIInfo::extendType.
Repository:
rC Clang
https://reviews.llvm.org/D41999
Files:
include/clang/CodeGen/CGFunctionInfo.h
lib/CodeGen/ABIInfo.h
lib/CodeGen/CGCall.cpp
lib/CodeGen/TargetInfo.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D41999.129654.patch
Type: text/x-patch
Size: 15370 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180112/feb60483/attachment-0001.bin>
More information about the cfe-commits
mailing list