blob: 26120175fb9c69cf63b9f8e2bc0a534f137c49ea [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 Lattner4e0f25b2009-06-19 00:08:39 +000022PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) :
Anton Korobeynikov32b952a2008-09-25 21:00:33 +000023 PPCTargetAsmInfo<DarwinTargetAsmInfo>(TM) {
Jim Laskeyb82313f2007-02-01 16:31:34 +000024 PCSymbol = ".";
Jim Laskeybf111822006-12-21 20:26:09 +000025 CommentString = ";";
Jim Laskeybf111822006-12-21 20:26:09 +000026 UsedDirective = "\t.no_dead_strip\t";
Dale Johannesen696f7682007-12-19 21:54:36 +000027 SupportsExceptionHandling = true;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000028
Dale Johannesen038129d2008-01-10 02:03:30 +000029 GlobalEHDirective = "\t.globl\t";
30 SupportsWeakOmittedEHFrame = false;
Jim Laskeybf111822006-12-21 20:26:09 +000031}
32
Anton Korobeynikov7396e592008-08-08 18:23:49 +000033PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) :
Chris Lattner8d4a0a32009-08-02 04:27:24 +000034 PPCTargetAsmInfo<TargetAsmInfo>(TM) {
Jim Laskeybf111822006-12-21 20:26:09 +000035 CommentString = "#";
36 GlobalPrefix = "";
Rafael Espindola2f6fea92008-12-19 10:55:56 +000037 PrivateGlobalPrefix = ".L";
Jim Laskeybf111822006-12-21 20:26:09 +000038 UsedDirective = "\t# .no_dead_strip\t";
39 WeakRefDirective = "\t.weak\t";
Nick Lewyckye2b90522007-07-25 03:48:45 +000040
Nicolas Geoffray616585b2007-12-21 12:19:44 +000041 // Debug Information
42 AbsoluteDebugSectionOffsets = true;
43 SupportsDebugInformation = true;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000044
Nicolas Geoffray616585b2007-12-21 12:19:44 +000045 PCSymbol = ".";
46
47 // Set up DWARF directives
48 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
49
50 // Exceptions handling
51 if (!TM.getSubtargetImpl()->isPPC64())
52 SupportsExceptionHandling = true;
53 AbsoluteEHSectionOffsets = false;
Jim Laskeybf111822006-12-21 20:26:09 +000054}
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000055
Anton Korobeynikov6381a132008-10-05 08:53:29 +000056
57// Instantiate default implementation.
58TEMPLATE_INSTANTIATION(class PPCTargetAsmInfo<TargetAsmInfo>);