aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/CodeGen')
-rw-r--r--include/llvm/CodeGen/LiveInterval.h7
-rw-r--r--include/llvm/CodeGen/MachineConstantPool.h5
-rw-r--r--include/llvm/CodeGen/SelectionDAGNodes.h7
3 files changed, 11 insertions, 8 deletions
diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h
index 8e99ee7..c75d594 100644
--- a/include/llvm/CodeGen/LiveInterval.h
+++ b/include/llvm/CodeGen/LiveInterval.h
@@ -25,6 +25,7 @@
#include "llvm/Support/Allocator.h"
#include <iosfwd>
#include <cassert>
+#include <climits>
namespace llvm {
class MachineInstr;
@@ -115,7 +116,7 @@ namespace llvm {
LiveInterval(unsigned Reg, float Weight, bool IsSS = false)
: reg(Reg), weight(Weight), preference(0) {
if (IsSS)
- reg = reg | (1U << (sizeof(unsigned)*8-1));
+ reg = reg | (1U << (sizeof(unsigned)*CHAR_BIT-1));
}
typedef Ranges::iterator iterator;
@@ -159,14 +160,14 @@ namespace llvm {
/// isStackSlot - Return true if this is a stack slot interval.
///
bool isStackSlot() const {
- return reg & (1U << (sizeof(unsigned)*8-1));
+ return reg & (1U << (sizeof(unsigned)*CHAR_BIT-1));
}
/// getStackSlotIndex - Return stack slot index if this is a stack slot
/// interval.
int getStackSlotIndex() const {
assert(isStackSlot() && "Interval is not a stack slot interval!");
- return reg & ~(1U << (sizeof(unsigned)*8-1));
+ return reg & ~(1U << (sizeof(unsigned)*CHAR_BIT-1));
}
bool hasAtLeastOneValue() const { return !valnos.empty(); }
diff --git a/include/llvm/CodeGen/MachineConstantPool.h b/include/llvm/CodeGen/MachineConstantPool.h
index d5bd25c..99996cf 100644
--- a/include/llvm/CodeGen/MachineConstantPool.h
+++ b/include/llvm/CodeGen/MachineConstantPool.h
@@ -17,6 +17,7 @@
#define LLVM_CODEGEN_MACHINECONSTANTPOOL_H
#include <cassert>
+#include <climits>
#include <vector>
namespace llvm {
@@ -81,7 +82,7 @@ public:
MachineConstantPoolEntry(MachineConstantPoolValue *V, unsigned A)
: Alignment(A) {
Val.MachineCPVal = V;
- Alignment |= 1 << (sizeof(unsigned)*8-1);
+ Alignment |= 1 << (sizeof(unsigned)*CHAR_BIT-1);
}
bool isMachineConstantPoolEntry() const {
@@ -89,7 +90,7 @@ public:
}
int getAlignment() const {
- return Alignment & ~(1 << (sizeof(unsigned)*8-1));
+ return Alignment & ~(1 << (sizeof(unsigned)*CHAR_BIT-1));
}
const Type *getType() const;
diff --git a/include/llvm/CodeGen/SelectionDAGNodes.h b/include/llvm/CodeGen/SelectionDAGNodes.h
index 047e612..6cea5d6 100644
--- a/include/llvm/CodeGen/SelectionDAGNodes.h
+++ b/include/llvm/CodeGen/SelectionDAGNodes.h
@@ -32,6 +32,7 @@
#include "llvm/Support/DataTypes.h"
#include "llvm/CodeGen/DebugLoc.h"
#include <cassert>
+#include <climits>
namespace llvm {
@@ -1864,7 +1865,7 @@ protected:
getSDVTList(VT)), Offset(o), Alignment(0) {
assert((int)Offset >= 0 && "Offset is too large");
Val.MachineCPVal = v;
- Offset |= 1 << (sizeof(unsigned)*8-1);
+ Offset |= 1 << (sizeof(unsigned)*CHAR_BIT-1);
}
ConstantPoolSDNode(bool isTarget, MachineConstantPoolValue *v,
MVT VT, int o, unsigned Align)
@@ -1873,7 +1874,7 @@ protected:
getSDVTList(VT)), Offset(o), Alignment(Align) {
assert((int)Offset >= 0 && "Offset is too large");
Val.MachineCPVal = v;
- Offset |= 1 << (sizeof(unsigned)*8-1);
+ Offset |= 1 << (sizeof(unsigned)*CHAR_BIT-1);
}
public:
@@ -1892,7 +1893,7 @@ public:
}
int getOffset() const {
- return Offset & ~(1 << (sizeof(unsigned)*8-1));
+ return Offset & ~(1 << (sizeof(unsigned)*CHAR_BIT-1));
}
// Return the alignment of this constant pool object, which is either 0 (for