blob: 25920da0fe900fc91be18489dc75569b2992017d [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"
Chris Lattnerb2d31692009-08-13 05:30:22 +000015#include "llvm/ADT/Triple.h"
Jim Laskey8e8de8f2006-09-07 22:05:02 +000016using namespace llvm;
17
Chris Lattnerb2d31692009-08-13 05:30:22 +000018PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const Triple &TheTriple)
19 : DarwinTargetAsmInfo(TheTriple) {
Jim Laskeyb82313f2007-02-01 16:31:34 +000020 PCSymbol = ".";
Jim Laskeybf111822006-12-21 20:26:09 +000021 CommentString = ";";
Jim Grosbach1b747ad2009-08-11 00:09:57 +000022 ExceptionsType = ExceptionHandling::Dwarf;
23
Chris Lattnerb2d31692009-08-13 05:30:22 +000024 if (TheTriple.getArch() != Triple::ppc64)
Chris Lattner74da6712009-08-11 22:49:34 +000025 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
Chris Lattner6b883e32009-08-11 23:03:40 +000026 AssemblerDialect = 1; // New-Style mnemonics.
Jim Laskeybf111822006-12-21 20:26:09 +000027}
28
Chris Lattnerb2d31692009-08-13 05:30:22 +000029PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const Triple &TheTriple) {
Jim Laskeybf111822006-12-21 20:26:09 +000030 CommentString = "#";
31 GlobalPrefix = "";
Rafael Espindola2f6fea92008-12-19 10:55:56 +000032 PrivateGlobalPrefix = ".L";
Jim Laskeybf111822006-12-21 20:26:09 +000033 UsedDirective = "\t# .no_dead_strip\t";
34 WeakRefDirective = "\t.weak\t";
Nick Lewyckye2b90522007-07-25 03:48:45 +000035
Nicolas Geoffray616585b2007-12-21 12:19:44 +000036 // Debug Information
37 AbsoluteDebugSectionOffsets = true;
38 SupportsDebugInformation = true;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000039
Nicolas Geoffray616585b2007-12-21 12:19:44 +000040 PCSymbol = ".";
41
42 // Set up DWARF directives
43 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
44
45 // Exceptions handling
Chris Lattnerb2d31692009-08-13 05:30:22 +000046 if (TheTriple.getArch() != Triple::ppc64) {
Jim Grosbach1b747ad2009-08-11 00:09:57 +000047 ExceptionsType = ExceptionHandling::Dwarf;
Chris Lattnerb2d31692009-08-13 05:30:22 +000048 Data64bitsDirective = 0;
49 }
Nicolas Geoffray616585b2007-12-21 12:19:44 +000050 AbsoluteEHSectionOffsets = false;
Chris Lattnerc89ecc52009-08-11 22:06:07 +000051
52 ZeroDirective = "\t.space\t";
53 SetDirective = "\t.set";
Chris Lattnerb2d31692009-08-13 05:30:22 +000054
Chris Lattnerc89ecc52009-08-11 22:06:07 +000055 AlignmentIsInBytes = false;
56 LCOMMDirective = "\t.lcomm\t";
Chris Lattner6b883e32009-08-11 23:03:40 +000057 AssemblerDialect = 0; // Old-Style mnemonics.
Jim Laskeybf111822006-12-21 20:26:09 +000058}
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000059