mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
Promote the constant 1 to long long, 1LL or 1ULL in int64_t-sensitive context.
llvm-svn: 168304
This commit is contained in:
parent
bf877af8f1
commit
7652190f5b
@ -80,17 +80,17 @@ private:
|
||||
RelocToApply zeroExtend(RelocToApply r, char Width) {
|
||||
if (Width == r.Width)
|
||||
return r;
|
||||
r.Value &= (1 << ((Width * 8))) - 1;
|
||||
r.Value &= (1LL << ((Width * 8))) - 1;
|
||||
return r;
|
||||
}
|
||||
RelocToApply signExtend(RelocToApply r, char Width) {
|
||||
if (Width == r.Width)
|
||||
return r;
|
||||
bool SignBit = r.Value & (1 << ((Width * 8) - 1));
|
||||
bool SignBit = r.Value & (1LL << ((Width * 8) - 1));
|
||||
if (SignBit) {
|
||||
r.Value |= ~((1 << (Width * 8)) - 1);
|
||||
r.Value |= ~((1LL << (Width * 8)) - 1);
|
||||
} else {
|
||||
r.Value &= (1 << (Width * 8)) - 1;
|
||||
r.Value &= (1LL << (Width * 8)) - 1;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
@ -281,14 +281,14 @@ bool AttrBuilder::hasAlignmentAttr() const {
|
||||
uint64_t AttrBuilder::getAlignment() const {
|
||||
if (!hasAlignmentAttr())
|
||||
return 0;
|
||||
return 1U <<
|
||||
return 1ULL <<
|
||||
(((Bits & AttributesImpl::getAttrMask(Attributes::Alignment)) >> 16) - 1);
|
||||
}
|
||||
|
||||
uint64_t AttrBuilder::getStackAlignment() const {
|
||||
if (!hasAlignmentAttr())
|
||||
return 0;
|
||||
return 1U <<
|
||||
return 1ULL <<
|
||||
(((Bits & AttributesImpl::getAttrMask(Attributes::StackAlignment))>>26)-1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user