Thanks to visit codestin.com
Credit goes to llvm.org
LLVM
22.0.0git
lib
Target
AVR
MCTargetDesc
AVRMCELFStreamer.cpp
Go to the documentation of this file.
1
//===--------- AVRMCELFStreamer.cpp - AVR subclass of MCELFStreamer -------===//
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 is a stub that parses a MCInst bundle and passes the
10
// instructions on to the real streamer.
11
//
12
//===----------------------------------------------------------------------===//
13
#include "
MCTargetDesc/AVRMCELFStreamer.h
"
14
#include "
llvm/MC/MCContext.h
"
15
#include "
llvm/MC/MCExpr.h
"
16
#include "
llvm/MC/MCObjectWriter.h
"
17
#include "
llvm/MC/MCSymbol.h
"
18
19
#define DEBUG_TYPE "avrmcelfstreamer"
20
21
using namespace
llvm
;
22
23
void
AVRMCELFStreamer::emitValueForModiferKind
(
24
const
MCSymbol
*Sym,
unsigned
SizeInBytes,
SMLoc
Loc
,
25
AVRMCExpr::Specifier
ModifierKind) {
26
AVRMCExpr::Specifier
Kind =
AVR::S_AVR_NONE
;
27
if
(ModifierKind ==
AVR::S_AVR_NONE
) {
28
Kind =
AVR::S_DIFF8
;
29
if
(SizeInBytes ==
SIZE_LONG
)
30
Kind =
AVR::S_DIFF32
;
31
else
if
(SizeInBytes ==
SIZE_WORD
)
32
Kind =
AVR::S_DIFF16
;
33
}
else
if
(ModifierKind ==
AVR::S_LO8
)
34
Kind =
AVR::S_LO8
;
35
else
if
(ModifierKind ==
AVR::S_HI8
)
36
Kind =
AVR::S_HI8
;
37
else
if
(ModifierKind ==
AVR::S_HH8
)
38
Kind =
AVR::S_HH8
;
39
MCELFStreamer::emitValue
(
MCSymbolRefExpr::create
(Sym, Kind,
getContext
()),
40
SizeInBytes,
Loc
);
41
}
42
43
namespace
llvm
{
44
MCStreamer
*
createAVRELFStreamer
(
Triple
const
&TT,
MCContext
&Context,
45
std::unique_ptr<MCAsmBackend> MAB,
46
std::unique_ptr<MCObjectWriter> OW,
47
std::unique_ptr<MCCodeEmitter> CE) {
48
return
new
AVRMCELFStreamer
(Context, std::move(MAB), std::move(OW),
49
std::move(CE));
50
}
51
52
}
// end namespace llvm
AVRMCELFStreamer.h
MCContext.h
MCExpr.h
MCObjectWriter.h
MCSymbol.h
llvm::AVRMCELFStreamer
Definition
AVRMCELFStreamer.h:25
llvm::AVRMCELFStreamer::emitValueForModiferKind
void emitValueForModiferKind(const MCSymbol *Sym, unsigned SizeInBytes, SMLoc Loc=SMLoc(), AVRMCExpr::Specifier ModifierKind=AVR::S_AVR_NONE)
Definition
AVRMCELFStreamer.cpp:23
llvm::AVRMCExpr::Specifier
Spec Specifier
Definition
AVRMCExpr.h:22
llvm::MCContext
Context object for machine code objects.
Definition
MCContext.h:83
llvm::MCStreamer
Streaming machine code generation interface.
Definition
MCStreamer.h:220
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition
MCStreamer.h:314
llvm::MCStreamer::emitValue
void emitValue(const MCExpr *Value, unsigned Size, SMLoc Loc=SMLoc())
Definition
MCStreamer.cpp:178
llvm::MCSymbolRefExpr::create
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition
MCExpr.h:214
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition
MCSymbol.h:42
llvm::SMLoc
Represents a location in source code.
Definition
SMLoc.h:23
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition
Triple.h:47
llvm::AVR::S_LO8
@ S_LO8
Corresponds to lo8().
Definition
AVRMCAsmInfo.h:42
llvm::AVR::S_AVR_NONE
@ S_AVR_NONE
Definition
AVRMCAsmInfo.h:39
llvm::AVR::S_HH8
@ S_HH8
Corresponds to hlo8() and hh8().
Definition
AVRMCAsmInfo.h:43
llvm::AVR::S_DIFF16
@ S_DIFF16
Definition
AVRMCAsmInfo.h:56
llvm::AVR::S_DIFF32
@ S_DIFF32
Definition
AVRMCAsmInfo.h:57
llvm::AVR::S_DIFF8
@ S_DIFF8
Definition
AVRMCAsmInfo.h:55
llvm::AVR::S_HI8
@ S_HI8
Corresponds to hi8().
Definition
AVRMCAsmInfo.h:41
llvm::Loc
Definition
DwarfDebug.h:129
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition
AddressRanges.h:18
llvm::createAVRELFStreamer
MCStreamer * createAVRELFStreamer(Triple const &TT, MCContext &Context, std::unique_ptr< MCAsmBackend > MAB, std::unique_ptr< MCObjectWriter > OW, std::unique_ptr< MCCodeEmitter > CE)
Definition
AVRMCELFStreamer.cpp:44
llvm::SIZE_WORD
const int SIZE_WORD
Definition
AVRMCELFStreamer.h:23
llvm::SIZE_LONG
const int SIZE_LONG
Definition
AVRMCELFStreamer.h:22
Generated on
for LLVM by
1.14.0