LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MipsTargetStreamer.cpp
Go to the documentation of this file.
1 //===-- MipsTargetStreamer.cpp - Mips Target Streamer Methods -------------===//
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 provides Mips specific target streamer methods.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #include "MipsTargetStreamer.h"
15 #include "llvm/MC/MCELF.h"
16 #include "llvm/MC/MCSymbol.h"
20 
21 using namespace llvm;
22 
23 static cl::opt<bool> PrintHackDirectives("print-hack-directives",
24  cl::init(false), cl::Hidden);
25 
26 // pin vtable to this file
27 void MipsTargetStreamer::anchor() {}
28 
30  : OS(OS) {}
31 
34  return;
35 
36  OS << "\t.mips_hack_elf_flags 0x";
37  OS.write_hex(Flags);
38  OS << '\n';
39 }
42  return;
43 
44  OS << "\t.mips_hack_stocg ";
45  OS << Sym->getName();
46  OS << ", ";
47  OS << Val;
48  OS << '\n';
49 }
50 
52  return static_cast<MCELFStreamer &>(*Streamer);
53 }
54 
57  MCA.setELFHeaderEFlags(Flags);
58 }
59 
60 // Set a symbol's STO flags
63  // The "other" values are stored in the last 6 bits of the second byte
64  // The traditional defines for STO values assume the full byte and thus
65  // the shift to pack it.
66  MCELF::setOther(Data, Val >> 2);
67 }
void setELFHeaderEFlags(unsigned Flags)
Definition: MCAssembler.h:972
static cl::opt< bool > PrintHackDirectives("print-hack-directives", cl::init(false), cl::Hidden)
static void setOther(MCSymbolData &SD, unsigned Other)
Definition: MCELF.cpp:74
virtual void emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val)
raw_ostream & write_hex(unsigned long long N)
write_hex - Output N in hexadecimal, without any prefix or padding.
virtual void emitMipsHackSTOCG(MCSymbol *Sym, unsigned Val)
initializer< Ty > init(const Ty &Val)
Definition: CommandLine.h:314
virtual void emitMipsHackELFFlags(unsigned Flags)
MCAssembler & getAssembler()
MipsTargetAsmStreamer(formatted_raw_ostream &OS)
StringRef getName() const
getName - Get the symbol name.
Definition: MCSymbol.h:70
virtual MCSymbolData & getOrCreateSymbolData(MCSymbol *Symbol)
getOrCreateSymbolData - Get symbol data for given symbol.
virtual void emitMipsHackELFFlags(unsigned Flags)