diff options
Diffstat (limited to 'llvm/lib/Target/PowerPC')
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp | 14 | ||||
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetAsmInfo.h | 5 | ||||
| -rw-r--r-- | llvm/lib/Target/PowerPC/PPCTargetMachine.cpp | 5 |
3 files changed, 13 insertions, 11 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp index 36cf2a5570d..25920da0fe9 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp @@ -12,19 +12,21 @@ //===----------------------------------------------------------------------===// #include "PPCTargetAsmInfo.h" +#include "llvm/ADT/Triple.h" using namespace llvm; -PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(bool is64Bit) { +PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const Triple &TheTriple) + : DarwinTargetAsmInfo(TheTriple) { PCSymbol = "."; CommentString = ";"; ExceptionsType = ExceptionHandling::Dwarf; - if (!is64Bit) + if (TheTriple.getArch() != Triple::ppc64) Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode. AssemblerDialect = 1; // New-Style mnemonics. } -PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) { +PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const Triple &TheTriple) { CommentString = "#"; GlobalPrefix = ""; PrivateGlobalPrefix = ".L"; @@ -41,13 +43,15 @@ PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(bool is64Bit) { HasLEB128 = true; // Target asm supports leb128 directives (little-endian) // Exceptions handling - if (!is64Bit) + if (TheTriple.getArch() != Triple::ppc64) { ExceptionsType = ExceptionHandling::Dwarf; + Data64bitsDirective = 0; + } AbsoluteEHSectionOffsets = false; ZeroDirective = "\t.space\t"; SetDirective = "\t.set"; - Data64bitsDirective = is64Bit ? "\t.quad\t" : 0; + AlignmentIsInBytes = false; LCOMMDirective = "\t.lcomm\t"; AssemblerDialect = 0; // Old-Style mnemonics. diff --git a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.h b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.h index c7f8862e7ff..1e7e3d3745b 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.h +++ b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.h @@ -14,17 +14,16 @@ #ifndef PPCTARGETASMINFO_H #define PPCTARGETASMINFO_H -#include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/DarwinTargetAsmInfo.h" namespace llvm { struct PPCDarwinTargetAsmInfo : public DarwinTargetAsmInfo { - explicit PPCDarwinTargetAsmInfo(bool is64Bit); + explicit PPCDarwinTargetAsmInfo(const Triple &TheTriple); }; struct PPCLinuxTargetAsmInfo : public TargetAsmInfo { - explicit PPCLinuxTargetAsmInfo(bool is64Bit); + explicit PPCLinuxTargetAsmInfo(const Triple &TheTriple); }; } // namespace llvm diff --git a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp index 41f4699fc06..a0d4fdb776b 100644 --- a/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -23,10 +23,9 @@ using namespace llvm; static const TargetAsmInfo *createTargetAsmInfo(const Target &T, const StringRef &TT) { Triple TheTriple(TT); - bool isPPC64 = TheTriple.getArch() == Triple::ppc64; if (TheTriple.getOS() == Triple::Darwin) - return new PPCDarwinTargetAsmInfo(isPPC64); - return new PPCLinuxTargetAsmInfo(isPPC64); + return new PPCDarwinTargetAsmInfo(TheTriple); + return new PPCLinuxTargetAsmInfo(TheTriple); } |

