LLVM  8.0.1
Functions
ArchiveWriter.cpp File Reference
#include "llvm/Object/ArchiveWriter.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/BinaryFormat/Magic.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/Object/Archive.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Object/SymbolicFile.h"
#include "llvm/Support/EndianStream.h"
#include "llvm/Support/Errc.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/ToolOutputFile.h"
#include "llvm/Support/raw_ostream.h"
#include <map>
#include <unistd.h>
Include dependency graph for ArchiveWriter.cpp:

Go to the source code of this file.

Functions

template<typename T >
static void printWithSpacePadding (raw_ostream &OS, T Data, unsigned Size)
 
static bool isDarwin (object::Archive::Kind Kind)
 
static bool isBSDLike (object::Archive::Kind Kind)
 
template<class T >
static void print (raw_ostream &Out, object::Archive::Kind Kind, T Val)
 
static void printRestOfMemberHeader (raw_ostream &Out, const sys::TimePoint< std::chrono::seconds > &ModTime, unsigned UID, unsigned GID, unsigned Perms, unsigned Size)
 
static void printGNUSmallMemberHeader (raw_ostream &Out, StringRef Name, const sys::TimePoint< std::chrono::seconds > &ModTime, unsigned UID, unsigned GID, unsigned Perms, unsigned Size)
 
static void printBSDMemberHeader (raw_ostream &Out, uint64_t Pos, StringRef Name, const sys::TimePoint< std::chrono::seconds > &ModTime, unsigned UID, unsigned GID, unsigned Perms, unsigned Size)
 
static bool useStringTable (bool Thin, StringRef Name)
 
static std::string computeRelativePath (StringRef From, StringRef To)
 
static bool is64BitKind (object::Archive::Kind Kind)
 
static void addToStringTable (raw_ostream &Out, StringRef ArcName, const NewArchiveMember &M, bool Thin)
 
static void printMemberHeader (raw_ostream &Out, uint64_t Pos, raw_ostream &StringTable, StringMap< uint64_t > &MemberNames, object::Archive::Kind Kind, bool Thin, StringRef ArcName, const NewArchiveMember &M, sys::TimePoint< std::chrono::seconds > ModTime, unsigned Size)
 
static MemberData computeStringTable (StringRef Names)
 
static sys::TimePoint< std::chrono::seconds > now (bool Deterministic)
 
static bool isArchiveSymbol (const object::BasicSymbolRef &S)
 
static void printNBits (raw_ostream &Out, object::Archive::Kind Kind, uint64_t Val)
 
static void writeSymbolTable (raw_ostream &Out, object::Archive::Kind Kind, bool Deterministic, ArrayRef< MemberData > Members, StringRef StringTable)
 
static Expected< std::vector< unsigned > > getSymbols (MemoryBufferRef Buf, raw_ostream &SymNames, bool &HasObject)
 
static Expected< std::vector< MemberData > > computeMemberData (raw_ostream &StringTable, raw_ostream &SymNames, object::Archive::Kind Kind, bool Thin, StringRef ArcName, bool Deterministic, ArrayRef< NewArchiveMember > NewMembers)
 

Function Documentation

◆ addToStringTable()

static void addToStringTable ( raw_ostream Out,
StringRef  ArcName,
const NewArchiveMember M,
bool  Thin 
)
static

◆ computeMemberData()

static Expected<std::vector<MemberData> > computeMemberData ( raw_ostream StringTable,
raw_ostream SymNames,
object::Archive::Kind  Kind,
bool  Thin,
StringRef  ArcName,
bool  Deterministic,
ArrayRef< NewArchiveMember NewMembers 
)
static

◆ computeRelativePath()

static std::string computeRelativePath ( StringRef  From,
StringRef  To 
)
static

◆ computeStringTable()

static MemberData computeStringTable ( StringRef  Names)
static

◆ getSymbols()

static Expected<std::vector<unsigned> > getSymbols ( MemoryBufferRef  Buf,
raw_ostream SymNames,
bool HasObject 
)
static

◆ is64BitKind()

static bool is64BitKind ( object::Archive::Kind  Kind)
static

◆ isArchiveSymbol()

static bool isArchiveSymbol ( const object::BasicSymbolRef S)
static

◆ isBSDLike()

static bool isBSDLike ( object::Archive::Kind  Kind)
static

◆ isDarwin()

static bool isDarwin ( object::Archive::Kind  Kind)
static

◆ now()

static sys::TimePoint<std::chrono::seconds> now ( bool  Deterministic)
static

◆ print()

template<class T >
static void print ( raw_ostream Out,
object::Archive::Kind  Kind,
T  Val 
)
static

Definition at line 145 of file ArchiveWriter.cpp.

References llvm::support::big, isBSDLike(), llvm::support::little, and llvm::support::endian::write().

Referenced by llvm::DIE::addChild(), llvm::DIEAbbrev::AddImplicitConstAttribute(), llvm::VPWidenRecipe::appendInstruction(), areCandidatesToMergeOrPair(), llvm::DIELoc::BestForm(), llvm::DIEBlock::BestForm(), llvm::GCOVFunction::blocks(), llvm::VPlanSlp::buildGraph(), llvm::RegBankSelect::EdgeInsertPoint::canMaterialize(), llvm::MemoryUse::classof(), llvm::MemoryPhi::classof(), llvm::VPWidenIntOrFpInductionRecipe::classof(), llvm::VPWidenPHIRecipe::classof(), llvm::VPBlendRecipe::classof(), llvm::VPInterleaveRecipe::classof(), llvm::VPPredInstPHIRecipe::classof(), llvm::VPWidenMemoryInstructionRecipe::classof(), llvm::APInt::countPopulation(), createBBSelectReg(), llvm::createControlHeightReductionLegacyPass(), llvm::createCostModelAnalysisPass(), llvm::createMemDepPrinter(), llvm::createMemDerefPrinter(), DeleteTriviallyDeadInstructions(), llvm::MemoryDepChecker::Dependence::Dependence(), llvm::DependenceAnalysisWrapperPass::DependenceAnalysisWrapperPass(), despeculateCountZeros(), llvm::DIEDelta::DIEDelta(), DoInitialMatch(), llvm::GCOVBlock::dsts(), llvm::Comdat::dump(), llvm::cfg::Update< NodePtr >::dump(), llvm::RegisterBankInfo::PartialMapping::dump(), llvm::Metadata::dump(), llvm::DominanceFrontierBase< BasicBlock, false >::dump(), llvm::DebugCounter::dump(), llvm::sampleprof::LineLocation::dump(), llvm::DIEAbbrev::dump(), llvm::Type::dump(), llvm::RegisterBankInfo::ValueMapping::dump(), llvm::sampleprof::SampleRecord::dump(), llvm::Value::dump(), llvm::sampleprof::FunctionSamples::dump(), llvm::RegisterBankInfo::InstructionMapping::dump(), llvm::ScaledNumberBase::dump(), llvm::RegionBase< RegionTraits< Function > >::dump(), llvm::DIEValue::dump(), llvm::DIE::dump(), llvm::Module::dump(), llvm::RegionInfoBase< RegionTraits< Function > >::dump(), llvm::LiveRangeUpdater::dump(), llvm::ModuleSummaryIndex::dump(), llvm::NamedMDNode::dump(), dumpIR(), dumpLocation(), llvm::AppleAccelTableStaticTypeData::emit(), EmitHiLo(), llvm::ARMConstantPoolValue::equals(), llvm::LazyBlockFrequencyInfoPass::getBFI(), llvm::MemoryAccess::getBlock(), llvm::GCOVFile::getChecksum(), llvm::sroa::AllocaSlices::getDeadOperands(), llvm::LiveRangeUpdater::getDest(), llvm::DIEEntry::getEntry(), llvm::SubtargetFeatures::getFeatures(), llvm::SMDiagnostic::getFixIts(), llvm::StackMaps::getFnInfos(), llvm::IVUsersWrapperPass::getIU(), llvm::ARMConstantPoolMBB::getMBB(), llvm::MemorySSA::getMemoryAccess(), llvm::MemorySSAWrapperPass::getMSSA(), llvm::RuntimePointerChecking::getNumberOfChecks(), llvm::MachineFunction::getNumBlockIDs(), llvm::VPInstruction::getOpcode(), llvm::VPRecipeBase::getParent(), getPHIDestReg(), llvm::ARMConstantPoolConstant::getPromotedGlobalInit(), llvm::MachineRegionInfoPass::getRegionInfo(), llvm::RegionInfoPass::getRegionInfo(), getSchedRegions(), llvm::DIEString::getString(), llvm::DIEInlineString::getString(), llvm::ARMConstantPoolSymbol::getSymbol(), llvm::ModuleSummaryIndex::getTypeIdSummary(), llvm::DIEExpr::getValue(), llvm::DIELabel::getValue(), llvm::DIELocList::getValue(), llvm::Function::hasPrologueData(), llvm::LoopAccessInfo::hasStride(), INITIALIZE_PASS(), isAlwaysFoldable(), llvm::rdf::RegisterAggr::isCoverOf(), isFunctionEntryBlock(), llvm::IVUsers::isIVUserOrOperand(), isKnownBaseResult(), isMergeableLdStUpdate(), llvm::MachineDominatorTree::isReachableFromEntry(), isTerminalReg(), llvm::LegalityQuery::LegalityQuery(), llvm::sampleprof::LineLocation::LineLocation(), llvm::opt::ArgList::MakeArgString(), mayUsePostIncMode(), llvm::sampleprof::SampleRecord::merge(), llvm::MIPrinter::MIPrinter(), llvm::MIRPrinter::MIRPrinter(), llvm::SlotIndex::operator bool(), llvm::ConstantRange::operator!=(), llvm::LiveInterval::operator<(), operator<<(), llvm::itanium_demangle::parse_discriminator(), llvm::MIPrinter::print(), llvm::Value::print(), llvm::AppleAccelTableData::Atom::print(), llvm::LoopInfoBase< BasicBlock, Loop >::print(), llvm::LiveInterval::print(), printExtendedName(), printFile(), PrintLLVMName(), printMCExpr(), llvm::DominatorTreeWrapperPass::releaseMemory(), llvm::LoopAccessLegacyAnalysis::releaseMemory(), llvm::MachineJumpTableInfo::RemoveJumpTable(), llvm::MemoryDef::resetOptimized(), llvm::IVUsersPrinterPass::run(), llvm::CFGViewerPass::run(), llvm::PostDominatorTreePrinterPass::run(), llvm::DemandedBitsPrinterPass::run(), llvm::DominanceFrontierPrinterPass::run(), llvm::DominatorTreePrinterPass::run(), llvm::RegionInfoPrinterPass::run(), llvm::LegacyDivergenceAnalysis::runOnFunction(), llvm::VPReplicateRecipe::setAlsoPack(), llvm::GISelCSEInfo::setCSEConfig(), llvm::LTOCodeGenerator::setDiagnosticHandler(), llvm::MachineMemOperand::setOffset(), llvm::FileInfo::setProgramCount(), llvm::MachineFrameInfo::setRestorePoint(), llvm::DIEInteger::setValue(), AllocaSlices::SliceBuilder::SliceBuilder(), llvm::LiveInterval::SubRange::SubRange(), llvm::APFloat::toString(), llvm::MachineTraceMetrics::Trace::Trace(), llvm::SDNode::value_end(), llvm::MachineFunctionProperties::verifyRequiredProperties(), writeCFGToDotFile(), llvm::DebugCounter::~DebugCounter(), and llvm::MachineSchedContext::~MachineSchedContext().

◆ printBSDMemberHeader()

static void printBSDMemberHeader ( raw_ostream Out,
uint64_t  Pos,
StringRef  Name,
const sys::TimePoint< std::chrono::seconds > &  ModTime,
unsigned  UID,
unsigned  GID,
unsigned  Perms,
unsigned  Size 
)
static

◆ printGNUSmallMemberHeader()

static void printGNUSmallMemberHeader ( raw_ostream Out,
StringRef  Name,
const sys::TimePoint< std::chrono::seconds > &  ModTime,
unsigned  UID,
unsigned  GID,
unsigned  Perms,
unsigned  Size 
)
static

Definition at line 166 of file ArchiveWriter.cpp.

References printRestOfMemberHeader(), and printWithSpacePadding().

Referenced by printMemberHeader(), and writeSymbolTable().

◆ printMemberHeader()

static void printMemberHeader ( raw_ostream Out,
uint64_t  Pos,
raw_ostream StringTable,
StringMap< uint64_t > &  MemberNames,
object::Archive::Kind  Kind,
bool  Thin,
StringRef  ArcName,
const NewArchiveMember M,
sys::TimePoint< std::chrono::seconds >  ModTime,
unsigned  Size 
)
static

◆ printNBits()

static void printNBits ( raw_ostream Out,
object::Archive::Kind  Kind,
uint64_t  Val 
)
static

Definition at line 322 of file ArchiveWriter.cpp.

References is64BitKind(), and Kind.

Referenced by writeSymbolTable().

◆ printRestOfMemberHeader()

static void printRestOfMemberHeader ( raw_ostream Out,
const sys::TimePoint< std::chrono::seconds > &  ModTime,
unsigned  UID,
unsigned  GID,
unsigned  Perms,
unsigned  Size 
)
static

◆ printWithSpacePadding()

template<typename T >
static void printWithSpacePadding ( raw_ostream OS,
T  Data,
unsigned  Size 
)
static

◆ useStringTable()

static bool useStringTable ( bool  Thin,
StringRef  Name 
)
static

Definition at line 191 of file ArchiveWriter.cpp.

References llvm::StringRef::contains(), and llvm::StringRef::size().

Referenced by printMemberHeader().

◆ writeSymbolTable()

static void writeSymbolTable ( raw_ostream Out,
object::Archive::Kind  Kind,
bool  Deterministic,
ArrayRef< MemberData >  Members,
StringRef  StringTable 
)
static