LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

LinkArchives.cpp File Reference

#include "llvm/Linker.h"
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
#include "llvm/PassManager.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Bytecode/Archive.h"
#include "llvm/Bytecode/WriteBytecodePass.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include "llvm/Config/config.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/Timer.h"
#include "llvm/System/Signals.h"
#include "llvm/Support/SystemUtils.h"
#include <algorithm>
#include <fstream>
#include <memory>
#include <set>

Include dependency graph for LinkArchives.cpp:

Go to the source code of this file.

Functions

std::string llvm::FindLib (const std::string &Filename, const std::vector< std::string > &Paths, bool SharedObjectOnly)
void llvm::GetAllDefinedSymbols (Module *M, std::set< std::string > &DefinedSymbols)
void llvm::GetAllUndefinedSymbols (Module *M, std::set< std::string > &UndefinedSymbols)
static std::auto_ptr< ModuleLoadObject (const std::string &FN, std::string &ErrorMessage)
bool llvm::LinkInArchive (Module *M, const std::string &Filename, std::string *ErrorMessage, bool Verbose)
 Link in one archive.
static bool LinkInFile (Module *HeadModule, const std::string &Filename, std::string &ErrorMessage, bool Verbose)
bool llvm::LinkFiles (const char *progname, Module *HeadModule, const std::vector< std::string > &Files, bool Verbose)
static void LinkOneLibrary (const char *progname, Module *HeadModule, const std::string &Lib, const std::vector< std::string > &LibPaths, bool Verbose, bool Native)
 LinkOneLibrary - links one library of any kind into the HeadModule.
void llvm::LinkLibraries (const char *progname, Module *HeadModule, const std::vector< std::string > &Libraries, const std::vector< std::string > &LibPaths, bool Verbose, bool Native)
 Link libraries into a module.


Function Documentation

static bool LinkInFile Module HeadModule,
const std::string &  Filename,
std::string &  ErrorMessage,
bool  Verbose
[static]
 

LinkInFile - opens a bytecode file and links in all objects which provide symbols that are currently undefined.

Inputs: HeadModule - The module in which to link the bytecode file. Filename - The pathname of the bytecode file. Verbose - Flags whether verbose messages should be printed.

Outputs: ErrorMessage - A C++ string detailing what error occurred, if any.

Return Value: TRUE - An error occurred. FALSE - No errors.

Definition at line 262 of file LinkArchives.cpp.

References llvm::LinkModules(), LoadObject(), and M.

Referenced by llvm::LinkFiles().

static void LinkOneLibrary const char *  progname,
Module HeadModule,
const std::string &  Lib,
const std::vector< std::string > &  LibPaths,
bool  Verbose,
bool  Native
[inline, static]
 

LinkOneLibrary - links one library of any kind into the HeadModule.

Definition at line 356 of file LinkArchives.cpp.

References llvm::FindLib(), llvm::IsArchive(), and llvm::LinkInArchive().

Referenced by llvm::LinkItems(), and llvm::LinkLibraries().

static std::auto_ptr<Module> LoadObject const std::string &  FN,
std::string &  ErrorMessage
[static]
 

LoadObject - Read in and parse the bytecode file named by FN and return the module it contains (wrapped in an auto_ptr), or 0 and set ErrorMessage if an error occurs.

Definition at line 142 of file LinkArchives.cpp.

References llvm::ParseBytecodeFile().

Referenced by LinkInFile().