Mark more constants unsigned, as warned about by icc (#68).

Patch by Erick Tryzelaar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81116 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands
2009-09-06 12:56:52 +00:00
parent c2d98bc0d6
commit 18f13c66bf
5 changed files with 8 additions and 8 deletions

View File

@@ -89,7 +89,7 @@ public:
MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned A) MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned A)
: Alignment(A) { : Alignment(A) {
Val.MachineCPVal = V; Val.MachineCPVal = V;
Alignment |= 1 << (sizeof(unsigned)*CHAR_BIT-1); Alignment |= 1U << (sizeof(unsigned)*CHAR_BIT-1);
} }
bool isMachineConstantPoolEntry() const { bool isMachineConstantPoolEntry() const {

View File

@@ -58,7 +58,7 @@ struct constantint_ty {
if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) { if (const ConstantInt *CI = dyn_cast<ConstantInt>(V)) {
const APInt &CIV = CI->getValue(); const APInt &CIV = CI->getValue();
if (Val >= 0) if (Val >= 0)
return CIV == Val; return CIV == static_cast<uint64_t>(Val);
// If Val is negative, and CI is shorter than it, truncate to the right // If Val is negative, and CI is shorter than it, truncate to the right
// number of bits. If it is larger, then we have to sign extend. Just // number of bits. If it is larger, then we have to sign extend. Just
// compare their negated values. // compare their negated values.

View File

@@ -26,10 +26,10 @@ using namespace llvm;
// //
static inline unsigned ByteSwap(unsigned Var, bool Really) { static inline unsigned ByteSwap(unsigned Var, bool Really) {
if (!Really) return Var; if (!Really) return Var;
return ((Var & (255<< 0)) << 24) | return ((Var & (255U<< 0U)) << 24U) |
((Var & (255<< 8)) << 8) | ((Var & (255U<< 8U)) << 8U) |
((Var & (255<<16)) >> 8) | ((Var & (255U<<16U)) >> 8U) |
((Var & (255<<24)) >> 24); ((Var & (255U<<24U)) >> 24U);
} }
static unsigned AddCounts(unsigned A, unsigned B) { static unsigned AddCounts(unsigned A, unsigned B) {

View File

@@ -118,7 +118,7 @@ class Briggs {
if (!add) { if (!add) {
udTarget = 1; udTarget = 1;
dir = -1; dir = ~0;
} }
EdgeData &linkEdgeData = g.getEdgeData(edgeItr).getHeuristicData(); EdgeData &linkEdgeData = g.getEdgeData(edgeItr).getHeuristicData();

View File

@@ -645,7 +645,7 @@ X86RegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
// } // }
// [EBP] // [EBP]
MFI->CreateFixedObject(-TailCallReturnAddrDelta, MFI->CreateFixedObject(-TailCallReturnAddrDelta,
(-1*SlotSize)+TailCallReturnAddrDelta); (-1U*SlotSize)+TailCallReturnAddrDelta);
} }
if (hasFP(MF)) { if (hasFP(MF)) {