LLVM  6.0.0svn
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 <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)
 
static void print32 (raw_ostream &Out, object::Archive::Kind Kind, uint32_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 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 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)
 

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

◆ 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

◆ print32()

static void print32 ( raw_ostream Out,
object::Archive::Kind  Kind,
uint32_t  Val 
)
static

Definition at line 137 of file ArchiveWriter.cpp.

References isBSDLike(), and write().

Referenced by writeSymbolTable().

◆ 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 161 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

◆ 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 186 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