LLVM  9.0.0svn
SparcMCAsmInfo.cpp
Go to the documentation of this file.
1 //===- SparcMCAsmInfo.cpp - Sparc asm properties --------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains the declarations of the SparcMCAsmInfo properties.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #include "SparcMCAsmInfo.h"
14 #include "SparcMCExpr.h"
15 #include "llvm/ADT/Triple.h"
17 #include "llvm/MC/MCExpr.h"
18 #include "llvm/MC/MCStreamer.h"
20 
21 using namespace llvm;
22 
23 void SparcELFMCAsmInfo::anchor() {}
24 
26  bool isV9 = (TheTriple.getArch() == Triple::sparcv9);
27  IsLittleEndian = (TheTriple.getArch() == Triple::sparcel);
28 
29  if (isV9) {
31  }
32 
33  Data16bitsDirective = "\t.half\t";
34  Data32bitsDirective = "\t.word\t";
35  // .xword is only supported by V9.
36  Data64bitsDirective = (isV9) ? "\t.xword\t" : nullptr;
37  ZeroDirective = "\t.skip\t";
38  CommentString = "!";
40 
42 
45 
47 }
48 
49 const MCExpr*
51  unsigned Encoding,
52  MCStreamer &Streamer) const {
53  if (Encoding & dwarf::DW_EH_PE_pcrel) {
54  MCContext &Ctx = Streamer.getContext();
56  MCSymbolRefExpr::create(Sym, Ctx), Ctx);
57  }
58 
59  return MCAsmInfo::getExprForPersonalitySymbol(Sym, Encoding, Streamer);
60 }
61 
62 const MCExpr*
64  unsigned Encoding,
65  MCStreamer &Streamer) const {
66  if (Encoding & dwarf::DW_EH_PE_pcrel) {
67  MCContext &Ctx = Streamer.getContext();
69  MCSymbolRefExpr::create(Sym, Ctx), Ctx);
70  }
71  return MCAsmInfo::getExprForFDESymbol(Sym, Encoding, Streamer);
72 }
bool UseIntegratedAssembler
Should we use the integrated assembler? The integrated assembler should be enabled by default (by the...
Definition: MCAsmInfo.h:370
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:319
This class represents lattice values for constants.
Definition: AllocatorList.h:23
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
const char * Data64bitsDirective
Definition: MCAsmInfo.h:192
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:173
bool IsLittleEndian
True if target is little endian. Default is true.
Definition: MCAsmInfo.h:69
unsigned CalleeSaveStackSlotSize
Size of the stack slot reserved for callee-saved registers, in bytes.
Definition: MCAsmInfo.h:66
MCContext & getContext() const
Definition: MCStreamer.h:250
virtual const MCExpr * getExprForPersonalitySymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
Definition: MCAsmInfo.cpp:78
StringRef CommentString
This indicates the comment character used by the assembler.
Definition: MCAsmInfo.h:113
bool UsesELFSectionDirectiveForBSS
This is true if this target uses ELF '.section' directive before the '.bss' one.
Definition: MCAsmInfo.h:220
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:35
Context object for machine code objects.
Definition: MCContext.h:62
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:215
ArchType getArch() const
getArch - Get the parsed architecture type of this triple.
Definition: Triple.h:289
const MCExpr * getExprForPersonalitySymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const override
Streaming machine code generation interface.
Definition: MCStreamer.h:188
bool SupportsDebugInformation
True if target supports emission of debugging information.
Definition: MCAsmInfo.h:331
const char * Data16bitsDirective
Definition: MCAsmInfo.h:190
SparcELFMCAsmInfo(const Triple &TheTriple)
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:43
const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const override
const char * Data32bitsDirective
Definition: MCAsmInfo.h:191
This file contains constants used for implementing Dwarf debug support.
unsigned CodePointerSize
Code pointer size in bytes. Default is 4.
Definition: MCAsmInfo.h:62
ExceptionHandling ExceptionsType
Exception handling format for the target. Defaults to None.
Definition: MCAsmInfo.h:334
static const SparcMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition: SparcMCExpr.cpp:26
No exception support.
virtual const MCExpr * getExprForFDESymbol(const MCSymbol *Sym, unsigned Encoding, MCStreamer &Streamer) const
Definition: MCAsmInfo.cpp:85