blob: 58926e3b87d5f1d78decda909ca7676717370797 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
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"
Anton Korobeynikov0aeac602008-02-27 23:49:15 +000017#include "llvm/Support/Dwarf.h"
18
Dan Gohmanf17a25c2007-07-18 16:29:46 +000019using namespace llvm;
Anton Korobeynikov0aeac602008-02-27 23:49:15 +000020using namespace llvm::dwarf;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021
Chris Lattner7fbb0a12009-08-11 22:06:07 +000022PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023 PCSymbol = ".";
24 CommentString = ";";
Jim Grosbach29feb6a2009-08-11 00:09:57 +000025 ExceptionsType = ExceptionHandling::Dwarf;
26
Chris Lattner7fbb0a12009-08-11 22:06:07 +000027 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
28 bool isPPC64 = Subtarget->isPPC64();
29
Chris Lattner75dabac2009-08-11 22:22:44 +000030 if (!isPPC64)
31 Data64bitsDirective = 0; // we can't emit a 64-bit unit
Chris Lattner7fbb0a12009-08-11 22:06:07 +000032 InlineAsmStart = "# InlineAsm Start";
33 InlineAsmEnd = "# InlineAsm End";
34 AssemblerDialect = Subtarget->getAsmFlavor();
Dan Gohmanf17a25c2007-07-18 16:29:46 +000035}
36
Chris Lattner7fbb0a12009-08-11 22:06:07 +000037PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000038 CommentString = "#";
39 GlobalPrefix = "";
Rafael Espindola1a931842008-12-19 10:55:56 +000040 PrivateGlobalPrefix = ".L";
Dan Gohmanf17a25c2007-07-18 16:29:46 +000041 UsedDirective = "\t# .no_dead_strip\t";
42 WeakRefDirective = "\t.weak\t";
Nick Lewycky3246a9c2007-07-25 03:48:45 +000043
Nicolas Geoffray61864762007-12-21 12:19:44 +000044 // Debug Information
45 AbsoluteDebugSectionOffsets = true;
46 SupportsDebugInformation = true;
Nicolas Geoffray61864762007-12-21 12:19:44 +000047
Nicolas Geoffray61864762007-12-21 12:19:44 +000048 PCSymbol = ".";
49
50 // Set up DWARF directives
51 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
52
Chris Lattner7fbb0a12009-08-11 22:06:07 +000053 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
54 bool isPPC64 = Subtarget->isPPC64();
55
Nicolas Geoffray61864762007-12-21 12:19:44 +000056 // Exceptions handling
Chris Lattner7fbb0a12009-08-11 22:06:07 +000057 if (!isPPC64)
Jim Grosbach29feb6a2009-08-11 00:09:57 +000058 ExceptionsType = ExceptionHandling::Dwarf;
Nicolas Geoffray61864762007-12-21 12:19:44 +000059 AbsoluteEHSectionOffsets = false;
Chris Lattner7fbb0a12009-08-11 22:06:07 +000060
61 ZeroDirective = "\t.space\t";
62 SetDirective = "\t.set";
63 Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
64 AlignmentIsInBytes = false;
65 LCOMMDirective = "\t.lcomm\t";
66 InlineAsmStart = "# InlineAsm Start";
67 InlineAsmEnd = "# InlineAsm End";
68 AssemblerDialect = Subtarget->getAsmFlavor();
Dan Gohmanf17a25c2007-07-18 16:29:46 +000069}
Anton Korobeynikov0aeac602008-02-27 23:49:15 +000070