LLVM  8.0.1
SparcMCAsmInfo.cpp
Go to the documentation of this file.
1 //===- SparcMCAsmInfo.cpp - Sparc asm properties --------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains the declarations of the SparcMCAsmInfo properties.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "SparcMCAsmInfo.h"
15 #include "SparcMCExpr.h"
16 #include "llvm/ADT/Triple.h"
18 #include "llvm/MC/MCExpr.h"
19 #include "llvm/MC/MCStreamer.h"
21 
22 using namespace llvm;
23 
24 void SparcELFMCAsmInfo::anchor() {}
25 
27  bool isV9 = (TheTriple.getArch() == Triple::sparcv9);
28  IsLittleEndian = (TheTriple.getArch() == Triple::sparcel);
29 
30  if (isV9) {
32  }
33 
34  Data16bitsDirective = "\t.half\t";
35  Data32bitsDirective = "\t.word\t";
36  // .xword is only supported by V9.
37  Data64bitsDirective = (isV9) ? "\t.xword\t" : nullptr;
38  ZeroDirective = "\t.skip\t";
39  CommentString = "!";
41 
43 
46 
48 }
49 
50 const MCExpr*
52  unsigned Encoding,
53  MCStreamer &Streamer) const {
54  if (Encoding & dwarf::DW_EH_PE_pcrel) {
55  MCContext &Ctx = Streamer.getContext();
57  MCSymbolRefExpr::create(Sym, Ctx), Ctx);
58  }
59 
60  return MCAsmInfo::getExprForPersonalitySymbol(Sym, Encoding, Streamer);
61 }
62 
63 const MCExpr*
65  unsigned Encoding,
66  MCStreamer &Streamer) const {
67  if (Encoding & dwarf::DW_EH_PE_pcrel) {
68  MCContext &Ctx = Streamer.getContext();
70  MCSymbolRefExpr::create(Sym, Ctx), Ctx);
71  }
72  return MCAsmInfo::getExprForFDESymbol(Sym, Encoding, Streamer);
73 }
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:371
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:323
This class represents lattice values for constants.
Definition: AllocatorList.h:24
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
const char * Data64bitsDirective
Definition: MCAsmInfo.h:193
const char * ZeroDirective
This should be set to the directive used to get some number of zero bytes emitted to the current sect...
Definition: MCAsmInfo.h:174
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:70
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:67
MCContext & getContext() const
Definition: MCStreamer.h:251
virtual const MCExpr * getExprForPersonalitySymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
Definition: MCAsmInfo.cpp:79
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:114
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition: MCAsmInfo.h:221
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
Context object for machine code objects.
Definition: MCContext.h:63
bool SunStyleELFSectionSwitchSyntax
This is true if this target uses "Sun Style" syntax for section switching ("#alloc,#write" etc) instead of the normal ELF syntax (,"a,w") in .section directives.
Definition: MCAsmInfo.h:216
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:290
const MCExpr * getExprForPersonalitySymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const override
Streaming machine code generation interface.
Definition: MCStreamer.h:189
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:332
const char * Data16bitsDirective
Definition: MCAsmInfo.h:191
SparcELFMCAsmInfo(const Triple &TheTriple)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const override
const char * Data32bitsDirective
Definition: MCAsmInfo.h:192
This file contains constants used for implementing Dwarf debug support.
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:63
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:335
static const SparcMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition: SparcMCExpr.cpp:27
No exception support.
virtual const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
Definition: MCAsmInfo.cpp:86