LLVM
8.0.1
lib
Target
AVR
AVRTargetObjectFile.cpp
Go to the documentation of this file.
1
//===-- AVRTargetObjectFile.cpp - AVR Object Files ------------------------===//
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
#include "
AVRTargetObjectFile.h
"
11
12
#include "
llvm/BinaryFormat/ELF.h
"
13
#include "
llvm/IR/DerivedTypes.h
"
14
#include "
llvm/IR/GlobalValue.h
"
15
#include "
llvm/IR/Mangler.h
"
16
#include "
llvm/MC/MCContext.h
"
17
#include "
llvm/MC/MCSectionELF.h
"
18
19
#include "
AVR.h
"
20
21
namespace
llvm
{
22
void
AVRTargetObjectFile::Initialize
(
MCContext
&Ctx,
const
TargetMachine
&
TM
) {
23
Base::Initialize
(Ctx, TM);
24
ProgmemDataSection =
25
Ctx.
getELFSection
(
".progmem.data"
,
ELF::SHT_PROGBITS
,
ELF::SHF_ALLOC
);
26
}
27
28
MCSection
*
29
AVRTargetObjectFile::SelectSectionForGlobal
(
const
GlobalObject
*GO,
30
SectionKind
Kind
,
31
const
TargetMachine
&
TM
)
const
{
32
// Global values in flash memory are placed in the progmem.data section
33
// unless they already have a user assigned section.
34
if
(
AVR::isProgramMemoryAddress
(GO) && !GO->
hasSection
())
35
return
ProgmemDataSection;
36
37
// Otherwise, we work the same way as ELF.
38
return
Base::SelectSectionForGlobal
(GO, Kind, TM);
39
}
40
}
// end of namespace llvm
41
AVRTargetObjectFile.h
llvm::MCSection
Instances of this class represent a uniqued identifier for a section in the current translation unit...
Definition:
MCSection.h:39
MCContext.h
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
llvm::ELF::SHF_ALLOC
Definition:
ELF.h:883
DerivedTypes.h
llvm::AVRTargetObjectFile::SelectSectionForGlobal
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Definition:
AVRTargetObjectFile.cpp:29
ELF.h
llvm::ELF::SHT_PROGBITS
Definition:
ELF.h:813
MCSectionELF.h
llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal
MCSection * SelectSectionForGlobal(const GlobalObject *GO, SectionKind Kind, const TargetMachine &TM) const override
Definition:
TargetLoweringObjectFileImpl.cpp:658
llvm::AVR::isProgramMemoryAddress
bool isProgramMemoryAddress(T *V)
Checks if a given type is a pointer to program memory.
Definition:
AVR.h:44
llvm::MCContext
Context object for machine code objects.
Definition:
MCContext.h:63
Mangler.h
llvm::SystemZISD::TM
Definition:
SystemZISelLowering.h:68
GlobalValue.h
llvm::SectionKind
SectionKind - This is a simple POD value that classifies the properties of a section.
Definition:
SectionKind.h:23
llvm::GlobalObject::hasSection
bool hasSection() const
Check if this global has a custom object file section.
Definition:
GlobalObject.h:82
llvm::TargetLoweringObjectFileELF::TM
const TargetMachine * TM
Definition:
TargetLoweringObjectFileImpl.h:39
llvm::GlobalObject
Definition:
GlobalObject.h:30
Kind
const unsigned Kind
Definition:
ARMAsmParser.cpp:10586
AVR.h
llvm::MCContext::getELFSection
MCSectionELF * getELFSection(const Twine &Section, unsigned Type, unsigned Flags)
Definition:
MCContext.h:389
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition:
TargetMachine.h:59
llvm::TargetLoweringObjectFileELF::Initialize
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
Definition:
TargetLoweringObjectFileImpl.cpp:94
llvm::AVRTargetObjectFile::Initialize
void Initialize(MCContext &ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
Definition:
AVRTargetObjectFile.cpp:22
Generated on Sun Dec 20 2020 13:56:39 for LLVM by
1.8.13