forked from OSchip/llvm-project
[MemorySSA] Add convenience APIs in updater to avoid needing MSSA.
Summary: Ideally passes should not need to pass MSSA around and do all updates through the updater. Add convenience APIs to help with that. Reviewers: george.burgess.iv Subscribers: sanjoy, jlebar, llvm-commits, Prazek Differential Revision: https://reviews.llvm.org/D48334 llvm-svn: 335179
This commit is contained in:
parent
1958497283
commit
04ff58220f
|
@ -138,6 +138,17 @@ public:
|
|||
/// on the MemoryAccess for that store/load.
|
||||
void removeMemoryAccess(MemoryAccess *);
|
||||
|
||||
/// Remove MemoryAccess for a given instruction, if a MemoryAccess exists.
|
||||
/// This should be called when an instruction (load/store) is deleted from
|
||||
/// the program.
|
||||
void removeMemoryAccess(const Instruction *I) {
|
||||
if (MemoryAccess *MA = MSSA->getMemoryAccess(I))
|
||||
removeMemoryAccess(MA);
|
||||
}
|
||||
|
||||
/// Get handle on MemorySSA.
|
||||
MemorySSA* getMemorySSA() const { return MSSA; }
|
||||
|
||||
private:
|
||||
// Move What before Where in the MemorySSA IR.
|
||||
template <class WhereType>
|
||||
|
|
Loading…
Reference in New Issue