mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-05 09:24:28 +00:00
Promote the constant 1 to long long, 1LL or 1ULL in int64_t-sensitive context.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168304 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -80,17 +80,17 @@ private:
|
|||||||
RelocToApply zeroExtend(RelocToApply r, char Width) {
|
RelocToApply zeroExtend(RelocToApply r, char Width) {
|
||||||
if (Width == r.Width)
|
if (Width == r.Width)
|
||||||
return r;
|
return r;
|
||||||
r.Value &= (1 << ((Width * 8))) - 1;
|
r.Value &= (1LL << ((Width * 8))) - 1;
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
RelocToApply signExtend(RelocToApply r, char Width) {
|
RelocToApply signExtend(RelocToApply r, char Width) {
|
||||||
if (Width == r.Width)
|
if (Width == r.Width)
|
||||||
return r;
|
return r;
|
||||||
bool SignBit = r.Value & (1 << ((Width * 8) - 1));
|
bool SignBit = r.Value & (1LL << ((Width * 8) - 1));
|
||||||
if (SignBit) {
|
if (SignBit) {
|
||||||
r.Value |= ~((1 << (Width * 8)) - 1);
|
r.Value |= ~((1LL << (Width * 8)) - 1);
|
||||||
} else {
|
} else {
|
||||||
r.Value &= (1 << (Width * 8)) - 1;
|
r.Value &= (1LL << (Width * 8)) - 1;
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -281,14 +281,14 @@ bool AttrBuilder::hasAlignmentAttr() const {
|
|||||||
uint64_t AttrBuilder::getAlignment() const {
|
uint64_t AttrBuilder::getAlignment() const {
|
||||||
if (!hasAlignmentAttr())
|
if (!hasAlignmentAttr())
|
||||||
return 0;
|
return 0;
|
||||||
return 1U <<
|
return 1ULL <<
|
||||||
(((Bits & AttributesImpl::getAttrMask(Attributes::Alignment)) >> 16) - 1);
|
(((Bits & AttributesImpl::getAttrMask(Attributes::Alignment)) >> 16) - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t AttrBuilder::getStackAlignment() const {
|
uint64_t AttrBuilder::getStackAlignment() const {
|
||||||
if (!hasAlignmentAttr())
|
if (!hasAlignmentAttr())
|
||||||
return 0;
|
return 0;
|
||||||
return 1U <<
|
return 1ULL <<
|
||||||
(((Bits & AttributesImpl::getAttrMask(Attributes::StackAlignment))>>26)-1);
|
(((Bits & AttributesImpl::getAttrMask(Attributes::StackAlignment))>>26)-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user