LLVM
10.0.0
lib
Target
AVR
MCTargetDesc
AVRTargetStreamer.cpp
Go to the documentation of this file.
1
//===-- AVRTargetStreamer.cpp - AVR Target Streamer Methods ---------------===//
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 provides AVR specific target streamer methods.
10
//
11
//===----------------------------------------------------------------------===//
12
13
#include "
AVRTargetStreamer.h
"
14
15
#include "
llvm/MC/MCContext.h
"
16
17
namespace
llvm
{
18
19
AVRTargetStreamer::AVRTargetStreamer
(
MCStreamer
&S) :
MCTargetStreamer
(S) {}
20
21
AVRTargetAsmStreamer::AVRTargetAsmStreamer
(
MCStreamer
&S)
22
:
AVRTargetStreamer
(S) {}
23
24
void
AVRTargetStreamer::finish
() {
25
MCStreamer
&OS =
getStreamer
();
26
MCContext
&
Context
= OS.
getContext
();
27
28
MCSymbol
*DoCopyData = Context.
getOrCreateSymbol
(
"__do_copy_data"
);
29
MCSymbol
*DoClearBss = Context.
getOrCreateSymbol
(
"__do_clear_bss"
);
30
31
// FIXME: We can disable __do_copy_data if there are no static RAM variables.
32
33
OS.
emitRawComment
(
" Declaring this symbol tells the CRT that it should"
);
34
OS.
emitRawComment
(
"copy all variables from program memory to RAM on startup"
);
35
OS.
EmitSymbolAttribute
(DoCopyData,
MCSA_Global
);
36
37
OS.
emitRawComment
(
" Declaring this symbol tells the CRT that it should"
);
38
OS.
emitRawComment
(
"clear the zeroed data section on startup"
);
39
OS.
EmitSymbolAttribute
(DoClearBss,
MCSA_Global
);
40
}
41
42
}
// end namespace llvm
43
MCContext.h
Context
LLVMContext & Context
Definition:
NVVMIntrRange.cpp:73
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:23
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition:
MCSymbol.h:41
llvm::MCTargetStreamer
Target specific streamer interface.
Definition:
MCStreamer.h:91
llvm::AVRTargetStreamer::finish
void finish() override
Definition:
AVRTargetStreamer.cpp:24
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition:
MCStreamer.h:266
llvm::MCContext
Context object for machine code objects.
Definition:
MCContext.h:65
llvm::MCStreamer::emitRawComment
virtual void emitRawComment(const Twine &T, bool TabPrefix=true)
Print T and prefix it with the comment string (normally #) and optionally a tab.
Definition:
MCStreamer.cpp:118
llvm::AVRTargetStreamer::AVRTargetStreamer
AVRTargetStreamer(MCStreamer &S)
Definition:
AVRTargetStreamer.cpp:19
llvm::MCStreamer
Streaming machine code generation interface.
Definition:
MCStreamer.h:197
llvm::MCStreamer::EmitSymbolAttribute
virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute)=0
Add the given Attribute to Symbol.
llvm::MCTargetStreamer::getStreamer
MCStreamer & getStreamer()
Definition:
MCStreamer.h:99
llvm::MCSA_Global
.type _foo,
Definition:
MCDirectives.h:30
llvm::MCContext::getOrCreateSymbol
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Definition:
MCContext.cpp:130
llvm::AVRTargetStreamer
A generic AVR target output stream.
Definition:
AVRTargetStreamer.h:18
llvm::AVRTargetAsmStreamer::AVRTargetAsmStreamer
AVRTargetAsmStreamer(MCStreamer &S)
Definition:
AVRTargetStreamer.cpp:21
AVRTargetStreamer.h
Generated on Tue Mar 24 2020 13:11:59 for LLVM by
1.8.13