LLVM
8.0.1
lib
Target
AVR
MCTargetDesc
AVRTargetStreamer.cpp
Go to the documentation of this file.
1
//===-- AVRTargetStreamer.cpp - AVR 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 AVR specific target streamer methods.
11
//
12
//===----------------------------------------------------------------------===//
13
14
#include "
AVRTargetStreamer.h
"
15
16
#include "
llvm/MC/MCContext.h
"
17
18
namespace
llvm
{
19
20
AVRTargetStreamer::AVRTargetStreamer
(
MCStreamer
&S) :
MCTargetStreamer
(S) {}
21
22
AVRTargetAsmStreamer::AVRTargetAsmStreamer
(
MCStreamer
&S)
23
:
AVRTargetStreamer
(S) {}
24
25
void
AVRTargetStreamer::finish
() {
26
MCStreamer
&OS =
getStreamer
();
27
MCContext
&
Context
= OS.
getContext
();
28
29
MCSymbol
*DoCopyData = Context.
getOrCreateSymbol
(
"__do_copy_data"
);
30
MCSymbol
*DoClearBss = Context.
getOrCreateSymbol
(
"__do_clear_bss"
);
31
32
// FIXME: We can disable __do_copy_data if there are no static RAM variables.
33
34
OS.
emitRawComment
(
" Declaring this symbol tells the CRT that it should"
);
35
OS.
emitRawComment
(
"copy all variables from program memory to RAM on startup"
);
36
OS.
EmitSymbolAttribute
(DoCopyData,
MCSA_Global
);
37
38
OS.
emitRawComment
(
" Declaring this symbol tells the CRT that it should"
);
39
OS.
emitRawComment
(
"clear the zeroed data section on startup"
);
40
OS.
EmitSymbolAttribute
(DoClearBss,
MCSA_Global
);
41
}
42
43
}
// end namespace llvm
44
MCContext.h
Context
LLVMContext & Context
Definition:
NVVMIntrRange.cpp:72
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition:
MCSymbol.h:42
llvm::MCTargetStreamer
Target specific streamer interface.
Definition:
MCStreamer.h:84
llvm::AVRTargetStreamer::finish
void finish() override
Definition:
AVRTargetStreamer.cpp:25
llvm::MCStreamer::getContext
MCContext & getContext() const
Definition:
MCStreamer.h:251
llvm::MCContext
Context object for machine code objects.
Definition:
MCContext.h:63
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:111
llvm::AVRTargetStreamer::AVRTargetStreamer
AVRTargetStreamer(MCStreamer &S)
Definition:
AVRTargetStreamer.cpp:20
llvm::MCStreamer
Streaming machine code generation interface.
Definition:
MCStreamer.h:189
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:92
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:123
llvm::AVRTargetStreamer
A generic AVR target output stream.
Definition:
AVRTargetStreamer.h:19
llvm::AVRTargetAsmStreamer::AVRTargetAsmStreamer
AVRTargetAsmStreamer(MCStreamer &S)
Definition:
AVRTargetStreamer.cpp:22
AVRTargetStreamer.h
Generated on Sun Dec 20 2020 13:56:39 for LLVM by
1.8.13