LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
LinkModules.cpp File Reference
#include "llvm/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/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Transforms/Utils/Cloning.h"
#include <cctype>
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 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 491 of file LinkModules.cpp.

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

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 471 of file LinkModules.cpp.

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

Referenced by copyGVAttributes().

static void getArrayElements ( Constant C,
SmallVectorImpl< Constant * > &  Dest 
)
static
static bool isLessConstraining ( GlobalValue::VisibilityTypes  a,
GlobalValue::VisibilityTypes  b 
)
static
LLVMBool LLVMLinkModules ( LLVMModuleRef  Dest,
LLVMModuleRef  Src,
LLVMLinkerMode  Mode,
char **  OutMessages 
)