LLVM  3.7.0
ARMTargetObjectFile.cpp
Go to the documentation of this file.
1 //===-- llvm/Target/ARMTargetObjectFile.cpp - ARM Object Info Impl --------===//
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 "ARMTargetObjectFile.h"
11 #include "ARMTargetMachine.h"
12 #include "llvm/ADT/StringExtras.h"
13 #include "llvm/IR/Mangler.h"
14 #include "llvm/MC/MCAsmInfo.h"
15 #include "llvm/MC/MCContext.h"
16 #include "llvm/MC/MCExpr.h"
17 #include "llvm/MC/MCSectionELF.h"
18 #include "llvm/Support/Dwarf.h"
19 #include "llvm/Support/ELF.h"
21 using namespace llvm;
22 using namespace dwarf;
23 
24 //===----------------------------------------------------------------------===//
25 // ELF Target
26 //===----------------------------------------------------------------------===//
27 
29  const TargetMachine &TM) {
30  bool isAAPCS_ABI = static_cast<const ARMTargetMachine &>(TM).TargetABI ==
31  ARMTargetMachine::ARMABI::ARM_ABI_AAPCS;
33  InitializeELF(isAAPCS_ABI);
34 
35  if (isAAPCS_ABI) {
36  LSDASection = nullptr;
37  }
38 
39  AttributesSection =
40  getContext().getELFSection(".ARM.attributes", ELF::SHT_ARM_ATTRIBUTES, 0);
41 }
42 
44  const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
45  const TargetMachine &TM, MachineModuleInfo *MMI,
46  MCStreamer &Streamer) const {
49  GV, Encoding, Mang, TM, MMI, Streamer);
50 
51  assert(Encoding == DW_EH_PE_absptr && "Can handle absptr encoding only");
52 
53  return MCSymbolRefExpr::create(TM.getSymbol(GV, Mang),
54  MCSymbolRefExpr::VK_ARM_TARGET2, getContext());
55 }
56 
60  getContext());
61 }
const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, Mangler &Mang, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const override
Return an MCExpr to use for a reference to the specified type info global variable from exception han...
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:315
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:39
setjmp/longjmp based exceptions
const MCAsmInfo * getMCAsmInfo() const
Return target specific asm information.
virtual void Initialize(MCContext &ctx, const TargetMachine &TM)
This method must be called before any actual lowering is done.
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:33
Context object for machine code objects.
Definition: MCContext.h:48
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
Streaming machine code generation interface.
Definition: MCStreamer.h:157
ExceptionHandling getExceptionHandlingType() const
Definition: MCAsmInfo.h:511
MCSymbol * getSymbol(const GlobalValue *GV, Mangler &Mang) const
ARMTargetMachine - ARM target machine.
const MCExpr * getDebugThreadLocalSymbol(const MCSymbol *Sym) const override
Describe a TLS variable address within debug info.
Primary interface to the complete machine description for the target machine.
const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, Mangler &Mang, const TargetMachine &TM, MachineModuleInfo *MMI, MCStreamer &Streamer) const override
Return an MCExpr to use for a reference to the specified type info global variable from exception han...
MachineModuleInfo - This class contains meta information specific to a module.
This file describes how to lower LLVM code to machine code.