/// special global used by LLVM. If so, emit it and return true, otherwise
/// do nothing and return false.
bool EmitSpecialLLVMGlobal(const GlobalVariable *GV);
-
+
public:
//===------------------------------------------------------------------===//
/// LEB 128 number encoding.
/// debug tables.
void printDeclare(const MachineInstr *MI) const;
+ /// getMangler - Return Mangler used by the AsmPrinter. This is used by
+ /// DWARF debug info generator.
+ Mangler *getMangler() { return Mang; }
+
/// postInstructionAction - Handling printing of items after the
/// instruction iteself has been printed (e.g. comments)
void postInstructionAction(const MachineInstr &MI) const {
#include "llvm/Module.h"
#include "llvm/CodeGen/MachineModuleInfo.h"
#include "llvm/Support/Timer.h"
+#include "llvm/Support/Mangler.h"
#include "llvm/System/Path.h"
#include "llvm/Target/TargetAsmInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
AddString(GVDie, dwarf::DW_AT_name, dwarf::DW_FORM_string, Name);
std::string LinkageName;
GV.getLinkageName(LinkageName);
- if (!LinkageName.empty())
+ if (!LinkageName.empty()) {
+ Mangler *Mg = Asm->getMangler();
AddString(GVDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
- LinkageName);
+ Mg ? Mg->makeNameProper(LinkageName) : LinkageName);
+ }
AddType(DW_Unit, GVDie, GV.getType());
if (!GV.isLocalToUnit())
AddUInt(GVDie, dwarf::DW_AT_external, dwarf::DW_FORM_flag, 1);
std::string LinkageName;
SP.getLinkageName(LinkageName);
- if (!LinkageName.empty())
+ if (!LinkageName.empty()) {
+ Mangler *Mg = Asm->getMangler();
AddString(SPDie, dwarf::DW_AT_MIPS_linkage_name, dwarf::DW_FORM_string,
- LinkageName);
+ Mg ? Mg->makeNameProper(LinkageName) : LinkageName);
+ }
AddSourceLine(SPDie, &SP);