ArchiveInternals.h [plain text]
#ifndef LIB_ARCHIVE_ARCHIVEINTERNALS_H
#define LIB_ARCHIVE_ARCHIVEINTERNALS_H
#include "llvm/Bitcode/Archive.h"
#include "llvm/Support/TimeValue.h"
#include "llvm/ADT/StringExtras.h"
#include <cstring>
#define ARFILE_MAGIC "!<arch>\n" ///< magic string
#define ARFILE_MAGIC_LEN (sizeof(ARFILE_MAGIC)-1) ///< length of magic string
#define ARFILE_SVR4_SYMTAB_NAME "/ " ///< SVR4 symtab entry name
#define ARFILE_LLVM_SYMTAB_NAME "#_LLVM_SYM_TAB_#" ///< LLVM symtab entry name
#define ARFILE_BSD4_SYMTAB_NAME "__.SYMDEF SORTED" ///< BSD4 symtab entry name
#define ARFILE_STRTAB_NAME "// " ///< Name of string table
#define ARFILE_PAD "\n" ///< inter-file align padding
#define ARFILE_MEMBER_MAGIC "`\n" ///< fmag field magic #
namespace llvm {
class LLVMContext;
class ArchiveMemberHeader {
public:
char name[16]; char date[12]; char uid[6]; char gid[6]; char mode[8]; char size[10]; char fmag[2];
public:
void init() {
memset(name,' ',16);
memset(date,' ',12);
memset(uid,' ',6);
memset(gid,' ',6);
memset(mode,' ',8);
memset(size,' ',10);
fmag[0] = '`';
fmag[1] = '\n';
}
bool checkSignature() {
return 0 == memcmp(fmag, ARFILE_MEMBER_MAGIC,2);
}
};
bool GetBitcodeSymbols(const sys::Path& fName,
LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg);
Module* GetBitcodeSymbols(const char *Buffer, unsigned Length,
const std::string& ModuleID,
LLVMContext& Context,
std::vector<std::string>& symbols,
std::string* ErrMsg);
}
#endif