Fixed source comments. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73184 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjiv Gupta 2009-06-11 06:49:55 +00:00
parent cbdbcb12fc
commit b65d1f23ca

View File

@ -33,8 +33,9 @@ bool PIC16AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
return true; return true;
} }
/// runOnMachineFunction - This uses the printInstruction() /// runOnMachineFunction - This emits the frame section, autos section and
/// method to print assembly for each instruction. /// assembly for each instruction. Also takes care of function begin debug
/// directive and file begin debug directive (if required) for the function.
/// ///
bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) { bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
this->MF = &MF; this->MF = &MF;
@ -47,20 +48,25 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
const Function *F = MF.getFunction(); const Function *F = MF.getFunction();
CurrentFnName = Mang->getValueName(F); CurrentFnName = Mang->getValueName(F);
// Emit .file directive.
DbgInfo.EmitFileDirective(F); DbgInfo.EmitFileDirective(F);
// Emit the function variables.
// Emit the function frame (args and temps).
EmitFunctionFrame(MF); EmitFunctionFrame(MF);
// Emit function begin debug directives // Emit function begin debug directive.
DbgInfo.EmitFunctBeginDI(F); DbgInfo.EmitFunctBeginDI(F);
// Emit the autos section of function.
EmitAutos(CurrentFnName); EmitAutos(CurrentFnName);
// Now emit the instructions of function in its code section.
const char *codeSection = PAN::getCodeSectionName(CurrentFnName).c_str(); const char *codeSection = PAN::getCodeSectionName(CurrentFnName).c_str();
const Section *fCodeSection = TAI->getNamedSection(codeSection, const Section *fCodeSection = TAI->getNamedSection(codeSection,
SectionFlags::Code); SectionFlags::Code);
O << "\n";
// Start the Code Section. // Start the Code Section.
O << "\n";
SwitchToSection (fCodeSection); SwitchToSection (fCodeSection);
// Emit the frame address of the function at the beginning of code. // Emit the frame address of the function at the beginning of code.
@ -77,14 +83,17 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Print out code for the function. // Print out code for the function.
for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
I != E; ++I) { I != E; ++I) {
// Print a label for the basic block. // Print a label for the basic block.
if (I != MF.begin()) { if (I != MF.begin()) {
printBasicBlockLabel(I, true); printBasicBlockLabel(I, true);
O << '\n'; O << '\n';
} }
// Print a basic block.
for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
II != E; ++II) { II != E; ++II) {
// Emit the line directive if source line changed. // Emit the line directive if source line changed.
const DebugLoc DL = II->getDebugLoc(); const DebugLoc DL = II->getDebugLoc();
if (!DL.isUnknown()) { if (!DL.isUnknown()) {
@ -102,6 +111,7 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
// Emit function end debug directives. // Emit function end debug directives.
DbgInfo.EmitFunctEndDI(F, CurLine); DbgInfo.EmitFunctEndDI(F, CurLine);
return false; // we didn't modify anything. return false; // we didn't modify anything.
} }