38 using namespace object;
49 SymTab.push_back(&GV);
51 SymTab.push_back(&GA);
53 CollectAsmSymbols(
Triple(M->getTargetTriple()), M->getModuleInlineAsm(),
55 SymTab.push_back(
new (AsmSymbols.Allocate())
63 if (InlineAsm.
empty())
78 std::unique_ptr<MCSubtargetInfo> STI(
88 MCContext MCCtx(MAI.get(), MRI.get(), &MOFI);
96 std::unique_ptr<MCAsmParser> Parser(
100 std::unique_ptr<MCTargetAsmParser> TAP(
105 Parser->setTargetParser(*TAP);
106 if (Parser->Run(
false))
109 for (
auto &KV : Streamer) {
146 if (GV->hasDLLImportStorageClass())
149 Mang.getNameWithPrefix(OS, GV,
false);
159 if (GV->isDeclarationForLinker())
161 else if (GV->hasHiddenVisibility() && !GV->hasLocalLinkage())
164 if (GVar->isConstant())
167 if (dyn_cast_or_null<Function>(GV->getBaseObject()))
169 if (isa<GlobalAlias>(GV))
171 if (GV->hasPrivateLinkage())
173 if (!GV->hasLocalLinkage())
175 if (GV->hasCommonLinkage())
177 if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() ||
178 GV->hasExternalWeakLinkage())
181 if (GV->getName().startswith(
"llvm."))
183 else if (
auto *Var = dyn_cast<GlobalVariable>(GV)) {
184 if (Var->getSection() ==
"llvm.metadata")
A Module instance is used to store all the information related to an LLVM module. ...
std::pair< std::string, uint32_t > AsmSymbol
static std::unique_ptr< MemoryBuffer > getMemBuffer(StringRef InputData, StringRef BufferName="", bool RequiresNullTerminator=true)
Open the specified memory range as a MemoryBuffer.
MCRegisterInfo * createMCRegInfo(StringRef TT) const
createMCRegInfo - Create a MCRegisterInfo implementation.
An efficient, type-erasing, non-owning reference to a callable.
const std::string & str() const
static const Target * lookupTarget(const std::string &Triple, std::string &Error)
lookupTarget - Lookup a target based on a target triple.
const std::string & getTargetTriple() const
Get the target triple which is a string describing the target host.
void InitMCObjectFileInfo(const Triple &TT, bool PIC, CodeModel::Model CM, MCContext &ctx)
MCInstrInfo * createMCInstrInfo() const
createMCInstrInfo - Create a MCInstrInfo implementation.
MCSubtargetInfo * createMCSubtargetInfo(StringRef TheTriple, StringRef CPU, StringRef Features) const
createMCSubtargetInfo - Create a MCSubtargetInfo implementation.
struct fuzzer::@269 Flags
void addModule(Module *M)
Context object for machine code objects.
MCTargetAsmParser * createMCAsmParser(const MCSubtargetInfo &STI, MCAsmParser &Parser, const MCInstrInfo &MII, const MCTargetOptions &Options) const
createMCAsmParser - Create a target specific assembly parser.
unsigned AddNewSourceBuffer(std::unique_ptr< MemoryBuffer > F, SMLoc IncludeLoc)
Add a new source buffer to this source manager.
MCAsmInfo * createMCAsmInfo(const MCRegisterInfo &MRI, StringRef TheTriple) const
createMCAsmInfo - Create a MCAsmInfo implementation for the specified target triple.
unsigned const MachineRegisterInfo * MRI
MCAsmParser * createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &, const MCAsmInfo &)
Create an MCAsmParser instance.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
bool hasMCAsmParser() const
hasMCAsmParser - Check if this target supports assembly parsing.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
T get() const
Returns the value of the specified pointer type.
Module.h This file contains the declarations for the Module class.
MCTargetStreamer * createNullTargetStreamer(MCStreamer &S) const
Target - Wrapper for Target specific information.
uint32_t getSymbolFlags(Symbol S) const
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
void printSymbolName(raw_ostream &OS, Symbol S) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static void CollectAsmSymbols(const Triple &TheTriple, StringRef InlineAsm, function_ref< void(StringRef, object::BasicSymbolRef::Flags)> AsmSymbol)
Parse inline ASM and collect the symbols that are defined or referenced in the current module...
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream...
StringRef - Represent a constant reference to a string, i.e.
Represents a location in source code.
int is() const
Test if the Union currently holds the type matching T.
A discriminated union of two pointer types, with the discriminator in the low bit of the pointer...