1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

[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
This commit is contained in:
George Burgess IV 2018-08-22 18:02:46 +00:00
parent 436a04bdef
commit bad97b0986
2 changed files with 7 additions and 10 deletions

View File

@ -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<MemoryUseOrDef>(ValueToMemoryAccess.lookup(I));
}
MemoryPhi *getMemoryAccess(const BasicBlock *BB) const {
return cast_or_null<MemoryPhi>(ValueToMemoryAccess.lookup(cast<Value>(BB)));
}
void dump() const;
void print(raw_ostream &) const;

View File

@ -1824,14 +1824,6 @@ void MemorySSA::verifyDefUses(Function &F) const {
}
}
MemoryUseOrDef *MemorySSA::getMemoryAccess(const Instruction *I) const {
return cast_or_null<MemoryUseOrDef>(ValueToMemoryAccess.lookup(I));
}
MemoryPhi *MemorySSA::getMemoryAccess(const BasicBlock *BB) const {
return cast_or_null<MemoryPhi>(ValueToMemoryAccess.lookup(cast<Value>(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