LLVM  8.0.1
AVRMCELFStreamer.cpp
Go to the documentation of this file.
1 //===--------- AVRMCELFStreamer.cpp - AVR subclass of MCELFStreamer -------===//
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 is a stub that parses a MCInst bundle and passes the
11 // instructions on to the real streamer.
12 //
13 //===----------------------------------------------------------------------===//
14 #define DEBUG_TYPE "avrmcelfstreamer"
15 
17 #include "llvm/MC/MCContext.h"
18 #include "llvm/MC/MCExpr.h"
19 #include "llvm/MC/MCSymbol.h"
20 #include "llvm/MC/MCObjectWriter.h"
21 
22 using namespace llvm;
23 
25  const MCSymbol *Sym, unsigned SizeInBytes, SMLoc Loc,
26  AVRMCExpr::VariantKind ModifierKind) {
28  if (ModifierKind == AVRMCExpr::VK_AVR_None) {
30  if (SizeInBytes == SIZE_LONG)
32  else if (SizeInBytes == SIZE_WORD)
34  } else if (ModifierKind == AVRMCExpr::VK_AVR_LO8)
36  else if (ModifierKind == AVRMCExpr::VK_AVR_HI8)
38  else if (ModifierKind == AVRMCExpr::VK_AVR_HH8)
41  SizeInBytes, Loc);
42 }
43 
44 namespace llvm {
46  std::unique_ptr<MCAsmBackend> MAB,
47  std::unique_ptr<MCObjectWriter> OW,
48  std::unique_ptr<MCCodeEmitter> CE) {
49  return new AVRMCELFStreamer(Context, std::move(MAB), std::move(OW),
50  std::move(CE));
51 }
52 
53 } // end namespace llvm
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 int SIZE_WORD
const int SIZE_LONG
MCContext & getContext() const
Definition: MCStreamer.h:251
VariantKind
Specifies the type of an expression.
Definition: AVRMCExpr.h:23
Context object for machine code objects.
Definition: MCContext.h:63
void EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Definition: MCStreamer.cpp:155
Streaming machine code generation interface.
Definition: MCStreamer.h:189
Corresponds to hlo8() and hh8().
Definition: AVRMCExpr.h:28
Corresponds to hi8().
Definition: AVRMCExpr.h:26
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
AVRMCELFStreamer(MCContext &Context, std::unique_ptr< MCAsmBackend > TAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > Emitter)
MCStreamer * createAVRELFStreamer(Triple const &TT, MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > CE)
Corresponds to lo8().
Definition: AVRMCExpr.h:27
const unsigned Kind
void EmitValueForModiferKind(const MCSymbol *Sym, unsigned SizeInBytes, SMLoc Loc=SMLoc(), AVRMCExpr::VariantKind ModifierKind=AVRMCExpr::VK_AVR_None)
Represents a location in source code.
Definition: SMLoc.h:24