blob: 925e590786082f613353b0b145c9709f1c70f306 [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 Grosbach1b747ad2009-08-11 00:09:57 +000025 ExceptionsType = ExceptionHandling::Dwarf;
26
Chris Lattnerc89ecc52009-08-11 22:06:07 +000027 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
28 bool isPPC64 = Subtarget->isPPC64();
29
Chris Lattnere2811a72009-08-11 22:22:44 +000030 if (!isPPC64)
Chris Lattner74da6712009-08-11 22:49:34 +000031 Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
32 AssemblerDialect = 0; // Old-Style mnemonics.
Jim Laskeybf111822006-12-21 20:26:09 +000033}
34
Chris Lattnerc89ecc52009-08-11 22:06:07 +000035PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
Jim Laskeybf111822006-12-21 20:26:09 +000036 CommentString = "#";
37 GlobalPrefix = "";
Rafael Espindola2f6fea92008-12-19 10:55:56 +000038 PrivateGlobalPrefix = ".L";
Jim Laskeybf111822006-12-21 20:26:09 +000039 UsedDirective = "\t# .no_dead_strip\t";
40 WeakRefDirective = "\t.weak\t";
Nick Lewyckye2b90522007-07-25 03:48:45 +000041
Nicolas Geoffray616585b2007-12-21 12:19:44 +000042 // Debug Information
43 AbsoluteDebugSectionOffsets = true;
44 SupportsDebugInformation = true;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000045
Nicolas Geoffray616585b2007-12-21 12:19:44 +000046 PCSymbol = ".";
47
48 // Set up DWARF directives
49 HasLEB128 = true; // Target asm supports leb128 directives (little-endian)
50
Chris Lattnerc89ecc52009-08-11 22:06:07 +000051 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
52 bool isPPC64 = Subtarget->isPPC64();
53
Nicolas Geoffray616585b2007-12-21 12:19:44 +000054 // Exceptions handling
Chris Lattnerc89ecc52009-08-11 22:06:07 +000055 if (!isPPC64)
Jim Grosbach1b747ad2009-08-11 00:09:57 +000056 ExceptionsType = ExceptionHandling::Dwarf;
Nicolas Geoffray616585b2007-12-21 12:19:44 +000057 AbsoluteEHSectionOffsets = false;
Chris Lattnerc89ecc52009-08-11 22:06:07 +000058
59 ZeroDirective = "\t.space\t";
60 SetDirective = "\t.set";
61 Data64bitsDirective = isPPC64 ? "\t.quad\t" : 0;
62 AlignmentIsInBytes = false;
63 LCOMMDirective = "\t.lcomm\t";
Chris Lattner74da6712009-08-11 22:49:34 +000064 AssemblerDialect = 1; // New-Style mnemonics.
Jim Laskeybf111822006-12-21 20:26:09 +000065}
Anton Korobeynikov7b1b7f52008-02-27 23:49:15 +000066