blob: 41d78dcb017e4f0984b5e4e0b4f943fda3768ae7 [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
34 ZeroDirective = "\t.space\t";
35 SetDirective = "\t.set";
36 Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
37 AlignmentIsInBytes = false;
38 LCOMMDirective = "\t.lcomm\t";
39 InlineAsmStart = "# InlineAsm Start";
40 InlineAsmEnd = "# InlineAsm End";
41 AssemblerDialect = Subtarget->getAsmFlavor();
Jim Laskeybf111822006-12-21 20:26:09 +000042}
43
Chris Lattnerc89ecc52009-08-11 22:06:07 +000044PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
Jim Laskeybf111822006-12-21 20:26:09 +000045 CommentString = "#";
46 GlobalPrefix = "";
Rafael Espindola2f6fea92008-12-19 10:55:56 +000047 PrivateGlobalPrefix = ".L";
Jim Laskeybf111822006-12-21 20:26:09 +000048 UsedDirective = "\t# .no_dead_strip\t";
49 WeakRefDirective = "\t.weak\t";
Nick Lewyckye2b90522007-07-25 03:48:45 +000050
Nicolas Geoffray616585b2007-12-21 12:19:44 +000051 // Debug Information
52 AbsoluteDebugSectionOffsets = true;
53 SupportsDebugInformation = true;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000054
Nicolas Geoffray616585b2007-12-21 12:19:44 +000055 PCSymbol = ".";
56
57 // Set up DWARF directives
58 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
59
Chris Lattnerc89ecc52009-08-11 22:06:07 +000060 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
61 bool isPPC64 = Subtarget->isPPC64();
62
Nicolas Geoffray616585b2007-12-21 12:19:44 +000063 // Exceptions handling
Chris Lattnerc89ecc52009-08-11 22:06:07 +000064 if (!isPPC64)
Jim Grosbach1b747ad2009-08-11 00:09:57 +000065 ExceptionsType = ExceptionHandling::Dwarf;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000066 AbsoluteEHSectionOffsets = false;
Chris Lattnerc89ecc52009-08-11 22:06:07 +000067
68 ZeroDirective = "\t.space\t";
69 SetDirective = "\t.set";
70 Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
71 AlignmentIsInBytes = false;
72 LCOMMDirective = "\t.lcomm\t";
73 InlineAsmStart = "# InlineAsm Start";
74 InlineAsmEnd = "# InlineAsm End";
75 AssemblerDialect = Subtarget->getAsmFlavor();
Jim Laskeybf111822006-12-21 20:26:09 +000076}
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000077