summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-06-03 16:27:49 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-06-03 16:27:49 +0000
commit215921ef94e05672d151c2619f7c52656f69a861 (patch)
tree8cb91809dcd860545a360e94f2a2606de7d80f40 /llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
parent877b30f83c15d31eacd02637a315e4be42a4d179 (diff)
downloadbcm5719-llvm-215921ef94e05672d151c2619f7c52656f69a861.tar.gz
bcm5719-llvm-215921ef94e05672d151c2619f7c52656f69a861.zip
Emit file directives correctly in case of a .bc is generated by llvm-ld after linking in several .bc files.
llvm-svn: 72781
Diffstat (limited to 'llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
index ef3bc4b52a9..b42ee4524be 100644
--- a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
+++ b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
@@ -47,6 +47,7 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
const Function *F = MF.getFunction();
CurrentFnName = Mang->getValueName(F);
+ DbgInfo.EmitFileDirective(F);
// Emit the function variables.
EmitFunctionFrame(MF);
@@ -181,17 +182,11 @@ void PIC16AsmPrinter::printLibcallDecls(void) {
bool PIC16AsmPrinter::doInitialization (Module &M) {
bool Result = AsmPrinter::doInitialization(M);
- DbgInfo.EmitFileDirective(M);
// FIXME:: This is temporary solution to generate the include file.
// The processor should be passed to llc as in input and the header file
// should be generated accordingly.
O << "\n\t#include P16F1937.INC\n";
- MachineModuleInfo *MMI = getAnalysisIfAvailable<MachineModuleInfo>();
- assert(MMI);
- DwarfWriter *DW = getAnalysisIfAvailable<DwarfWriter>();
- assert(DW && "Dwarf Writer is not available");
- DW->BeginModule(&M, MMI, O, this, TAI);
// Set the section names for all globals.
for (Module::global_iterator I = M.global_begin(), E = M.global_end();
@@ -199,13 +194,14 @@ bool PIC16AsmPrinter::doInitialization (Module &M) {
I->setSection(TAI->SectionForGlobal(I)->getName());
}
+ DbgInfo.EmitFileDirective(M);
EmitFunctionDecls(M);
EmitUndefinedVars(M);
EmitDefinedVars(M);
EmitIData(M);
EmitUData(M);
EmitRomData(M);
- DbgInfo.PopulateFunctsDI(M);
+ DbgInfo.PopulateFunctsDI(M);
return Result;
}
@@ -285,7 +281,7 @@ void PIC16AsmPrinter::EmitRomData (Module &M)
bool PIC16AsmPrinter::doFinalization(Module &M) {
printLibcallDecls();
DbgInfo.EmitVarDebugInfo(M);
- O << "\n\t" << ".EOF";
+ DbgInfo.EmitEOF();
O << "\n\t" << "END\n";
bool Result = AsmPrinter::doFinalization(M);
return Result;
OpenPOWER on IntegriCloud