LLVM API Documentation
#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>
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) |
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] |
Definition at line 1252 of file LinkModules.cpp.
References llvm::Constant::getAggregateElement(), llvm::Value::getType(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
static bool isDeclaration | ( | const GlobalValue & | V | ) | [static] |
Definition at line 676 of file LinkModules.cpp.
References llvm::GlobalValue::hasAvailableExternallyLinkage(), llvm::GlobalValue::isDeclaration(), and llvm::GlobalValue::isMaterializable().
Referenced by llvm::TargetMachine::getTLSModel(), and LLVMIsDeclaration().
static bool isLessConstraining | ( | GlobalValue::VisibilityTypes | a, |
GlobalValue::VisibilityTypes | b | ||
) | [static] |
Definition at line 529 of file LinkModules.cpp.
References llvm::GlobalValue::HiddenVisibility, and llvm::GlobalValue::ProtectedVisibility.
LLVMBool LLVMLinkModules | ( | LLVMModuleRef | Dest, |
LLVMModuleRef | Src, | ||
LLVMLinkerMode | Mode, | ||
char ** | OutMessages | ||
) |
Definition at line 1762 of file LinkModules.cpp.
References llvm::Linker::LinkModules(), llvm::LibFunc::strdup, and llvm::unwrap().
static void upgradeGlobalArray | ( | GlobalVariable * | GV | ) | [static] |
Definition at line 853 of file LinkModules.cpp.
References llvm::GlobalVariable::copyAttributesFrom(), llvm::dyn_cast(), llvm::StructType::get(), llvm::ArrayType::get(), llvm::ConstantArray::get(), llvm::ConstantStruct::get(), llvm::Value::getContext(), llvm::SequentialType::getElementType(), llvm::GlobalVariable::getInitializer(), llvm::Type::getInt8Ty(), llvm::GlobalValue::getLinkage(), llvm::Constant::getNullValue(), llvm::ArrayType::getNumElements(), llvm::User::getNumOperands(), llvm::User::getOperand(), llvm::GlobalValue::getParent(), llvm::GlobalValue::getThreadLocalMode(), llvm::GlobalValue::getType(), llvm::GlobalVariable::isConstant(), llvm::User::operands(), and llvm::Value::takeName().