17void RecordStreamer::markDefined(
const MCSymbol &Symbol) {
36void RecordStreamer::markGlobal(
const MCSymbol &Symbol,
56void RecordStreamer::markUsed(
const MCSymbol &Symbol) {
73void RecordStreamer::visitUsedSymbol(
const MCSymbol &
Sym) { markUsed(
Sym); }
79 return Symbols.
begin();
111 markDefined(*Symbol);
115 Align ByteAlignment) {
116 markDefined(*Symbol);
120 auto SI = Symbols.
find(
Sym->getName());
121 if (SI == Symbols.
end())
128 bool KeepOriginalSym) {
129 SymverAliasMap[OriginalSym].push_back(
Name);
134 return {SymverAliasMap.begin(), SymverAliasMap.end()};
148 MangledName.
reserve(GV.getName().size() + 1);
150 MangledNameMap[MangledName] = &GV;
155 for (
auto &Symver : SymverAliasMap) {
156 const MCSymbol *Aliasee = Symver.first;
158 bool IsDefined =
false;
192 if (
MI != MangledNameMap.
end())
211 for (
auto AliasName : Symver.second) {
212 std::pair<StringRef, StringRef> Split = AliasName.split(
"@@@");
214 if (!Split.second.empty() && !Split.second.startswith(
"@")) {
217 const char *Separator = IsDefined ?
"@@" :
"@";
219 (Split.first + Separator + Split.second).
toStringRef(NewName);
Module.h This file contains the declarations for the Module class.
bool hasExternalLinkage() const
bool hasLocalLinkage() const
bool isDeclarationForLinker() const
static bool isWeakForLinker(LinkageTypes Linkage)
Whether the definition of this global may be replaced at link time.
Context object for machine code objects.
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Base class for the full range of assembler expressions which are needed for parsing.
Instances of this class represent a single low-level machine instruction.
Instances of this class represent a uniqued identifier for a section in the current translation unit.
Streaming machine code generation interface.
virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
virtual void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI)
Emit the given Instruction into the current section.
MCContext & getContext() const
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
Generic base class for all target subtargets.
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
StringRef getName() const
getName - Get the symbol name.
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
A Module instance is used to store all the information related to an LLVM module.
GlobalValue * getNamedValue(StringRef Name) const
Return the global value in the module with the specified name, of arbitrary type.
iterator_range< global_value_iterator > global_values()
void emitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size, Align ByteAlignment, SMLoc Loc=SMLoc()) override
Emit the zerofill section and an optional symbol.
void emitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override
Emit the given Instruction into the current section.
bool emitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
void emitCommonSymbol(MCSymbol *Symbol, uint64_t Size, Align ByteAlignment) override
Emit a common symbol.
void emitELFSymverDirective(const MCSymbol *OriginalSym, StringRef Name, bool KeepOriginalSym) override
Record .symver aliases for later processing.
void emitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
Emit an assignment of Value to Symbol.
iterator_range< const_symver_iterator > symverAliases()
StringMap< State >::const_iterator const_iterator
RecordStreamer(MCContext &Context, const Module &M)
void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
void flushSymverDirectives()
Represents a location in source code.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void reserve(size_type N)
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
iterator find(StringRef Key)
StringRef - Represent a constant reference to a string, i.e.
LLVM Value Representation.
A range adaptor for a pair of iterators.
StringRef toStringRef(const std::optional< DWARFFormValue > &V, StringRef Default={})
Take an optional DWARFFormValue and try to extract a string value from it.
This is an optimization pass for GlobalISel generic memory operations.
@ MCSA_LazyReference
.lazy_reference (MachO)
@ MCSA_Global
.type _foo, @gnu_unique_object
@ MCSA_Invalid
Not a valid directive.
This struct is a compact representation of a valid (non-zero power of two) alignment.