diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-30 16:53:38 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-04-30 16:53:38 +0000 |
commit | dd27530a44a763ff44a86f4a7175ce70427dbdc1 (patch) | |
tree | cdfda887a63b192e79fe9b6eb50ab421655f9126 /llvm/lib/IR/Attributes.cpp | |
parent | 52501033d0935fd221c7278ccee478192a435d8d (diff) | |
download | llvm-dd27530a44a763ff44a86f4a7175ce70427dbdc1.zip llvm-dd27530a44a763ff44a86f4a7175ce70427dbdc1.tar.gz llvm-dd27530a44a763ff44a86f4a7175ce70427dbdc1.tar.bz2 |
Change getSlotIndex to return unsigned.
The actual storage was already using unsigned, but the interface was using
uint64_t. This is wasteful on 32 bits and looks to be the root causes of
a miscompilation on Windows where a value was being sign extended to 64bits
to compare with the result of getSlotIndex.
Patch by Pasi Parviainen!
llvm-svn: 180791
Diffstat (limited to 'llvm/lib/IR/Attributes.cpp')
-rw-r--r-- | llvm/lib/IR/Attributes.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/IR/Attributes.cpp b/llvm/lib/IR/Attributes.cpp index 065f772..2443b34 100644 --- a/llvm/lib/IR/Attributes.cpp +++ b/llvm/lib/IR/Attributes.cpp @@ -501,7 +501,7 @@ std::string AttributeSetNode::getAsString(bool TargetIndependent, // AttributeSetImpl Definition //===----------------------------------------------------------------------===// -uint64_t AttributeSetImpl::Raw(uint64_t Index) const { +uint64_t AttributeSetImpl::Raw(unsigned Index) const { for (unsigned I = 0, E = getNumAttributes(); I != E; ++I) { if (getSlotIndex(I) != Index) continue; const AttributeSetNode *ASN = AttrNodes[I].second; @@ -889,7 +889,7 @@ unsigned AttributeSet::getNumSlots() const { return pImpl ? pImpl->getNumAttributes() : 0; } -uint64_t AttributeSet::getSlotIndex(unsigned Slot) const { +unsigned AttributeSet::getSlotIndex(unsigned Slot) const { assert(pImpl && Slot < pImpl->getNumAttributes() && "Slot # out of range!"); return pImpl->getSlotIndex(Slot); |