blob: 925e590786082f613353b0b145c9709f1c70f306 [file] [log] [blame]
Dan Gohmanf17a25c2007-07-18 16:29:46 +00001//===-- PPCTargetAsmInfo.cpp - PPC asm properties ---------------*- C++ -*-===//
2//
3// The LLVM Compiler Infrastructure
4//
Chris Lattner081ce942007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Dan Gohmanf17a25c2007-07-18 16:29:46 +00007//
8//===----------------------------------------------------------------------===//
9//
10// This file contains the declarations of the DarwinTargetAsmInfo properties.
11//
12//===----------------------------------------------------------------------===//
13
14#include "PPCTargetAsmInfo.h"
15#include "PPCTargetMachine.h"
16#include "llvm/Function.h"
Anton Korobeynikov0aeac602008-02-27 23:49:15 +000017#include "llvm/Support/Dwarf.h"
18
Dan Gohmanf17a25c2007-07-18 16:29:46 +000019using namespace llvm;
Anton Korobeynikov0aeac602008-02-27 23:49:15 +000020using namespace llvm::dwarf;
Dan Gohmanf17a25c2007-07-18 16:29:46 +000021
Chris Lattner7fbb0a12009-08-11 22:06:07 +000022PPCDarwinTargetAsmInfo::PPCDarwinTargetAsmInfo(const PPCTargetMachine &TM) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000023 PCSymbol = ".";
24 CommentString = ";";
Jim Grosbach29feb6a2009-08-11 00:09:57 +000025 ExceptionsType = ExceptionHandling::Dwarf;
26
Chris Lattner7fbb0a12009-08-11 22:06:07 +000027 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
28 bool isPPC64 = Subtarget->isPPC64();
29
Chris Lattner75dabac2009-08-11 22:22:44 +000030 if (!isPPC64)
Chris Lattnerc7cea482009-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.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000033}
34
Chris Lattner7fbb0a12009-08-11 22:06:07 +000035PPCLinuxTargetAsmInfo::PPCLinuxTargetAsmInfo(const PPCTargetMachine &TM) {
Dan Gohmanf17a25c2007-07-18 16:29:46 +000036 CommentString = "#";
37 GlobalPrefix = "";
Rafael Espindola1a931842008-12-19 10:55:56 +000038 PrivateGlobalPrefix = ".L";
Dan Gohmanf17a25c2007-07-18 16:29:46 +000039 UsedDirective = "\t# .no_dead_strip\t";
40 WeakRefDirective = "\t.weak\t";
Nick Lewycky3246a9c2007-07-25 03:48:45 +000041
Nicolas Geoffray61864762007-12-21 12:19:44 +000042 // Debug Information
43 AbsoluteDebugSectionOffsets = true;
44 SupportsDebugInformation = true;
Nicolas Geoffray61864762007-12-21 12:19:44 +000045
Nicolas Geoffray61864762007-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 Lattner7fbb0a12009-08-11 22:06:07 +000051 const PPCSubtarget *Subtarget = &TM.getSubtarget<PPCSubtarget>();
52 bool isPPC64 = Subtarget->isPPC64();
53
Nicolas Geoffray61864762007-12-21 12:19:44 +000054 // Exceptions handling
Chris Lattner7fbb0a12009-08-11 22:06:07 +000055 if (!isPPC64)
Jim Grosbach29feb6a2009-08-11 00:09:57 +000056 ExceptionsType = ExceptionHandling::Dwarf;
Nicolas Geoffray61864762007-12-21 12:19:44 +000057 AbsoluteEHSectionOffsets = false;
Chris Lattner7fbb0a12009-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 Lattnerc7cea482009-08-11 22:49:34 +000064 AssemblerDialect = 1; // New-Style mnemonics.
Dan Gohmanf17a25c2007-07-18 16:29:46 +000065}
Anton Korobeynikov0aeac602008-02-27 23:49:15 +000066