LLVM 20.0.0git
|
#include "llvm/Transforms/Utils/ModuleUtils.h"
#include "llvm/Analysis/VectorUtils.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/MDBuilder.h"
#include "llvm/IR/Module.h"
#include "llvm/Support/MD5.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/xxhash.h"
Go to the source code of this file.
Macros | |
#define | DEBUG_TYPE "moduleutils" |
Functions | |
static void | appendToGlobalArray (StringRef ArrayName, Module &M, Function *F, int Priority, Constant *Data) |
static void | transformGlobalArray (StringRef ArrayName, Module &M, const GlobalCtorTransformFn &Fn) |
static void | collectUsedGlobals (GlobalVariable *GV, SmallSetVector< Constant *, 16 > &Init) |
static void | appendToUsedList (Module &M, StringRef Name, ArrayRef< GlobalValue * > Values) |
static void | removeFromUsedList (Module &M, StringRef Name, function_ref< bool(Constant *)> ShouldRemove) |
#define DEBUG_TYPE "moduleutils" |
Definition at line 27 of file ModuleUtils.cpp.
|
static |
Definition at line 29 of file ModuleUtils.cpp.
References llvm::GlobalValue::AppendingLinkage, F, llvm::ConstantArray::get(), llvm::StructType::get(), llvm::ConstantStruct::get(), llvm::IRBuilderBase::getInt32(), llvm::IRBuilderBase::getInt32Ty(), llvm::Constant::getNullValue(), llvm::StructType::getNumElements(), llvm::ConstantExpr::getPointerCast(), llvm::IRBuilderBase::getPtrTy(), llvm::Value::getType(), llvm::IRBuilderBase::getVoidTy(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::appendToGlobalCtors(), and llvm::appendToGlobalDtors().
|
static |
Definition at line 136 of file ModuleUtils.cpp.
References llvm::GlobalValue::AppendingLinkage, collectUsedGlobals(), llvm::GlobalVariable::eraseFromParent(), llvm::ConstantArray::get(), llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(), llvm::PointerType::getUnqual(), Name, and llvm::GlobalObject::setSection().
Referenced by llvm::appendToCompilerUsed(), and llvm::appendToUsed().
|
static |
Definition at line 126 of file ModuleUtils.cpp.
References llvm::GlobalVariable::getInitializer(), and llvm::GlobalVariable::hasInitializer().
Referenced by appendToUsedList(), and removeFromUsedList().
|
static |
Definition at line 166 of file ModuleUtils.cpp.
References llvm::GlobalValue::AppendingLinkage, collectUsedGlobals(), llvm::SmallVectorBase< Size_T >::empty(), llvm::GlobalVariable::eraseFromParent(), llvm::ConstantArray::get(), llvm::GlobalValue::getAddressSpace(), llvm::GlobalObject::getSection(), llvm::GlobalValue::getThreadLocalMode(), llvm::GlobalValue::getValueType(), Name, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::GlobalObject::setSection(), llvm::SmallVectorBase< Size_T >::size(), and llvm::Value::takeName().
Referenced by llvm::removeFromUsedLists().
|
static |
Definition at line 82 of file ModuleUtils.cpp.
References llvm::GlobalValue::AppendingLinkage, llvm::CallingConv::C, llvm::GlobalVariable::eraseFromParent(), llvm::ConstantArray::get(), llvm::Type::getArrayElementType(), llvm::GlobalVariable::getInitializer(), llvm::Value::getType(), llvm::GlobalValue::getValueType(), OP, llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorImpl< T >::reserve(), and llvm::SmallVectorBase< Size_T >::size().
Referenced by llvm::transformGlobalCtors(), and llvm::transformGlobalDtors().