LLVM  8.0.1
SparcTargetObjectFile.cpp
Go to the documentation of this file.
1 //===------- SparcTargetObjectFile.cpp - Sparc 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 "SparcTargetObjectFile.h"
15 
16 using namespace llvm;
17 
19  const TargetMachine &TM) {
22 }
23 
25  const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM,
26  MachineModuleInfo *MMI, MCStreamer &Streamer) const {
27 
28  if (Encoding & dwarf::DW_EH_PE_pcrel) {
30 
31  MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, ".DW.stub", TM);
32 
33  // Add information about the stub reference to ELFMMI so that the stub
34  // gets emitted by the asmprinter.
35  MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(SSym);
36  if (!StubSym.getPointer()) {
37  MCSymbol *Sym = TM.getSymbol(GV);
39  }
40 
41  MCContext &Ctx = getContext();
43  MCSymbolRefExpr::create(SSym, Ctx), Ctx);
44  }
45 
47  MMI, Streamer);
48 }
bool hasLocalLinkage() const
Definition: GlobalValue.h:436
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
Definition: MCExpr.h:323
This class represents lattice values for constants.
Definition: AllocatorList.h:24
PointerTy getPointer() const
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:42
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
Base class for the full range of assembler expressions which are needed for parsing.
Definition: MCExpr.h:36
Context object for machine code objects.
Definition: MCContext.h:63
Streaming machine code generation interface.
Definition: MCStreamer.h:189
PointerIntPair - This class implements a pair of a pointer and small integer.
const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, 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...
MCSymbol * getSymbol(const GlobalValue *GV) const
MCSymbol * getSymbolWithGlobalValueBase(const GlobalValue *GV, StringRef Suffix, const TargetMachine &TM) const
Return the MCSymbol for a private symbol with global value name as its base, with the specified suffi...
Ty & getObjFileInfo()
Keep track of various per-function pieces of information for backends that would like to do so...
StubValueTy & getGVStubEntry(MCSymbol *Sym)
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
unsigned UseInitArray
UseInitArray - Use .init_array instead of .ctors for static constructors.
const MCExpr * getTTypeGlobalReference(const GlobalValue *GV, unsigned Encoding, 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...
This file contains constants used for implementing Dwarf debug support.
MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation for ELF targets.
TargetOptions Options
Definition: TargetMachine.h:97
static const SparcMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition: SparcMCExpr.cpp:27
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:59
void Initialize(MCContext &Ctx, const TargetMachine &TM) override
This method must be called before any actual lowering is done.
This class contains meta information specific to a module.
This file describes how to lower LLVM code to machine code.