diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-23 22:08:27 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-23 22:08:27 +0000 |
commit | 8c3fbdc6c4649f8c3c018cf32be4407c672e574c (patch) | |
tree | 4b1501127fddc6956350b27ea9cba6d871ef28ed /llvm/lib/CodeGen/MachineFunctionPass.cpp | |
parent | d0cfb7344e101f656be024d29d9cd0aaefea4288 (diff) | |
download | bcm5719-llvm-8c3fbdc6c4649f8c3c018cf32be4407c672e574c.tar.gz bcm5719-llvm-8c3fbdc6c4649f8c3c018cf32be4407c672e574c.zip |
Revert r279564. It introduces undefined behavior (binding a reference to a
dereferenced null pointer) in MachineModuleInfo::MachineModuleInfo that causes
-Werror builds (including several buildbots) to fail.
llvm-svn: 279580
Diffstat (limited to 'llvm/lib/CodeGen/MachineFunctionPass.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineFunctionPass.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/MachineFunctionPass.cpp b/llvm/lib/CodeGen/MachineFunctionPass.cpp index 43cd2ed64b4..524ebdbf657 100644 --- a/llvm/lib/CodeGen/MachineFunctionPass.cpp +++ b/llvm/lib/CodeGen/MachineFunctionPass.cpp @@ -22,7 +22,7 @@ #include "llvm/Analysis/ScalarEvolution.h" #include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h" #include "llvm/CodeGen/MachineFunction.h" -#include "llvm/CodeGen/MachineModuleInfo.h" +#include "llvm/CodeGen/MachineFunctionAnalysis.h" #include "llvm/CodeGen/Passes.h" #include "llvm/CodeGen/StackProtector.h" #include "llvm/IR/Dominators.h" @@ -41,9 +41,7 @@ bool MachineFunctionPass::runOnFunction(Function &F) { if (F.hasAvailableExternallyLinkage()) return false; - MachineModuleInfo &MMI = getAnalysis<MachineModuleInfo>(); - MachineFunction &MF = MMI.getMachineFunction(F); - + MachineFunction &MF = getAnalysis<MachineFunctionAnalysis>().getMF(); MachineFunctionProperties &MFProps = MF.getProperties(); #ifndef NDEBUG @@ -67,8 +65,8 @@ bool MachineFunctionPass::runOnFunction(Function &F) { } void MachineFunctionPass::getAnalysisUsage(AnalysisUsage &AU) const { - AU.addRequired<MachineModuleInfo>(); - AU.addPreserved<MachineModuleInfo>(); + AU.addRequired<MachineFunctionAnalysis>(); + AU.addPreserved<MachineFunctionAnalysis>(); // MachineFunctionPass preserves all LLVM IR passes, but there's no // high-level way to express this. Instead, just list a bunch of |