Don't use module context here. It's unnecessary and makes it harder to write unittests
authorDaniel Berlin <dberlin@dberlin.org>
Sun, 7 Feb 2016 02:03:39 +0000 (02:03 +0000)
committerDaniel Berlin <dberlin@dberlin.org>
Sun, 7 Feb 2016 02:03:39 +0000 (02:03 +0000)
llvm-svn: 260015

llvm/lib/Transforms/Utils/MemorySSA.cpp

index 9f72a97..54133f0 100644 (file)
@@ -375,11 +375,11 @@ MemoryAccess *MemorySSA::createNewAccess(Instruction *I, bool IgnoreNonMemory) {
 
   MemoryUseOrDef *MA;
   if (Def)
-    MA = new MemoryDef(I->getModule()->getContext(), nullptr, I, I->getParent(),
+    MA = new MemoryDef(I->getContext(), nullptr, I, I->getParent(),
                        NextID++);
   else
     MA =
-        new MemoryUse(I->getModule()->getContext(), nullptr, I, I->getParent());
+        new MemoryUse(I->getContext(), nullptr, I, I->getParent());
   InstructionToMemoryAccess.insert(std::make_pair(I, MA));
   return MA;
 }