LLVM API Documentation

Functions
LinkModules.cpp File Reference
#include "llvm/Linker/Linker.h"
#include "llvm-c/Linker.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/TypeFinder.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include <cctype>
#include <tuple>
Include dependency graph for LinkModules.cpp:

Go to the source code of this file.

Functions

static void forceRenaming (GlobalValue *GV, StringRef Name)
static void copyGVAttributes (GlobalValue *DestGV, const GlobalValue *SrcGV)
static bool isLessConstraining (GlobalValue::VisibilityTypes a, GlobalValue::VisibilityTypes b)
static bool isDeclaration (const GlobalValue &V)
static void upgradeGlobalArray (GlobalVariable *GV)
static void getArrayElements (Constant *C, SmallVectorImpl< Constant * > &Dest)
LLVMBool LLVMLinkModules (LLVMModuleRef Dest, LLVMModuleRef Src, LLVMLinkerMode Mode, char **OutMessages)

Function Documentation

static void copyGVAttributes ( GlobalValue DestGV,
const GlobalValue SrcGV 
) [static]

copyGVAttributes - copy additional attributes (those not needed to construct a GlobalValue) from the SrcGV to the DestGV.

Definition at line 514 of file LinkModules.cpp.

References llvm::GlobalValue::copyAttributesFrom(), llvm::dyn_cast(), forceRenaming(), llvm::GlobalValue::getAlignment(), and llvm::Value::getName().

static void forceRenaming ( GlobalValue GV,
StringRef  Name 
) [static]

forceRenaming - The LLVM SymbolTable class autorenames globals that conflict in the symbol table. This is good for all clients except for us. Go through the trouble to force this back.

Definition at line 494 of file LinkModules.cpp.

References llvm::Value::getName(), llvm::Module::getNamedValue(), llvm::GlobalValue::getParent(), llvm::GlobalValue::hasLocalLinkage(), Name, llvm::Value::setName(), and llvm::Value::takeName().

Referenced by copyGVAttributes().

static void getArrayElements ( Constant C,
SmallVectorImpl< Constant * > &  Dest 
) [static]
static bool isDeclaration ( const GlobalValue V) [static]
LLVMBool LLVMLinkModules ( LLVMModuleRef  Dest,
LLVMModuleRef  Src,
LLVMLinkerMode  Mode,
char **  OutMessages 
)
static void upgradeGlobalArray ( GlobalVariable GV) [static]