1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00

Silence MSVC warning about unsigned integer overflow, which has defined behavior

llvm-svn: 303693
This commit is contained in:
Reid Kleckner 2017-05-23 21:35:32 +00:00
parent 9515ddb7fd
commit db1d4c56a6

View File

@ -793,7 +793,9 @@ std::string AttributeSetNode::getAsString(bool InAttrGrp) const {
/// ReturnIndex: 0 -> 1
/// FirstArgIndex: 1.. -> 2..
static constexpr unsigned attrIdxToArrayIdx(unsigned Index) {
return Index + 1;
// MSVC warns about '~0U + 1' wrapping around when this is called on
// FunctionIndex, so cast to int first.
return static_cast<int>(Index) + 1;
}
AttributeListImpl::AttributeListImpl(LLVMContext &C,