mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 21:00:29 +00:00
[MemorySSA] Fix windows build breakage caused by r278028
r278028: [MemorySSA] Ensure address stability of MemorySSA object. llvm-svn: 278035
This commit is contained in:
parent
777026b82c
commit
1ea90914c1
@ -675,7 +675,14 @@ class MemorySSAAnalysis : public AnalysisInfoMixin<MemorySSAAnalysis> {
|
||||
static char PassID;
|
||||
|
||||
public:
|
||||
typedef std::unique_ptr<MemorySSA> Result;
|
||||
// Wrap MemorySSA result to ensure address stability of internal MemorySSA
|
||||
// pointers after construction. Use a wrapper class instead of plain
|
||||
// unique_ptr<MemorySSA> to avoid build breakage on MSVC.
|
||||
struct Result {
|
||||
Result(std::unique_ptr<MemorySSA> &&MSSA) : MSSA(std::move(MSSA)) {}
|
||||
MemorySSA &getMSSA() { return *MSSA.get(); }
|
||||
std::unique_ptr<MemorySSA> MSSA;
|
||||
};
|
||||
|
||||
Result run(Function &F, AnalysisManager<Function> &AM);
|
||||
};
|
||||
|
@ -2078,24 +2078,24 @@ bool MemorySSAPrinterLegacyPass::runOnFunction(Function &F) {
|
||||
|
||||
char MemorySSAAnalysis::PassID;
|
||||
|
||||
std::unique_ptr<MemorySSA>
|
||||
MemorySSAAnalysis::Result
|
||||
MemorySSAAnalysis::run(Function &F, AnalysisManager<Function> &AM) {
|
||||
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
|
||||
auto &AA = AM.getResult<AAManager>(F);
|
||||
return make_unique<MemorySSA>(F, &AA, &DT);
|
||||
return MemorySSAAnalysis::Result(make_unique<MemorySSA>(F, &AA, &DT));
|
||||
}
|
||||
|
||||
PreservedAnalyses MemorySSAPrinterPass::run(Function &F,
|
||||
FunctionAnalysisManager &AM) {
|
||||
OS << "MemorySSA for function: " << F.getName() << "\n";
|
||||
AM.getResult<MemorySSAAnalysis>(F)->print(OS);
|
||||
AM.getResult<MemorySSAAnalysis>(F).getMSSA().print(OS);
|
||||
|
||||
return PreservedAnalyses::all();
|
||||
}
|
||||
|
||||
PreservedAnalyses MemorySSAVerifierPass::run(Function &F,
|
||||
FunctionAnalysisManager &AM) {
|
||||
AM.getResult<MemorySSAAnalysis>(F)->verifyMemorySSA();
|
||||
AM.getResult<MemorySSAAnalysis>(F).getMSSA().verifyMemorySSA();
|
||||
|
||||
return PreservedAnalyses::all();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user