remove redundant Compiler::memory scale parameter

This commit is contained in:
Joshua Warner
2014-04-30 23:46:26 -06:00
committed by Joshua Warner
parent f9b781149e
commit 9805ff94b4
3 changed files with 66 additions and 101 deletions

View File

@ -2320,15 +2320,16 @@ class MyCompiler: public Compiler {
virtual Operand* memory(Operand* base,
ir::Type type,
int displacement = 0,
Operand* index = 0,
unsigned scale = 1)
Operand* index = 0)
{
assert(&c, index != 0 || scale == 1);
assert(&c, type.size() == scale || index == 0);
Value* result = value(&c, type);
appendMemory(&c, static_cast<Value*>(base), displacement,
static_cast<Value*>(index), scale, result);
appendMemory(&c,
static_cast<Value*>(base),
displacement,
static_cast<Value*>(index),
index == 0 ? 1 : type.size(),
result);
return result;
}