aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunction.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFunction.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineFunction.cpp b/llvm/lib/CodeGen/MachineFunction.cpp
index 464f389..7a2d573 100644
--- a/llvm/lib/CodeGen/MachineFunction.cpp
+++ b/llvm/lib/CodeGen/MachineFunction.cpp
@@ -1176,8 +1176,7 @@ static bool CanShareConstantPoolEntry(const Constant *A, const Constant *B,
/// Create a new entry in the constant pool or return an existing one.
/// User must specify the log2 of the minimum required alignment for the object.
unsigned MachineConstantPool::getConstantPoolIndex(const Constant *C,
- unsigned Alignment) {
- assert(Alignment && "Alignment must be specified!");
+ Align Alignment) {
if (Alignment > PoolAlignment) PoolAlignment = Alignment;
// Check to see if we already have this constant.
@@ -1186,7 +1185,7 @@ unsigned MachineConstantPool::getConstantPoolIndex(const Constant *C,
for (unsigned i = 0, e = Constants.size(); i != e; ++i)
if (!Constants[i].isMachineConstantPoolEntry() &&
CanShareConstantPoolEntry(Constants[i].Val.ConstVal, C, DL)) {
- if ((unsigned)Constants[i].getAlignment() < Alignment)
+ if (Constants[i].getAlign() < Alignment)
Constants[i].Alignment = Alignment;
return i;
}
@@ -1196,8 +1195,7 @@ unsigned MachineConstantPool::getConstantPoolIndex(const Constant *C,
}
unsigned MachineConstantPool::getConstantPoolIndex(MachineConstantPoolValue *V,
- unsigned Alignment) {
- assert(Alignment && "Alignment must be specified!");
+ Align Alignment) {
if (Alignment > PoolAlignment) PoolAlignment = Alignment;
// Check to see if we already have this constant.
@@ -1223,7 +1221,7 @@ void MachineConstantPool::print(raw_ostream &OS) const {
Constants[i].Val.MachineCPVal->print(OS);
else
Constants[i].Val.ConstVal->printAsOperand(OS, /*PrintType=*/false);
- OS << ", align=" << Constants[i].getAlignment();
+ OS << ", align=" << Constants[i].getAlign().value();
OS << "\n";
}
}