Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Lines | |||||
/// getCurrentSection() - Return the current section we are emitting to. | /// getCurrentSection() - Return the current section we are emitting to. | ||||
const MCSection *AsmPrinter::getCurrentSection() const { | const MCSection *AsmPrinter::getCurrentSection() const { | ||||
return OutStreamer->getCurrentSectionOnly(); | return OutStreamer->getCurrentSectionOnly(); | ||||
} | } | ||||
void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const { | void AsmPrinter::getAnalysisUsage(AnalysisUsage &AU) const { | ||||
AU.setPreservesAll(); | AU.setPreservesAll(); | ||||
MachineFunctionPass::getAnalysisUsage(AU); | MachineFunctionPass::getAnalysisUsage(AU); | ||||
AU.addRequired<MachineModuleInfo>(); | AU.addRequired<MachineModuleInfoWrapperPass>(); | ||||
AU.addRequired<MachineOptimizationRemarkEmitterPass>(); | AU.addRequired<MachineOptimizationRemarkEmitterPass>(); | ||||
AU.addRequired<GCModuleInfo>(); | AU.addRequired<GCModuleInfo>(); | ||||
} | } | ||||
bool AsmPrinter::doInitialization(Module &M) { | bool AsmPrinter::doInitialization(Module &M) { | ||||
MMI = getAnalysisIfAvailable<MachineModuleInfo>(); | auto *MMIWP = getAnalysisIfAvailable<MachineModuleInfoWrapperPass>(); | ||||
MMI = MMIWP ? &MMIWP->getMMI() : nullptr; | |||||
// Initialize TargetLoweringObjectFile. | // Initialize TargetLoweringObjectFile. | ||||
const_cast<TargetLoweringObjectFile&>(getObjFileLowering()) | const_cast<TargetLoweringObjectFile&>(getObjFileLowering()) | ||||
.Initialize(OutContext, TM); | .Initialize(OutContext, TM); | ||||
const_cast<TargetLoweringObjectFile &>(getObjFileLowering()) | const_cast<TargetLoweringObjectFile &>(getObjFileLowering()) | ||||
.getModuleMetadata(M); | .getModuleMetadata(M); | ||||
▲ Show 20 Lines • Show All 2,909 Lines • Show Last 20 Lines |