64 SymTab.push_back(&GV);
67 SymTab.push_back(
new (AsmSymbols.Allocate())
AsmSymbol(Name, Flags));
75 if (InlineAsm.
empty())
81 assert(T && T->hasMCAsmParser());
83 std::unique_ptr<MCRegisterInfo>
MRI(T->createMCRegInfo(TT.str()));
87 std::unique_ptr<MCAsmInfo> MAI(T->createMCAsmInfo(*MRI, TT.str()));
91 std::unique_ptr<MCSubtargetInfo> STI(
92 T->createMCSubtargetInfo(TT.str(),
"",
""));
96 std::unique_ptr<MCInstrInfo> MCII(T->createMCInstrInfo());
101 MCContext MCCtx(MAI.get(), MRI.get(), &MOFI);
105 T->createNullTargetStreamer(Streamer);
110 std::unique_ptr<MCAsmParser> Parser(
114 std::unique_ptr<MCTargetAsmParser> TAP(
115 T->createMCAsmParser(*STI, *Parser, *MCII, MCOptions));
119 Parser->setTargetParser(*TAP);
120 if (Parser->Run(
false))
132 for (
auto &KV : Streamer) {
167 for (
auto &Alias : KV.second)
168 AsmSymver(KV.first->getName(), Alias);
179 if (GV->hasDLLImportStorageClass())
182 Mang.getNameWithPrefix(OS, GV,
false);
192 if (GV->isDeclarationForLinker())
194 else if (GV->hasHiddenVisibility() && !GV->hasLocalLinkage())
197 if (GVar->isConstant())
200 if (dyn_cast_or_null<Function>(GV->getBaseObject()))
202 if (isa<GlobalAlias>(GV))
204 if (GV->hasPrivateLinkage())
206 if (!GV->hasLocalLinkage())
208 if (GV->hasCommonLinkage())
210 if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() ||
211 GV->hasExternalWeakLinkage())
214 if (GV->getName().startswith(
"llvm."))
216 else if (
auto *Var = dyn_cast<GlobalVariable>(GV)) {
217 if (Var->getSection() ==
"llvm.metadata")
const std::string & getTargetTriple() const
Get the target triple which is a string describing the target host.
uint32_t getSymbolFlags(Symbol S) const
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
static std::unique_ptr< MemoryBuffer > getMemBuffer(StringRef InputData, StringRef BufferName="", bool RequiresNullTerminator=true)
Open the specified memory range as a MemoryBuffer.
An efficient, type-erasing, non-owning reference to a callable.
static const Target * lookupTarget(const std::string &Triple, std::string &Error)
lookupTarget - Lookup a target based on a target triple.
MCAsmParser * createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &, const MCAsmInfo &, unsigned CB=0)
Create an MCAsmParser instance.
void flushSymverDirectives()
amdgpu Simplify well known AMD library false Value Value const Twine & Name
void addModule(Module *M)
static void CollectAsmSymbols(const Module &M, function_ref< void(StringRef, object::BasicSymbolRef::Flags)> AsmSymbol)
Parse inline ASM and collect the symbols that are defined or referenced in the current module...
Context object for machine code objects.
unsigned AddNewSourceBuffer(std::unique_ptr< MemoryBuffer > F, SMLoc IncludeLoc)
Add a new source buffer to this source manager.
LLVM_NODISCARD LLVM_ATTRIBUTE_ALWAYS_INLINE bool empty() const
empty - Check if the string is empty.
std::pair< std::string, uint32_t > AsmSymbol
static void initializeRecordStreamer(const Module &M, function_ref< void(RecordStreamer &)> Init)
static void CollectAsmSymvers(const Module &M, function_ref< void(StringRef, StringRef)> AsmSymver)
Parse inline ASM and collect the symvers directives that are defined in the current module...
unsigned const MachineRegisterInfo * MRI
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Triple - Helper class for working with autoconf configuration names.
Module.h This file contains the declarations for the Module class.
void setSDKVersion(const VersionTuple &TheSDKVersion)
Target - Wrapper for Target specific information.
void printSymbolName(raw_ostream &OS, Symbol S) const
void InitMCObjectFileInfo(const Triple &TT, bool PIC, MCContext &ctx, bool LargeCodeModel=false)
const std::string & getModuleInlineAsm() const
Get any module-scope inline assembly blocks.
T get() const
Returns the value of the specified pointer type.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.
iterator_range< const_symver_iterator > symverAliases()
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.
int is() const
Test if the Union currently holds the type matching T.
Represents a location in source code.
VersionTuple getSDKVersion() const
Get the build SDK version metadata.
iterator_range< global_value_iterator > global_values()
A discriminated union of two pointer types, with the discriminator in the low bit of the pointer...