Go to the documentation of this file.
56 assert(FirstMod->getTargetTriple() ==
M->getTargetTriple());
61 SymTab.push_back(&GV);
64 SymTab.push_back(
new (AsmSymbols.Allocate())
77 const Triple TT(
M.getTargetTriple());
81 std::unique_ptr<MCRegisterInfo>
MRI(
T->createMCRegInfo(TT.str()));
86 std::unique_ptr<MCAsmInfo> MAI(
T->createMCAsmInfo(*
MRI, TT.str(), MCOptions));
90 std::unique_ptr<MCSubtargetInfo> STI(
91 T->createMCSubtargetInfo(TT.str(),
"",
""));
95 std::unique_ptr<MCInstrInfo> MCII(
T->createMCInstrInfo());
104 std::unique_ptr<MCObjectFileInfo> MOFI(
105 T->createMCObjectFileInfo(MCCtx,
false));
106 MOFI->setSDKVersion(
M.getSDKVersion());
109 T->createNullTargetStreamer(Streamer);
111 std::unique_ptr<MCAsmParser> Parser(
114 std::unique_ptr<MCTargetAsmParser> TAP(
115 T->createMCAsmParser(*STI, *Parser, *MCII, MCOptions));
123 Parser->setTargetParser(*TAP);
124 if (Parser->Run(
false))
136 for (
auto &KV : Streamer) {
171 for (
auto &Alias : KV.second)
172 AsmSymver(KV.first->getName(), Alias);
183 if (GV->hasDLLImportStorageClass())
186 Mang.getNameWithPrefix(OS, GV,
false);
196 if (GV->isDeclarationForLinker())
198 else if (GV->hasHiddenVisibility() && !GV->hasLocalLinkage())
201 if (GVar->isConstant())
205 if (isa<Function>(GO) || isa<GlobalIFunc>(GO))
207 if (isa<GlobalAlias>(GV))
209 if (GV->hasPrivateLinkage())
211 if (!GV->hasLocalLinkage())
213 if (GV->hasCommonLinkage())
215 if (GV->hasLinkOnceLinkage() || GV->hasWeakLinkage() ||
216 GV->hasExternalWeakLinkage())
219 if (GV->getName().startswith(
"llvm."))
221 else if (
auto *Var = dyn_cast<GlobalVariable>(GV)) {
222 if (Var->getSection() ==
"llvm.metadata")
This is an optimization pass for GlobalISel generic memory operations.
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
std::pair< std::string, uint32_t > AsmSymbol
Context object for machine code objects.
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
static const Target * lookupTarget(const std::string &Triple, std::string &Error)
lookupTarget - Lookup a target based on a target triple.
static std::unique_ptr< MemoryBuffer > getMemBuffer(StringRef InputData, StringRef BufferName="", bool RequiresNullTerminator=true)
Open the specified memory range as a MemoryBuffer.
Represents a location in source code.
void setObjectFileInfo(const MCObjectFileInfo *Mofi)
This class implements an extremely fast bulk output stream that can only output to a stream.
void printSymbolName(raw_ostream &OS, Symbol S) const
void addModule(Module *M)
iterator_range< const_symver_iterator > symverAliases()
An efficient, type-erasing, non-owning reference to a callable.
bar al al movzbl eax ret Missed when stored in a memory object
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
A Module instance is used to store all the information related to an LLVM module.
static void initializeRecordStreamer(const Module &M, function_ref< void(RecordStreamer &)> Init)
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This owns the files read by a parser, handles include stacks, and handles diagnostic wrangling.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
const GlobalObject * getAliaseeObject() const
this could be done in SelectionDAGISel along with other special for
unsigned const MachineRegisterInfo * MRI
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
uint32_t getSymbolFlags(Symbol S) const
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 AddNewSourceBuffer(std::unique_ptr< MemoryBuffer > F, SMLoc IncludeLoc)
Add a new source buffer to this source manager.
MCAsmParser * createMCAsmParser(SourceMgr &, MCContext &, MCStreamer &, const MCAsmInfo &, unsigned CB=0)
Create an MCAsmParser instance for parsing assembly similar to gas syntax.
void flushSymverDirectives()
LLVM Value Representation.
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.