diff options
| author | Chris Lattner <sabre@nondot.org> | 2009-07-14 18:17:16 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2009-07-14 18:17:16 +0000 |
| commit | 8c9a96b96671b77181f32836d8427e6de1ca5ec1 (patch) | |
| tree | 871751d8e5bb55f7b6f580f86f87ae6e1ec5260c /llvm/lib/Target/PIC16 | |
| parent | 4c21caa656839b43f5a1f87a7ca77cfae59937ec (diff) | |
| download | bcm5719-llvm-8c9a96b96671b77181f32836d8427e6de1ca5ec1.tar.gz bcm5719-llvm-8c9a96b96671b77181f32836d8427e6de1ca5ec1.zip | |
Reapply my previous asmprinter changes now with more testing and two
additional bug fixes:
1. The bug that everyone hit was a problem in the asmprinter where it
would remove $stub but keep the L prefix on a name when emitting the
indirect symbol. This is easy to fix by keeping the name of the stub
and the name of the symbol in a StringMap instead of just keeping a
StringSet and trying to reconstruct it late.
2. There was a problem printing the personality function. The current
logic to print out the personality function from the DWARF information
is a bit of a cesspool right now that duplicates a bunch of other
logic in the asm printer. The short version of it is that it depends
on emitting both the L and _ prefix for symbols (at least on darwin)
and until I can untangle it, it is best to switch the mangler back to
emitting both prefixes.
llvm-svn: 75646
Diffstat (limited to 'llvm/lib/Target/PIC16')
| -rw-r--r-- | llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp index b6401df2878..61d295c2a23 100644 --- a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp +++ b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp @@ -47,7 +47,7 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Get the mangled name. const Function *F = MF.getFunction(); - CurrentFnName = Mang->getValueName(F); + CurrentFnName = Mang->getMangledName(F); // Emit the function frame (args and temps). EmitFunctionFrame(MF); @@ -136,7 +136,7 @@ void PIC16AsmPrinter::printOperand(const MachineInstr *MI, int opNum) { return; case MachineOperand::MO_GlobalAddress: { - O << Mang->getValueName(MO.getGlobal()); + O << Mang->getMangledName(MO.getGlobal()); break; } case MachineOperand::MO_ExternalSymbol: { @@ -222,7 +222,7 @@ void PIC16AsmPrinter::EmitFunctionDecls (Module &M) { // Emit declarations for external functions. O <<"\n"<<TAI->getCommentString() << "Function Declarations - BEGIN." <<"\n"; for (Module::iterator I = M.begin(), E = M.end(); I != E; I++) { - std::string Name = Mang->getValueName(I); + std::string Name = Mang->getMangledName(I); if (Name.compare("@abort") == 0) continue; @@ -252,7 +252,7 @@ void PIC16AsmPrinter::EmitUndefinedVars (Module &M) O << "\n" << TAI->getCommentString() << "Imported Variables - BEGIN" << "\n"; for (unsigned j = 0; j < Items.size(); j++) { - O << TAI->getExternDirective() << Mang->getValueName(Items[j]) << "\n"; + O << TAI->getExternDirective() << Mang->getMangledName(Items[j]) << "\n"; } O << TAI->getCommentString() << "Imported Variables - END" << "\n"; } @@ -265,7 +265,7 @@ void PIC16AsmPrinter::EmitDefinedVars (Module &M) O << "\n" << TAI->getCommentString() << "Exported Variables - BEGIN" << "\n"; for (unsigned j = 0; j < Items.size(); j++) { - O << TAI->getGlobalDirective() << Mang->getValueName(Items[j]) << "\n"; + O << TAI->getGlobalDirective() << Mang->getMangledName(Items[j]) << "\n"; } O << TAI->getCommentString() << "Exported Variables - END" << "\n"; } @@ -281,7 +281,7 @@ void PIC16AsmPrinter::EmitRomData (Module &M) O << "\n"; SwitchToSection(PTAI->ROSections[i]->S_); for (unsigned j = 0; j < Items.size(); j++) { - O << Mang->getValueName(Items[j]); + O << Mang->getMangledName(Items[j]); Constant *C = Items[j]->getInitializer(); int AddrSpace = Items[j]->getType()->getAddressSpace(); EmitGlobalConstant(C, AddrSpace); @@ -300,7 +300,7 @@ bool PIC16AsmPrinter::doFinalization(Module &M) { void PIC16AsmPrinter::EmitFunctionFrame(MachineFunction &MF) { const Function *F = MF.getFunction(); - std::string FuncName = Mang->getValueName(F); + std::string FuncName = Mang->getMangledName(F); const TargetData *TD = TM.getTargetData(); // Emit the data section name. O << "\n"; @@ -354,7 +354,7 @@ void PIC16AsmPrinter::EmitIData (Module &M) { SwitchToSection(IDATASections[i]->S_); std::vector<const GlobalVariable*> Items = IDATASections[i]->Items; for (unsigned j = 0; j < Items.size(); j++) { - std::string Name = Mang->getValueName(Items[j]); + std::string Name = Mang->getMangledName(Items[j]); Constant *C = Items[j]->getInitializer(); int AddrSpace = Items[j]->getType()->getAddressSpace(); O << Name; @@ -373,7 +373,7 @@ void PIC16AsmPrinter::EmitUData (Module &M) { SwitchToSection(BSSSections[i]->S_); std::vector<const GlobalVariable*> Items = BSSSections[i]->Items; for (unsigned j = 0; j < Items.size(); j++) { - std::string Name = Mang->getValueName(Items[j]); + std::string Name = Mang->getMangledName(Items[j]); Constant *C = Items[j]->getInitializer(); const Type *Ty = C->getType(); unsigned Size = TD->getTypeAllocSize(Ty); @@ -401,7 +401,7 @@ void PIC16AsmPrinter::EmitAutos (std::string FunctName) SwitchToSection(AutosSections[i]->S_); std::vector<const GlobalVariable*> Items = AutosSections[i]->Items; for (unsigned j = 0; j < Items.size(); j++) { - std::string VarName = Mang->getValueName(Items[j]); + std::string VarName = Mang->getMangledName(Items[j]); Constant *C = Items[j]->getInitializer(); const Type *Ty = C->getType(); unsigned Size = TD->getTypeAllocSize(Ty); @@ -434,7 +434,7 @@ void PIC16AsmPrinter::EmitRemainingAutos() SwitchToSection(AutosSections[i]->S_); std::vector<const GlobalVariable*> Items = AutosSections[i]->Items; for (unsigned j = 0; j < Items.size(); j++) { - std::string VarName = Mang->getValueName(Items[j]); + std::string VarName = Mang->getMangledName(Items[j]); Constant *C = Items[j]->getInitializer(); const Type *Ty = C->getType(); unsigned Size = TD->getTypeAllocSize(Ty); |

