aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/MachineFunctionAnalysis.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-03-13 20:55:24 +0000
committerChris Lattner <sabre@nondot.org>2010-03-13 20:55:24 +0000
commit11d53c129fc9c2a4510605ec0a1696f58750af52 (patch)
treeaad97e04fdcaa0f1ea6cc6cbacdd11994c8c746b /lib/CodeGen/MachineFunctionAnalysis.cpp
parent355471741b00fbdb0085c6a24b1fdce0c78e84f3 (diff)
rearrange MCContext ownership. Before LLVMTargetMachine created it
and passing off ownership to AsmPrinter. Now MachineModuleInfo creates it and owns it by value. This allows us to use MCSymbols more consistently throughout the rest of the code generator, and simplifies a bit of code. This also allows MachineFunction to keep an MCContext reference handy, and cleans up the TargetRegistry interfaces for AsmPrinters. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineFunctionAnalysis.cpp')
-rw-r--r--lib/CodeGen/MachineFunctionAnalysis.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineFunctionAnalysis.cpp b/lib/CodeGen/MachineFunctionAnalysis.cpp
index 8d87e3e4b1..d3f1d8296d 100644
--- a/lib/CodeGen/MachineFunctionAnalysis.cpp
+++ b/lib/CodeGen/MachineFunctionAnalysis.cpp
@@ -13,6 +13,7 @@
#include "llvm/CodeGen/MachineFunctionAnalysis.h"
#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/CodeGen/MachineModuleInfo.h"
using namespace llvm;
// Register this pass with PassInfo directly to avoid having to define
@@ -36,7 +37,8 @@ MachineFunctionAnalysis::~MachineFunctionAnalysis() {
bool MachineFunctionAnalysis::runOnFunction(Function &F) {
assert(!MF && "MachineFunctionAnalysis already initialized!");
- MF = new MachineFunction(&F, TM, NextFnNum++);
+ MF = new MachineFunction(&F, TM, NextFnNum++,
+ getAnalysis<MachineModuleInfo>().getContext());
return false;
}
@@ -47,4 +49,5 @@ void MachineFunctionAnalysis::releaseMemory() {
void MachineFunctionAnalysis::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
+ AU.addRequired<MachineModuleInfo>();
}