LLVM 20.0.0git
|
#include "llvm/Object/ArchiveWriter.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/COFF.h"
#include "llvm/Object/COFFImportFile.h"
#include "llvm/Object/Error.h"
#include "llvm/Object/IRObjectFile.h"
#include "llvm/Object/MachO.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/SymbolicFile.h"
#include "llvm/Object/XCOFFObjectFile.h"
#include "llvm/Support/Alignment.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/SmallVectorMemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
#include <cerrno>
#include <map>
#include <unistd.h>
Go to the source code of this file.
Classes | |
struct | SymMap |
Namespaces | |
namespace | llvm |
This is an optimization pass for GlobalISel generic memory operations. | |
Variables | |
static const uint32_t | Log2OfAIXPageSize = 12 |
static const uint32_t | MinBigArchiveMemDataAlign = 2 |
Definition at line 428 of file ArchiveWriter.cpp.
References SymMap::ECMap, llvm::offsetToAlignment(), and Size.
Referenced by computeHeadersSize(), and writeECSymbols().
|
static |
Definition at line 459 of file ArchiveWriter.cpp.
References computeECSymbolsSize(), computeSymbolMapSize(), computeSymbolTableSize(), SymMap::ECMap, is64BitKind(), llvm::SmallVectorBase< Size_T >::size(), Size, and writeSymbolTableHeader().
Referenced by llvm::writeArchiveToStream().
|
static |
Definition at line 778 of file ArchiveWriter.cpp.
References llvm::alignTo(), llvm::alignToPowerOf2(), llvm::ArrayRef< T >::begin(), llvm::createFileError(), llvm::Data, llvm::raw_ostream::flush(), llvm::get(), llvm::MemoryBufferRef::getBuffer(), llvm::MemoryBufferRef::getBufferSize(), getMemberAlignment(), getSymbolicFile(), getSymbols(), isAIXBigArchive(), isAnyArm64COFF(), isCOFFArchive(), isDarwin(), isECObject(), llvm::object::Archive::MaxMemberSize, llvm::NoSymtab, llvm::offsetToAlignment(), llvm::object::parse_failed, printBigArchiveMemberHeader(), printMemberHeader(), llvm::ArrayRef< T >::size(), Size, llvm::Expected< T >::takeError(), llvm::raw_ostream::tell(), llvm::sys::toTimePoint(), and SymMap::UseECMap.
Referenced by llvm::writeArchiveToStream().
|
static |
Definition at line 342 of file ArchiveWriter.cpp.
References llvm::raw_ostream::flush(), llvm::offsetToAlignment(), printWithSpacePadding(), llvm::StringRef::size(), and Size.
Referenced by llvm::writeArchiveToStream().
|
static |
Definition at line 413 of file ArchiveWriter.cpp.
References SymMap::Map, llvm::offsetToAlignment(), and Size.
Referenced by computeHeadersSize(), and writeSymbolMap().
|
static |
Definition at line 384 of file ArchiveWriter.cpp.
References assert(), isAIXBigArchive(), isBSDLike(), llvm::offsetToAlignment(), and Size.
Referenced by computeHeadersSize(), and writeSymbolTable().
uint16_t getAuxMaxAlignment | ( | uint16_t | AuxHeaderSize, |
AuxiliaryHeader * | AuxHeader, | ||
uint16_t | Log2OfMaxAlign | ||
) |
Definition at line 547 of file ArchiveWriter.cpp.
References Log2OfAIXPageSize, MinBigArchiveMemDataAlign, and offsetof.
Referenced by getMemberAlignment().
|
static |
Definition at line 580 of file ArchiveWriter.cpp.
References llvm::object::XCOFFFileHeader32::AuxHeaderSize, llvm::object::XCOFFFileHeader64::AuxHeaderSize, llvm::object::XCOFFObjectFile::auxiliaryHeader32(), llvm::object::XCOFFObjectFile::auxiliaryHeader64(), llvm::object::XCOFFObjectFile::fileHeader32(), llvm::object::XCOFFObjectFile::fileHeader64(), getAuxMaxAlignment(), llvm::object::XCOFFObjectFile::is64Bit(), Log2OfAIXPageSize, and MinBigArchiveMemDataAlign.
Referenced by computeMemberData().
|
static |
Definition at line 485 of file ArchiveWriter.cpp.
References llvm::file_magic::bitcode, llvm::object::SymbolicFile::createSymbolicFile(), llvm::MemoryBufferRef::getBuffer(), llvm::identify_magic(), llvm::object::SymbolicFile::isSymbolicFile(), llvm::object::Archive::K_AIXBIG, llvm::object::Archive::K_BSD, llvm::object::Archive::K_COFF, llvm::object::Archive::K_DARWIN, llvm::object::Archive::K_DARWIN64, llvm::object::Archive::K_GNU, and llvm::object::Archive::K_GNU64.
Referenced by computeMemberData().
|
static |
Definition at line 736 of file ArchiveWriter.cpp.
References SymMap::ECMap, isArchiveSymbol(), isECObject(), isImportDescriptor(), SymMap::Map, Name, llvm::object::SymbolicFile::symbols(), llvm::raw_ostream::tell(), and SymMap::UseECMap.
Referenced by computeMemberData(), and llvm::writeArchiveToStream().
|
static |
Definition at line 284 of file ArchiveWriter.cpp.
References llvm::object::Archive::K_AIXBIG, llvm::object::Archive::K_BSD, llvm::object::Archive::K_COFF, llvm::object::Archive::K_DARWIN, llvm::object::Archive::K_DARWIN64, llvm::object::Archive::K_GNU, llvm::object::Archive::K_GNU64, and llvm_unreachable.
Referenced by computeHeadersSize(), printNBits(), llvm::writeArchiveToStream(), writeSymbolTable(), and writeSymbolTableHeader().
|
static |
Definition at line 533 of file ArchiveWriter.cpp.
References llvm::object::SymbolicFile::is64Bit().
Referenced by llvm::writeArchiveToStream(), and writeSymbolTable().
|
static |
Definition at line 181 of file ArchiveWriter.cpp.
References llvm::object::Archive::K_AIXBIG.
Referenced by computeMemberData(), computeSymbolTableSize(), llvm::writeArchiveToStream(), writeSymbolTable(), and writeSymbolTableHeader().
|
static |
Definition at line 710 of file ArchiveWriter.cpp.
References llvm::Triple::aarch64, llvm::getBitcodeTargetTriple(), llvm::object::Binary::getMemoryBufferRef(), llvm::COFF::isAnyArm64(), llvm::object::Binary::isCOFF(), llvm::object::Binary::isCOFFImportFile(), and llvm::object::Binary::isIR().
Referenced by computeMemberData().
|
static |
Definition at line 362 of file ArchiveWriter.cpp.
References llvm::object::BasicSymbolRef::getFlags(), llvm::report_fatal_error(), llvm::object::BasicSymbolRef::SF_FormatSpecific, llvm::object::BasicSymbolRef::SF_Global, llvm::object::BasicSymbolRef::SF_Undefined, and llvm::Expected< T >::takeError().
Referenced by getSymbols().
|
static |
Definition at line 189 of file ArchiveWriter.cpp.
References llvm::object::Archive::K_AIXBIG, llvm::object::Archive::K_BSD, llvm::object::Archive::K_COFF, llvm::object::Archive::K_DARWIN, llvm::object::Archive::K_DARWIN64, llvm::object::Archive::K_GNU, llvm::object::Archive::K_GNU64, and llvm_unreachable.
Referenced by computeSymbolTableSize(), print(), printMemberHeader(), llvm::writeArchiveToStream(), writeSymbolTable(), and writeSymbolTableHeader().
|
static |
Definition at line 185 of file ArchiveWriter.cpp.
References llvm::object::Archive::K_COFF.
Referenced by computeMemberData(), printMemberHeader(), llvm::writeArchiveToStream(), and writeSymbolTable().
|
static |
Definition at line 176 of file ArchiveWriter.cpp.
References llvm::object::Archive::K_DARWIN, and llvm::object::Archive::K_DARWIN64.
Referenced by computeMemberData(), and writeSymbolTable().
|
static |
Definition at line 689 of file ArchiveWriter.cpp.
References llvm::getBitcodeTargetTriple(), llvm::object::Binary::getMemoryBufferRef(), llvm::COFF::IMAGE_FILE_MACHINE_ARM64, llvm::object::Binary::isCOFF(), llvm::object::Binary::isCOFFImportFile(), llvm::object::Binary::isIR(), and llvm::Triple::x86_64.
Referenced by computeMemberData(), and getSymbols().
Definition at line 729 of file ArchiveWriter.cpp.
References llvm::object::ImportDescriptorPrefix, Name, llvm::object::NullImportDescriptorSymbolName, llvm::object::NullThunkDataPrefix, and llvm::object::NullThunkDataSuffix.
Referenced by getSymbols().
|
static |
Definition at line 354 of file ArchiveWriter.cpp.
Referenced by llvm::TimeRecord::getCurrentTime(), writeECSymbols(), and writeSymbolTableHeader().
|
static |
Definition at line 205 of file ArchiveWriter.cpp.
References llvm::big, isBSDLike(), llvm::little, and llvm::support::endian::write().
Referenced by gen-regalloc-eviction-test-model::build_mock_model(), gen-regalloc-priority-test-model::build_mock_model(), gen-inline-oz-test-model::build_mock_model(), log_reader::main(), gen-inline-oz-test-model::main(), log_reader::pretty_print_tensor_value(), printLivenessInfo(), llvm::PassManager< IRUnitT, AnalysisManagerT, ExtraArgTs >::run(), and interactive_host::run_interactive().
|
static |
Definition at line 256 of file ArchiveWriter.cpp.
References llvm::format(), Name, printWithSpacePadding(), Size, llvm::sys::toTimeT(), and llvm::raw_ostream::write().
Referenced by computeMemberData(), llvm::writeArchiveToStream(), and writeSymbolTableHeader().
|
static |
Definition at line 240 of file ArchiveWriter.cpp.
References Name, llvm::offsetToAlignment(), printRestOfMemberHeader(), printWithSpacePadding(), Size, and llvm::raw_ostream::write().
Referenced by printMemberHeader(), and writeSymbolTableHeader().
|
static |
Definition at line 231 of file ArchiveWriter.cpp.
References Name, printRestOfMemberHeader(), printWithSpacePadding(), and Size.
Referenced by printMemberHeader(), writeECSymbols(), and writeSymbolTableHeader().
|
static |
Definition at line 211 of file ArchiveWriter.cpp.
References llvm::little, and llvm::support::endian::write().
Referenced by writeECSymbols(), and writeSymbolMap().
|
static |
Definition at line 300 of file ArchiveWriter.cpp.
References llvm::StringMap< ValueTy, AllocatorTy >::insert(), isBSDLike(), isCOFFArchive(), printBSDMemberHeader(), printGNUSmallMemberHeader(), printRestOfMemberHeader(), printWithSpacePadding(), Size, and useStringTable().
Referenced by computeMemberData().
|
static |
Definition at line 376 of file ArchiveWriter.cpp.
References is64BitKind().
Referenced by writeSymbolTable().
|
static |
Definition at line 215 of file ArchiveWriter.cpp.
References llvm::format(), printWithSpacePadding(), Size, and llvm::sys::toTimeT().
Referenced by printBSDMemberHeader(), printGNUSmallMemberHeader(), and printMemberHeader().
|
static |
Definition at line 168 of file ArchiveWriter.cpp.
References assert(), llvm::Data, llvm::raw_ostream::indent(), OS, Size, and llvm::raw_ostream::tell().
Referenced by computeStringTable(), printBigArchiveMemberHeader(), printBSDMemberHeader(), printGNUSmallMemberHeader(), printMemberHeader(), printRestOfMemberHeader(), and llvm::writeArchiveToStream().
Definition at line 280 of file ArchiveWriter.cpp.
References Name.
Referenced by printMemberHeader().
|
static |
Definition at line 671 of file ArchiveWriter.cpp.
References computeECSymbolsSize(), SymMap::ECMap, now(), printGNUSmallMemberHeader(), printLE(), Size, and llvm::raw_ostream::write().
Referenced by llvm::writeArchiveToStream().
|
static |
Definition at line 645 of file ArchiveWriter.cpp.
References computeSymbolMapSize(), SymMap::Map, printLE(), llvm::ArrayRef< T >::size(), Size, llvm::raw_ostream::write(), and writeSymbolTableHeader().
Referenced by llvm::writeArchiveToStream().
|
static |
Definition at line 595 of file ArchiveWriter.cpp.
References computeSymbolTableSize(), is64BitKind(), is64BitSymbolicFile(), isAIXBigArchive(), isBSDLike(), isCOFFArchive(), isDarwin(), printNBits(), llvm::StringTable::size(), Size, llvm::raw_ostream::write(), and writeSymbolTableHeader().
Referenced by llvm::writeArchiveToStream().
|
static |
Definition at line 442 of file ArchiveWriter.cpp.
References is64BitKind(), isAIXBigArchive(), isBSDLike(), Name, now(), printBigArchiveMemberHeader(), printBSDMemberHeader(), printGNUSmallMemberHeader(), Size, and llvm::raw_ostream::tell().
Referenced by computeHeadersSize(), writeSymbolMap(), and writeSymbolTable().
Definition at line 538 of file ArchiveWriter.cpp.
Referenced by getAuxMaxAlignment(), and getMemberAlignment().
Definition at line 544 of file ArchiveWriter.cpp.
Referenced by getAuxMaxAlignment(), and getMemberAlignment().