Change the asmprinter to print the comment character before the
[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   PCSymbol = ".";
24   CommentString = ";";
25   ExceptionsType = ExceptionHandling::Dwarf;
26
27   const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
28   bool isPPC64 = Subtarget->isPPC64();
29   
30   if (!isPPC64)
31     Data64bitsDirective = 0;      // we can't emit a 64-bit unit
32   AssemblerDialect = Subtarget->getAsmFlavor();
33 }
34
35 PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
36   CommentString = "#";
37   GlobalPrefix = "";
38   PrivateGlobalPrefix = ".L";
39   UsedDirective = "\t# .no_dead_strip\t";
40   WeakRefDirective = "\t.weak\t";
41
42   // Debug Information
43   AbsoluteDebugSectionOffsets = true;
44   SupportsDebugInformation = true;
45
46   PCSymbol = ".";
47
48   // Set up DWARF directives
49   HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
50
51   const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
52   bool isPPC64 = Subtarget->isPPC64();
53
54   // Exceptions handling
55   if (!isPPC64)
56     ExceptionsType = ExceptionHandling::Dwarf;
57   AbsoluteEHSectionOffsets = false;
58     
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();
65 }
66