LLVM 24.0.0git
SparcTargetObjectFile.cpp
Go to the documentation of this file.
1//===------- SparcTargetObjectFile.cpp - Sparc Object Info Impl -----------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
15
16using namespace llvm;
17
23
25 const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM,
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.
36 if (!StubSym.getPointer()) {
37 MCSymbol *Sym = TM.getSymbol(GV);
39 }
40
41 MCContext &Ctx = getContext();
42 return MCSpecifierExpr::create(SSym, ELF::R_SPARC_DISP32, Ctx);
43 }
44
46 MMI, Streamer);
47}
This file contains constants used for implementing Dwarf debug support.
std::unique_ptr< MCStreamer > && Streamer
This file describes how to lower LLVM code to machine code.
bool hasLocalLinkage() const
Context object for machine code objects.
Definition MCContext.h:83
Base class for the full range of assembler expressions which are needed for parsing.
Definition MCExpr.h:34
MCContext & getContext() const
static const MCSpecifierExpr * create(const MCExpr *Expr, Spec S, MCContext &Ctx, SMLoc Loc=SMLoc())
Definition MCExpr.cpp:743
Streaming machine code generation interface.
Definition MCStreamer.h:222
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition MCSymbol.h:42
MachineModuleInfoELF - This is a MachineModuleInfoImpl implementation for ELF targets.
StubValueTy & getGVStubEntry(MCSymbol *Sym)
PointerIntPair< MCSymbol *, 1, bool > StubValueTy
This class contains meta information specific to a module.
Ty & getObjFileInfo()
Keep track of various per-module pieces of information for backends that would like to do so.
A Module instance is used to store all the information related to an LLVM module.
Definition Module.h:68
PointerTy getPointer() const
void initialize(MCContext &Ctx, const TargetMachine &TM, const Module &M) override
This method must be called before any actual lowering is done.
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 global variable from exception handling info...
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...
void initialize(MCContext &Ctx, const TargetMachine &TM, const Module &M) override
This method must be called before any actual lowering is done.
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...
Primary interface to the complete machine description for the target machine.
@ DW_EH_PE_pcrel
Definition Dwarf.h:977
This is an optimization pass for GlobalISel generic memory operations.