X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FArchive%2FArchiveInternals.h;h=55684f7023d277a12d87885fbfa6ad607963ad32;hb=6c3541d5597033bdb2f26f5ade811b482c32a39a;hp=c924c437b4b29ec9e947fa93d9a421608929b438;hpb=9a29db43a7a906162b0fde012b5d16f3b0895023;p=oota-llvm.git diff --git a/lib/Archive/ArchiveInternals.h b/lib/Archive/ArchiveInternals.h index c924c437b4b..55684f7023d 100644 --- a/lib/Archive/ArchiveInternals.h +++ b/lib/Archive/ArchiveInternals.h @@ -1,25 +1,27 @@ -//===-- lib/Bytecode/ArchiveInternals.h -------------------------*- C++ -*-===// -// +//===-- lib/Archive/ArchiveInternals.h -------------------------*- C++ -*-===// +// // The LLVM Compiler Infrastructure // -// This file was developed by Reid Spencer and is distributed under the -// University of Illinois Open Source License. See LICENSE.TXT for details. -// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// //===----------------------------------------------------------------------===// // // Internal implementation header for LLVM Archive files. // //===----------------------------------------------------------------------===// -#ifndef LIB_BYTECODE_ARCHIVEINTERNALS_H -#define LIB_BYTECODE_ARCHIVEINTERNALS_H +#ifndef LIB_ARCHIVE_ARCHIVEINTERNALS_H +#define LIB_ARCHIVE_ARCHIVEINTERNALS_H -#include "llvm/Bytecode/Archive.h" -#include "llvm/System/TimeValue.h" +#include "llvm/Bitcode/Archive.h" +#include "llvm/Support/TimeValue.h" #include "llvm/ADT/StringExtras.h" -#define ARFILE_MAGIC "!\n" ///< magic string -#define ARFILE_MAGIC_LEN (sizeof(ARFILE_MAGIC)-1) ///< length of magic string +#include + +#define ARFILE_MAGIC "!\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 @@ -29,9 +31,11 @@ namespace llvm { - /// The ArchiveMemberHeader structure is used internally for bytecode - /// archives. - /// The header precedes each file member in the archive. This structure is + class LLVMContext; + + /// The ArchiveMemberHeader structure is used internally for bitcode + /// archives. + /// The header precedes each file member in the archive. This structure is /// defined using character arrays for direct and correct interpretation /// regardless of the endianess of the machine that produced it. /// @brief Archive File Member Header @@ -39,7 +43,7 @@ namespace llvm { /// @name Data /// @{ public: - char name[16];///< Name of the file member. + char name[16]; ///< Name of the file member. char date[12]; ///< File date, decimal seconds since Epoch char uid[6]; ///< user id in ASCII decimal char gid[6]; ///< group id in ASCII decimal @@ -65,9 +69,19 @@ namespace llvm { bool checkSignature() { return 0 == memcmp(fmag, ARFILE_MEMBER_MAGIC,2); } - }; - + + // Get just the externally visible defined symbols from the bitcode + bool GetBitcodeSymbols(const sys::Path& fName, + LLVMContext& Context, + std::vector& symbols, + std::string* ErrMsg); + + Module* GetBitcodeSymbols(const char *Buffer, unsigned Length, + const std::string& ModuleID, + LLVMContext& Context, + std::vector& symbols, + std::string* ErrMsg); } #endif