diff options
Diffstat (limited to 'lib/Target/PowerPC')
-rw-r--r-- | lib/Target/PowerPC/PPCSubtarget.h | 3 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetAsmInfo.cpp | 11 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCTargetAsmInfo.h | 1 |
3 files changed, 14 insertions, 1 deletions
diff --git a/lib/Target/PowerPC/PPCSubtarget.h b/lib/Target/PowerPC/PPCSubtarget.h index be4c21cd44..bb29d44950 100644 --- a/lib/Target/PowerPC/PPCSubtarget.h +++ b/lib/Target/PowerPC/PPCSubtarget.h @@ -141,6 +141,9 @@ public: /// isDarwin - True if this is darwin9 (leopard, 10.5) or above. bool isDarwin9() const { return DarwinVers >= 9; } + /// getDarwinVers - Return the darwin version number, 8 = tiger, 9 = leopard. + unsigned getDarwinVers() const { return DarwinVers; } + bool isMachoABI() const { return isDarwin() || IsPPC64; } bool isELF32_ABI() const { return !isDarwin() && !IsPPC64; } diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp index 4151064c6a..c69e591a66 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp @@ -89,12 +89,21 @@ PPCDarwinTargetAsmInfo::PreferredEHDataFormat(DwarfEncoding::Target Reason, return DW_EH_PE_absptr; } +const char * +PPCDarwinTargetAsmInfo::getEHGlobalPrefix() const +{ + const PPCSubtarget* Subtarget = &TM.getSubtarget<PPCSubtarget>(); + if (Subtarget->getDarwinVers() > 9) + return PrivateGlobalPrefix; + else + return ""; +} PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) : PPCTargetAsmInfo<ELFTargetAsmInfo>(TM) { CommentString = "#"; GlobalPrefix = ""; - PrivateGlobalPrefix = ""; + PrivateGlobalPrefix = ".L"; ConstantPoolSection = "\t.section .rodata.cst4\t"; JumpTableDataSection = ".section .rodata.cst4"; CStringSection = ".rodata.str"; diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.h b/lib/Target/PowerPC/PPCTargetAsmInfo.h index a533d5fc60..edf40c9346 100644 --- a/lib/Target/PowerPC/PPCTargetAsmInfo.h +++ b/lib/Target/PowerPC/PPCTargetAsmInfo.h @@ -48,6 +48,7 @@ namespace llvm { explicit PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM); virtual unsigned PreferredEHDataFormat(DwarfEncoding::Target Reason, bool Global) const; + virtual const char *getEHGlobalPrefix() const; }; struct PPCLinuxTargetAsmInfo : public PPCTargetAsmInfo<ELFTargetAsmInfo> { |