aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ModuleUtils.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2021-07-22 06:30:39 -0700
committerKazu Hirata <kazu@google.com>2021-07-22 06:30:39 -0700
commitf6413d8aaa0205b58345bdd985d2c5c4544bd260 (patch)
tree1f99a8e1e31aeb0cf525fa2ae26e267100c376e8 /llvm/lib/Transforms/Utils/ModuleUtils.cpp
parenta158d3663fc5b3596eaac7da857e7422d12b243e (diff)
downloadllvm-f6413d8aaa0205b58345bdd985d2c5c4544bd260.zip
llvm-f6413d8aaa0205b58345bdd985d2c5c4544bd260.tar.gz
llvm-f6413d8aaa0205b58345bdd985d2c5c4544bd260.tar.bz2
[Transforms] Remove getOrCreateInitFunction (NFC)
The last use was removed on Jan 16, 2019 in commit 81101de5853b4ed64640220a086a67b16f36f153.
Diffstat (limited to 'llvm/lib/Transforms/Utils/ModuleUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ModuleUtils.cpp22
1 files changed, 0 insertions, 22 deletions
diff --git a/llvm/lib/Transforms/Utils/ModuleUtils.cpp b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
index 7c03162..2aef3720 100644
--- a/llvm/lib/Transforms/Utils/ModuleUtils.cpp
+++ b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
@@ -177,28 +177,6 @@ llvm::getOrCreateSanitizerCtorAndInitFunctions(
return std::make_pair(Ctor, InitFunction);
}
-Function *llvm::getOrCreateInitFunction(Module &M, StringRef Name) {
- assert(!Name.empty() && "Expected init function name");
- if (Function *F = M.getFunction(Name)) {
- if (F->arg_size() != 0 ||
- F->getReturnType() != Type::getVoidTy(M.getContext())) {
- std::string Err;
- raw_string_ostream Stream(Err);
- Stream << "Sanitizer interface function defined with wrong type: " << *F;
- report_fatal_error(Err);
- }
- return F;
- }
- Function *F =
- cast<Function>(M.getOrInsertFunction(Name, AttributeList(),
- Type::getVoidTy(M.getContext()))
- .getCallee());
-
- appendToGlobalCtors(M, F, 0);
-
- return F;
-}
-
void llvm::filterDeadComdatFunctions(
Module &M, SmallVectorImpl<Function *> &DeadComdatFunctions) {
// Build a map from the comdat to the number of entries in that comdat we