37 void RecordStreamer::markGlobal(
const MCSymbol &Symbol,
57 void RecordStreamer::markUsed(
const MCSymbol &Symbol) {
74 void RecordStreamer::visitUsedSymbol(
const MCSymbol &Sym) { markUsed(Sym); }
80 return Symbols.
begin();
103 markGlobal(*Symbol, Attribute);
112 markDefined(*Symbol);
117 markDefined(*Symbol);
122 if (
SI == Symbols.
end())
129 SymverAliasMap[Aliasee].push_back(AliasName);
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);
bool isDeclarationForLinker() const
Instances of this class represent a uniqued identifier for a section in the current translation unit...
bool hasLocalLinkage() const
static const MCSymbolRefExpr * create(const MCSymbol *Symbol, MCContext &Ctx)
This class represents lattice values for constants.
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
A Module instance is used to store all the information related to an LLVM module. ...
void emitELFSymverDirective(StringRef AliasName, const MCSymbol *Aliasee) override
Record .symver aliases for later processing.
bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) override
Add the given Attribute to Symbol.
void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value) override
Emit an assignment of Value to Symbol.
iterator find(StringRef Key)
StringMap< State >::const_iterator const_iterator
void reserve(size_type N)
virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, bool PrintSchedInfo=false)
Emit the given Instruction into the current section.
MCContext & getContext() const
void flushSymverDirectives()
Base class for the full range of assembler expressions which are needed for parsing.
virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value)
Emit an assignment of Value to Symbol.
Context object for machine code objects.
bool hasExternalLinkage() const
GlobalValue * getNamedValue(StringRef Name) const
Return the global value in the module with the specified name, of arbitrary type. ...
Instances of this class represent a single low-level machine instruction.
static bool isWeakForLinker(LinkageTypes Linkage)
Whether the definition of this global may be replaced at link time.
Streaming machine code generation interface.
StringRef toStringRef(bool B)
Construct a string ref from a boolean.
void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI, bool) override
Emit the given Instruction into the current section.
Module.h This file contains the declarations for the Module class.
A range adaptor for a pair of iterators.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
void EmitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment, SMLoc Loc=SMLoc()) override
Emit the zerofill section and an optional symbol.
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
Generic base class for all target subtargets.
void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) override
Emit a common symbol.
void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc()) override
Emit a label for Symbol into the current section.
StringRef getName() const
getName - Get the symbol name.
LLVM Value Representation.
iterator_range< const_symver_iterator > symverAliases()
virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc=SMLoc())
Emit a label for Symbol into the current section.
void getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV, bool CannotUsePrivateLabel) const
Print the appropriate prefix and the specified global variable's name.
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.
static void Split(std::vector< std::string > &V, StringRef S)
Splits a string of comma separated items in to a vector of strings.
iterator_range< global_value_iterator > global_values()
RecordStreamer(MCContext &Context, const Module &M)