Go to the documentation of this file.
29 std::vector<std::unique_ptr<Module>> Mods)
31 for (
auto &
M : this->Mods)
32 SymTab.addModule(
M.get());
35 IRObjectFile::~IRObjectFile() =
default;
46 SymTab.printSymbolName(OS,
getSym(Symb));
47 return Error::success();
51 return SymTab.getSymbolFlags(
getSym(Symb));
56 Ret.p =
reinterpret_cast<uintptr_t
>(SymTab.symbols().data());
62 Ret.p =
reinterpret_cast<uintptr_t
>(SymTab.symbols().data() +
63 SymTab.symbols().size());
70 return Mods[0]->getTargetTriple();
74 IRObjectFile::findBitcodeInObject(
const ObjectFile &Obj) {
76 if (Sec.isBitcode()) {
80 if (Contents->size() <= 1)
95 case file_magic::elf_relocatable:
96 case file_magic::macho_object:
97 case file_magic::wasm_object:
98 case file_magic::coff_object: {
103 return findBitcodeInObject(*ObjFile->
get());
121 std::vector<std::unique_ptr<Module>> Mods;
122 for (
auto BM : *BMsOrErr) {
124 BM.getLazyModule(
Context,
true,
132 return std::unique_ptr<IRObjectFile>(
139 IRObjectFile::findBitcodeInMemBuffer(MBRef);
The contents of a bitcode file and its irsymtab.
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
file_magic - An "enum class" enumeration of file types based on magic (the first N bytes of the file)...
Expected< IRSymtabFile > readIRSymtab(MemoryBufferRef MBRef)
Reads a bitcode file, creating its irsymtab if necessary.
The instances of the Type class are immutable: once they are created, they are never changed.
Tagged union holding either a T or a Error.
static ModuleSymbolTable::Symbol getSym(DataRefImpl &Symb)
Expected< BitcodeFileContents > getBitcodeFileContents(MemoryBufferRef Buffer)
Returns the contents of a bitcode file.
Error errorCodeToError(std::error_code EC)
Helper for converting an std::error_code to a Error.
This is a value type class that represents a single symbol in the list of symbols in the object file.
This class implements an extremely fast bulk output stream that can only output to a stream.
Expected< FileContents > readBitcode(const BitcodeFileContents &BFC)
Reads the contents of a bitcode file, creating its irsymtab if necessary.
This is a value type class that represents a single section in the list of sections in the object fil...
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
This is an important class for using LLVM in a threaded context.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
StringRef - Represent a constant reference to a string, i.e.
This class is the base class for all object file types.
reference get()
Returns a reference to the stored T value.
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
Lightweight error class with error context and mandatory checking.
Error takeError()
Take ownership of the stored error.
StringRef getFileName() const
section_iterator_range sections() const
Expected< std::vector< BitcodeModule > > getBitcodeModuleList(MemoryBufferRef Buffer)
Returns a list of modules in the specified bitcode buffer.
file_magic identify_magic(StringRef magic)
Identify the type of a binary file based on how magical it is.
content_iterator< BasicSymbolRef > basic_symbol_iterator