move dwarf debug info section selection stuff from TAI to
[oota-llvm.git] / lib / Target / PowerPC / PPCTargetAsmInfo.cpp
1 //===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declarations of the DarwinTargetAsmInfo properties.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "PPCTargetAsmInfo.h"
15 #include "PPCTargetMachine.h"
16 #include "llvm/Function.h"
17 #include "llvm/Support/Dwarf.h"
18
19 using namespace llvm;
20 using namespace llvm::dwarf;
21
22 PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) :
23   PPCTargetAsmInfo<DarwinTargetAsmInfo>(TM) {
24   PCSymbol = ".";
25   CommentString = ";";
26   UsedDirective = "\t.no_dead_strip\t";
27   SupportsExceptionHandling = true;
28   
29   GlobalEHDirective = "\t.globl\t";
30   SupportsWeakOmittedEHFrame = false;
31 }
32
33 PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) :
34   PPCTargetAsmInfo<TargetAsmInfo>(TM) {
35   CommentString = "#";
36   GlobalPrefix = "";
37   PrivateGlobalPrefix = ".L";
38   UsedDirective = "\t# .no_dead_strip\t";
39   WeakRefDirective = "\t.weak\t";
40
41   // Debug Information
42   AbsoluteDebugSectionOffsets = true;
43   SupportsDebugInformation = true;
44
45   PCSymbol = ".";
46
47   // Set up DWARF directives
48   HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
49
50   // Exceptions handling
51   if (!TM.getSubtargetImpl()->isPPC64())
52     SupportsExceptionHandling = true;
53   AbsoluteEHSectionOffsets = false;
54 }
55
56
57 // Instantiate default implementation.
58 TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);