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();
106 markDefined(*Symbol);
110 Align ByteAlignment) {
111 markDefined(*Symbol);
115 auto SI = Symbols.
find(
Sym->getName());
116 if (SI == Symbols.
end())
123 bool KeepOriginalSym) {
124 SymverAliasMap[OriginalSym].push_back(
Name);
129 return {SymverAliasMap.begin(), SymverAliasMap.end()};
143 MangledName.
reserve(GV.getName().size() + 1);
145 MangledNameMap[MangledName] = &GV;
150 for (
auto &Symver : SymverAliasMap) {
151 const MCSymbol *Aliasee = Symver.first;
153 bool IsDefined =
false;
187 if (
MI != MangledNameMap.
end())
206 for (
auto AliasName : Symver.second) {
207 std::pair<StringRef, StringRef> Split = AliasName.split(
"@@@");
209 if (!Split.second.empty() && !Split.second.starts_with(
"@")) {
212 const char *Separator = IsDefined ?
"@@" :
"@";
214 (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 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.
MCContext & getContext() const
virtual void emitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
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.
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.