1 //===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains the declarations of the DarwinTargetAsmInfo properties.
12 //===----------------------------------------------------------------------===//
14 #include "PPCTargetAsmInfo.h"
15 #include "PPCTargetMachine.h"
16 #include "llvm/Function.h"
17 #include "llvm/Support/Dwarf.h"
20 using namespace llvm::dwarf;
22 PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) {
25 ExceptionsType = ExceptionHandling::Dwarf;
27 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
28 bool isPPC64 = Subtarget->isPPC64();
31 Data64bitsDirective = 0; // we can't emit a 64-bit unit
32 AssemblerDialect = Subtarget->getAsmFlavor();
35 PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
38 PrivateGlobalPrefix = ".L";
39 UsedDirective = "\t# .no_dead_strip\t";
40 WeakRefDirective = "\t.weak\t";
43 AbsoluteDebugSectionOffsets = true;
44 SupportsDebugInformation = true;
48 // Set up DWARF directives
49 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
51 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
52 bool isPPC64 = Subtarget->isPPC64();
54 // Exceptions handling
56 ExceptionsType = ExceptionHandling::Dwarf;
57 AbsoluteEHSectionOffsets = false;
59 ZeroDirective = "\t.space\t";
60 SetDirective = "\t.set";
61 Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
62 AlignmentIsInBytes = false;
63 LCOMMDirective = "\t.lcomm\t";
64 AssemblerDialect = Subtarget->getAsmFlavor();