Push LLVMContext through the PatternMatch API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75255 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Owen Anderson
2009-07-10 17:35:01 +00:00
parent 3ca524e336
commit c7d2ce7047
4 changed files with 193 additions and 164 deletions

View File

@ -96,7 +96,8 @@ bool AddressingModeMatcher::MatchScaledValue(Value *ScaleReg, int64_t Scale,
// X*Scale + C*Scale to addr mode.
ConstantInt *CI = 0; Value *AddLHS = 0;
if (isa<Instruction>(ScaleReg) && // not a constant expr.
match(ScaleReg, m_Add(m_Value(AddLHS), m_ConstantInt(CI)))) {
match(ScaleReg, m_Add(m_Value(AddLHS), m_ConstantInt(CI)),
*MemoryInst->getParent()->getContext())) {
TestAddrMode.ScaledReg = AddLHS;
TestAddrMode.BaseOffs += CI->getSExtValue()*TestAddrMode.Scale;