LLVM  3.7.0
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"
13 #include "llvm/Support/Dwarf.h"
15 
16 using namespace llvm;
17 
19  const GlobalValue *GV, unsigned Encoding, Mangler &Mang,
20  const TargetMachine &TM, MachineModuleInfo *MMI,
21  MCStreamer &Streamer) const {
22 
23  if (Encoding & dwarf::DW_EH_PE_pcrel) {
25 
26  MCSymbol *SSym = getSymbolWithGlobalValueBase(GV, ".DW.stub", Mang, TM);
27 
28  // Add information about the stub reference to ELFMMI so that the stub
29  // gets emitted by the asmprinter.
30  MachineModuleInfoImpl::StubValueTy &StubSym = ELFMMI.getGVStubEntry(SSym);
31  if (!StubSym.getPointer()) {
32  MCSymbol *Sym = TM.getSymbol(GV, Mang);
34  }
35 
36  MCContext &Ctx = getContext();
38  MCSymbolRefExpr::create(SSym, Ctx), Ctx);
39  }
40 
42  GV, Encoding, Mang, TM, MMI, Streamer);
43 }
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
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
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
MCSymbol * getSymbolWithGlobalValueBase(const GlobalValue *GV, StringRef Suffix, Mangler &Mang, const TargetMachine &TM) const
Return the MCSymbol for a private symbol with global value name as its base, with the specified suffi...
Streaming machine code generation interface.
Definition: MCStreamer.h:157
PointerIntPair - This class implements a pair of a pointer and small integer.
Ty & getObjFileInfo()
getInfo - Keep track of various per-function pieces of information for backends that would like to do...
StubValueTy & getGVStubEntry(MCSymbol *Sym)
MCSymbol * getSymbol(const GlobalValue *GV, Mangler &Mang) const
PointerTy getPointer() const
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...
MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation for ELF targets.
static const SparcMCExpr * create(VariantKind Kind, const MCExpr *Expr, MCContext &Ctx)
Definition: SparcMCExpr.cpp:28
bool hasLocalLinkage() const
Definition: GlobalValue.h:280
Primary interface to the complete machine description for the target machine.
MachineModuleInfo - This class contains meta information specific to a module.
This file describes how to lower LLVM code to machine code.