Push LLVMContext through the PatternMatch API.
[oota-llvm.git] / lib / Transforms / Utils / AddrModeMatcher.cpp
index 71049fa212d319a34033d18bb170142d48e95001..7a2bf8587b1d629f886ff1c138870ae5a93038a5 100644 (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;