char AsmPrinter::ID = 0;
AsmPrinter::AsmPrinter(formatted_raw_ostream &o, TargetMachine &tm,
const MCAsmInfo *T, bool VDef)
- : MachineFunctionPass(&ID), FunctionNumber(0), O(o),
+ : MachineFunctionPass(&ID), O(o),
TM(tm), MAI(T), TRI(tm.getRegisterInfo()),
OutContext(*new MCContext()),
delete &OutContext;
}
+/// getFunctionNumber - Return a unique ID for the current function.
+///
+unsigned AsmPrinter::getFunctionNumber() const {
+ return MF->getFunctionNumber();
+}
+
TargetLoweringObjectFile &AsmPrinter::getObjFileLowering() const {
return TM.getTargetLowering()->getObjFileLowering();
}
}
void AsmPrinter::SetupMachineFunction(MachineFunction &MF) {
+ this->MF = &MF;
// Get the function symbol.
CurrentFnSym = GetGlobalValueSymbol(MF.getFunction());
- IncrementFunctionNumber();
if (VerboseAsm)
LI = &getAnalysis<MachineLoopInfo>();