mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
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
This commit is contained in:
@ -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>();
|
||||
}
|
||||
|
Reference in New Issue
Block a user