LLVM API Documentation

LinkArchives.cpp File Reference

#include "llvm/Linker.h"
#include "llvm/Module.h"
#include "llvm/ModuleProvider.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/Bytecode/Reader.h"
#include "llvm/Bytecode/Archive.h"
#include "llvm/Config/config.h"
#include <memory>
#include <set>

Include dependency graph for LinkArchives.cpp:

Go to the source code of this file.

Functions

static void GetAllDefinedSymbols (Module *M, std::set< std::string > &DefinedSymbols)
static void GetAllUndefinedSymbols (Module *M, std::set< std::string > &UndefinedSymbols)


Function Documentation

static void GetAllDefinedSymbols ( Module M,
std::set< std::string > &  DefinedSymbols 
) [static]

GetAllDefinedSymbols - Modifies its parameter DefinedSymbols to contain the name of each externally-visible symbol defined in M.

Definition at line 30 of file LinkArchives.cpp.

References llvm::Module::begin(), E, llvm::Module::end(), llvm::Module::global_begin(), llvm::Module::global_end(), I, and M.

static void GetAllUndefinedSymbols ( Module M,
std::set< std::string > &  UndefinedSymbols 
) [static]

GetAllUndefinedSymbols - calculates the set of undefined symbols that still exist in an LLVM module. This is a bit tricky because there may be two symbols with the same name but different LLVM types that will be resolved to each other but aren't currently (thus we need to treat it as resolved).

Inputs: M - The module in which to find undefined symbols.

Outputs: UndefinedSymbols - A set of C++ strings containing the name of all undefined symbols.

Definition at line 53 of file LinkArchives.cpp.

References llvm::Module::begin(), E, llvm::Module::end(), llvm::Module::getMainFunction(), llvm::Module::global_begin(), llvm::Module::global_end(), I, llvm::Function::isExternal(), and M.

Referenced by llvm::Linker::LinkInArchive().