blob: e20fd4ebd3bd57a77a1e1472f3749a1a14c49096 [file] [log] [blame]
Jim Laskey8e8de8f2006-09-07 22:05:02 +00001//===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner4ee451d2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Jim Laskey8e8de8f2006-09-07 22:05:02 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the declarations of the DarwinTargetAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "PPCTargetAsmInfo.h"
15#include "PPCTargetMachine.h"
Chris Lattnerb56dcc42006-10-05 00:35:50 +000016#include "llvm/Function.h"
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000017#include "llvm/Support/Dwarf.h"
18
Jim Laskey8e8de8f2006-09-07 22:05:02 +000019using namespace llvm;
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000020using namespace llvm::dwarf;
Jim Laskey8e8de8f2006-09-07 22:05:02 +000021
Chris Lattnerc89ecc52009-08-11 22:06:07 +000022PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) {
Jim Laskeyb82313f2007-02-01 16:31:34 +000023 PCSymbol = ".";
Jim Laskeybf111822006-12-21 20:26:09 +000024 CommentString = ";";
Jim Laskeybf111822006-12-21 20:26:09 +000025 UsedDirective = "\t.no_dead_strip\t";
Jim Grosbach1b747ad2009-08-11 00:09:57 +000026 ExceptionsType = ExceptionHandling::Dwarf;
27
Dale Johannesen038129d2008-01-10 02:03:30 +000028 GlobalEHDirective = "\t.globl\t";
29 SupportsWeakOmittedEHFrame = false;
Chris Lattnerc89ecc52009-08-11 22:06:07 +000030
31 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
32 bool isPPC64 = Subtarget->isPPC64();
33
Chris Lattnerc89ecc52009-08-11 22:06:07 +000034 SetDirective = "\t.set";
35 Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
36 AlignmentIsInBytes = false;
37 LCOMMDirective = "\t.lcomm\t";
38 InlineAsmStart = "# InlineAsm Start";
39 InlineAsmEnd = "# InlineAsm End";
40 AssemblerDialect = Subtarget->getAsmFlavor();
Jim Laskeybf111822006-12-21 20:26:09 +000041}
42
Chris Lattnerc89ecc52009-08-11 22:06:07 +000043PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
Jim Laskeybf111822006-12-21 20:26:09 +000044 CommentString = "#";
45 GlobalPrefix = "";
Rafael Espindola2f6fea92008-12-19 10:55:56 +000046 PrivateGlobalPrefix = ".L";
Jim Laskeybf111822006-12-21 20:26:09 +000047 UsedDirective = "\t# .no_dead_strip\t";
48 WeakRefDirective = "\t.weak\t";
Nick Lewyckye2b90522007-07-25 03:48:45 +000049
Nicolas Geoffray616585b2007-12-21 12:19:44 +000050 // Debug Information
51 AbsoluteDebugSectionOffsets = true;
52 SupportsDebugInformation = true;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000053
Nicolas Geoffray616585b2007-12-21 12:19:44 +000054 PCSymbol = ".";
55
56 // Set up DWARF directives
57 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
58
Chris Lattnerc89ecc52009-08-11 22:06:07 +000059 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
60 bool isPPC64 = Subtarget->isPPC64();
61
Nicolas Geoffray616585b2007-12-21 12:19:44 +000062 // Exceptions handling
Chris Lattnerc89ecc52009-08-11 22:06:07 +000063 if (!isPPC64)
Jim Grosbach1b747ad2009-08-11 00:09:57 +000064 ExceptionsType = ExceptionHandling::Dwarf;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000065 AbsoluteEHSectionOffsets = false;
Chris Lattnerc89ecc52009-08-11 22:06:07 +000066
67 ZeroDirective = "\t.space\t";
68 SetDirective = "\t.set";
69 Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
70 AlignmentIsInBytes = false;
71 LCOMMDirective = "\t.lcomm\t";
72 InlineAsmStart = "# InlineAsm Start";
73 InlineAsmEnd = "# InlineAsm End";
74 AssemblerDialect = Subtarget->getAsmFlavor();
Jim Laskeybf111822006-12-21 20:26:09 +000075}
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000076