[clang] [llvm] [IR] Do not store Function inside BlockAddress (PR #137958)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 30 05:48:43 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp,h -- clang/lib/CodeGen/CodeGenFunction.cpp llvm/include/llvm/IR/Constants.h llvm/lib/Bitcode/Reader/BitcodeReader.cpp llvm/lib/CodeGen/AsmPrinter/WinCFGuard.cpp llvm/lib/IR/Constants.cpp llvm/lib/IR/Function.cpp llvm/lib/IR/LLVMContextImpl.h llvm/lib/Transforms/IPO/Attributor.cpp llvm/lib/Transforms/IPO/GlobalOpt.cpp llvm/lib/Transforms/IPO/LowerTypeTests.cpp llvm/lib/Transforms/IPO/OpenMPOpt.cpp llvm/lib/Transforms/IPO/PartialInlining.cpp llvm/lib/Transforms/IPO/SCCP.cpp llvm/tools/llvm-reduce/deltas/ReduceFunctions.cpp llvm/tools/llvm-reduce/deltas/Utils.cpp llvm/tools/llvm-reduce/deltas/Utils.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/IR/Constants.cpp b/llvm/lib/IR/Constants.cpp
index 6bfab0917..49107a421 100644
--- a/llvm/lib/IR/Constants.cpp
+++ b/llvm/lib/IR/Constants.cpp
@@ -1925,8 +1925,7 @@ BlockAddress *BlockAddress::lookup(const BasicBlock *BB) {
/// Remove the constant from the constant table.
void BlockAddress::destroyConstantImpl() {
- getType()->getContext().pImpl->BlockAddresses.erase(
- getBasicBlock());
+ getType()->getContext().pImpl->BlockAddresses.erase(getBasicBlock());
getBasicBlock()->AdjustBlockAddressRefCount(-1);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/137958
More information about the cfe-commits
mailing list