From d61e7071cd8456cebbe25745da6a90a9fa51d3ed Mon Sep 17 00:00:00 2001 From: George Burgess IV Date: Wed, 22 Aug 2018 18:02:46 +0000 Subject: [PATCH] [MemorySSA] Move two simple getters; NFC We're calling these functions quite a bit from outside of MemorySSA.cpp now. Given that they're relatively simple one-liners, I think the style preference is to have them inline. llvm-svn: 340430 --- llvm/include/llvm/Analysis/MemorySSA.h | 9 +++++++-- llvm/lib/Analysis/MemorySSA.cpp | 8 -------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/llvm/include/llvm/Analysis/MemorySSA.h b/llvm/include/llvm/Analysis/MemorySSA.h index d445e44..d35cf6a 100644 --- a/llvm/include/llvm/Analysis/MemorySSA.h +++ b/llvm/include/llvm/Analysis/MemorySSA.h @@ -689,8 +689,13 @@ public: /// access associated with it. If passed a basic block gets the memory phi /// node that exists for that block, if there is one. Otherwise, this will get /// a MemoryUseOrDef. - MemoryUseOrDef *getMemoryAccess(const Instruction *) const; - MemoryPhi *getMemoryAccess(const BasicBlock *BB) const; + MemoryUseOrDef *getMemoryAccess(const Instruction *I) const { + return cast_or_null(ValueToMemoryAccess.lookup(I)); + } + + MemoryPhi *getMemoryAccess(const BasicBlock *BB) const { + return cast_or_null(ValueToMemoryAccess.lookup(cast(BB))); + } void dump() const; void print(raw_ostream &) const; diff --git a/llvm/lib/Analysis/MemorySSA.cpp b/llvm/lib/Analysis/MemorySSA.cpp index 734dee2b..e9063f6 100644 --- a/llvm/lib/Analysis/MemorySSA.cpp +++ b/llvm/lib/Analysis/MemorySSA.cpp @@ -1824,14 +1824,6 @@ void MemorySSA::verifyDefUses(Function &F) const { } } -MemoryUseOrDef *MemorySSA::getMemoryAccess(const Instruction *I) const { - return cast_or_null(ValueToMemoryAccess.lookup(I)); -} - -MemoryPhi *MemorySSA::getMemoryAccess(const BasicBlock *BB) const { - return cast_or_null(ValueToMemoryAccess.lookup(cast(BB))); -} - /// Perform a local numbering on blocks so that instruction ordering can be /// determined in constant time. /// TODO: We currently just number in order. If we numbered by N, we could -- 2.7.4