LLVM  6.0.0svn
Functions | Variables
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 <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 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, object::Archive::Kind Kind, bool Thin, StringRef ArcName, const NewArchiveMember &M, 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, ArrayRef< NewArchiveMember > NewMembers)
 

Variables

static cl::opt< int > Sym64Threshold ("sym64-threshold", cl::Hidden, cl::init(32))
 

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,
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

◆ 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 147 of file ArchiveWriter.cpp.

References isBSDLike(), and write().

Referenced by llvm::DIE::addChild(), llvm::DIEAbbrev::AddImplicitConstAttribute(), llvm::VPWidenRecipe::appendInstruction(), areCandidatesToMergeOrPair(), llvm::DIELoc::BestForm(), llvm::DIEBlock::BestForm(), llvm::GCOVFunction::blocks(), 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(), CollectSubexprs(), llvm::APInt::countPopulation(), createBBSelectReg(), 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::RegisterBankInfo::PartialMapping::dump(), llvm::sampleprof::LineLocation::dump(), llvm::Metadata::dump(), llvm::DominanceFrontierBase< BasicBlock, false >::dump(), llvm::DIEAbbrev::dump(), llvm::DebugCounter::dump(), llvm::Type::dump(), llvm::RegisterBankInfo::ValueMapping::dump(), llvm::sampleprof::SampleRecord::dump(), llvm::sampleprof::FunctionSamples::dump(), llvm::Value::dump(), llvm::RegisterBankInfo::InstructionMapping::dump(), llvm::ScaledNumberBase::dump(), llvm::RegionBase< RegionTraits< Function > >::dump(), llvm::SUnit::dump(), llvm::DIEValue::dump(), llvm::DIE::dump(), llvm::Module::dump(), llvm::RegionInfoBase< RegionTraits< Function > >::dump(), llvm::LiveRangeUpdater::dump(), llvm::NamedMDNode::dump(), dumpLocation(), EmitHiLo(), llvm::ARMConstantPoolValue::equals(), llvm::LazyBlockFrequencyInfoPass::getBFI(), llvm::MemoryAccess::getBlock(), llvm::GCOVFile::getChecksum(), llvm::legacy::PassManagerImpl::getContainedManager(), llvm::sroa::AllocaSlices::getDeadOperands(), llvm::LiveRangeUpdater::getDest(), llvm::DIEEntry::getEntry(), llvm::SubtargetFeatures::getFeatures(), llvm::SMDiagnostic::getFixIts(), llvm::IVUsersWrapperPass::getIU(), llvm::ARMConstantPoolMBB::getMBB(), llvm::MemorySSAWrapperPass::getMSSA(), llvm::RuntimePointerChecking::getNumberOfChecks(), llvm::MachineFunction::getNumBlockIDs(), llvm::VPInstruction::getOpcode(), llvm::VPRecipeBase::getParent(), getPHIDestReg(), getPointerOperand(), llvm::ARMConstantPoolConstant::getPromotedGlobalInit(), llvm::MachineRegionInfoPass::getRegionInfo(), llvm::RegionInfoPass::getRegionInfo(), getSchedRegions(), llvm::DIEString::getString(), llvm::DIEInlineString::getString(), llvm::ARMConstantPoolSymbol::getSymbol(), 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::LiveRange::isUndefIn(), llvm::sampleprof::LineLocation::LineLocation(), llvm::opt::ArgList::MakeArgString(), llvm::sampleprof::SampleRecord::merge(), llvm::MIPrinter::MIPrinter(), llvm::MIRPrinter::MIRPrinter(), multipleIterations(), llvm::SlotIndex::operator bool(), llvm::ConstantRange::operator!=(), llvm::LiveInterval::operator<(), operator<<(), llvm::MIPrinter::print(), llvm::Value::print(), llvm::SUnit::print(), llvm::VPInstruction::print(), llvm::LoopInfoBase< BasicBlock, Loop >::print(), llvm::LiveInterval::print(), printExtendedName(), printFile(), PrintLLVMName(), llvm::DominatorTreeWrapperPass::releaseMemory(), llvm::LoopAccessLegacyAnalysis::releaseMemory(), llvm::MachineJumpTableInfo::RemoveJumpTable(), llvm::StackMaps::reset(), llvm::MemoryDef::resetOptimized(), llvm::IVUsersPrinterPass::run(), llvm::CFGViewerPass::run(), llvm::PostDominatorTreePrinterPass::run(), llvm::DominanceFrontierPrinterPass::run(), llvm::DominatorTreePrinterPass::run(), llvm::RegionInfoPrinterPass::run(), llvm::VPReplicateRecipe::setAlsoPack(), llvm::LTOCodeGenerator::setDiagnosticHandler(), llvm::MachineMemOperand::setOffset(), llvm::FileInfo::setProgramCount(), llvm::MachineFrameInfo::setRestorePoint(), llvm::DIEInteger::setValue(), AllocaSlices::SliceBuilder::SliceBuilder(), stripRegisterPrefix(), llvm::LiveInterval::SubRange::SubRange(), llvm::APFloat::toString(), llvm::MachineTraceMetrics::Trace::Trace(), llvm::SDNode::value_end(), llvm::DominatorTree::verifyDomTree(), llvm::MachineFunctionProperties::verifyRequiredProperties(), writeCFGToDotFile(), 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 170 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,
object::Archive::Kind  Kind,
bool  Thin,
StringRef  ArcName,
const NewArchiveMember M,
unsigned  Size 
)
static

◆ printNBits()

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

Definition at line 314 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 195 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

Variable Documentation

◆ Sym64Threshold

cl::opt<int> Sym64Threshold("sym64-threshold", cl::Hidden, cl::init(32))
static

Referenced by llvm::writeArchive().