[llvm] r368367 - Change the return type of UpgradeARCRuntimeCalls to void
Akira Hatanaka via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 8 16:33:17 PDT 2019
Author: ahatanak
Date: Thu Aug 8 16:33:17 2019
New Revision: 368367
URL: http://llvm.org/viewvc/llvm-project?rev=368367&view=rev
Log:
Change the return type of UpgradeARCRuntimeCalls to void
Nothing is using the function return.
Modified:
llvm/trunk/include/llvm/IR/AutoUpgrade.h
llvm/trunk/lib/IR/AutoUpgrade.cpp
Modified: llvm/trunk/include/llvm/IR/AutoUpgrade.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/AutoUpgrade.h?rev=368367&r1=368366&r2=368367&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/AutoUpgrade.h (original)
+++ llvm/trunk/include/llvm/IR/AutoUpgrade.h Thu Aug 8 16:33:17 2019
@@ -60,7 +60,7 @@ namespace llvm {
/// Convert calls to ARC runtime functions to intrinsic calls if the bitcode
/// has the arm64 retainAutoreleasedReturnValue marker.
- bool UpgradeARCRuntimeCalls(Module &M);
+ void UpgradeARCRuntimeCalls(Module &M);
void UpgradeSectionAttributes(Module &M);
Modified: llvm/trunk/lib/IR/AutoUpgrade.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/AutoUpgrade.cpp?rev=368367&r1=368366&r2=368367&view=diff
==============================================================================
--- llvm/trunk/lib/IR/AutoUpgrade.cpp (original)
+++ llvm/trunk/lib/IR/AutoUpgrade.cpp Thu Aug 8 16:33:17 2019
@@ -3854,28 +3854,26 @@ bool llvm::UpgradeRetainReleaseMarker(Mo
return Changed;
}
-bool llvm::UpgradeARCRuntimeCalls(Module &M) {
+void llvm::UpgradeARCRuntimeCalls(Module &M) {
auto UpgradeToIntrinsic = [&](const char *OldFunc,
llvm::Intrinsic::ID IntrinsicFunc) {
Function *Fn = M.getFunction(OldFunc);
if (!Fn)
- return false;
+ return;
Function *NewFn = llvm::Intrinsic::getDeclaration(&M, IntrinsicFunc);
Fn->replaceAllUsesWith(NewFn);
Fn->eraseFromParent();
- return true;
};
// Unconditionally convert "clang.arc.use" to "llvm.objc.clang.arc.use".
- bool Changed =
- UpgradeToIntrinsic("clang.arc.use", llvm::Intrinsic::objc_clang_arc_use);
+ UpgradeToIntrinsic("clang.arc.use", llvm::Intrinsic::objc_clang_arc_use);
// Return if the bitcode doesn't have the arm64 retainAutoreleasedReturnValue
// marker. We don't know for sure that it was compiled with ARC in that case.
if (!M.getModuleFlag("clang.arc.retainAutoreleasedReturnValueMarker"))
- return false;
+ return;
std::pair<const char *, llvm::Intrinsic::ID> RuntimeFuncs[] = {
{"objc_autorelease", llvm::Intrinsic::objc_autorelease},
@@ -3917,9 +3915,7 @@ bool llvm::UpgradeARCRuntimeCalls(Module
llvm::Intrinsic::objc_arc_annotation_bottomup_bbend}};
for (auto &I : RuntimeFuncs)
- Changed |= UpgradeToIntrinsic(I.first, I.second);
-
- return Changed;
+ UpgradeToIntrinsic(I.first, I.second);
}
bool llvm::UpgradeModuleFlags(Module &M) {
More information about the llvm-commits
mailing list