[llvm] [BOLT][DWARF][NFC] Refactor updateUnitDebugInfo (PR #100811)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 28 17:32:09 PDT 2024
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 ea7cc12f612ef5c5f70082ebfdee378d80ec44bd ffafed13e2e22a0cff27a39f4b50c5054ce0b8b0 --extensions h,cpp -- bolt/include/bolt/Rewrite/DWARFRewriter.h bolt/lib/Rewrite/DWARFRewriter.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/bolt/lib/Rewrite/DWARFRewriter.cpp b/bolt/lib/Rewrite/DWARFRewriter.cpp
index a141d2a2f4..b6ecd6ca42 100644
--- a/bolt/lib/Rewrite/DWARFRewriter.cpp
+++ b/bolt/lib/Rewrite/DWARFRewriter.cpp
@@ -939,26 +939,26 @@ void DWARFRewriter::handleSubprogram(
FunctionRanges = Function->getOutputAddressRanges();
}
- // Clear cached ranges as the new function will have its own set.
- CachedRanges.clear();
- DIEValue LowPCVal = Die.findAttribute(dwarf::DW_AT_low_pc);
- DIEValue HighPCVal = Die.findAttribute(dwarf::DW_AT_high_pc);
- if (FunctionRanges.empty()) {
- if (LowPCVal && HighPCVal)
- FunctionRanges.push_back({0, HighPCVal.getDIEInteger().getValue()});
- else
- FunctionRanges.push_back({0, 1});
- }
+ // Clear cached ranges as the new function will have its own set.
+ CachedRanges.clear();
+ DIEValue LowPCVal = Die.findAttribute(dwarf::DW_AT_low_pc);
+ DIEValue HighPCVal = Die.findAttribute(dwarf::DW_AT_high_pc);
+ if (FunctionRanges.empty()) {
+ if (LowPCVal && HighPCVal)
+ FunctionRanges.push_back({0, HighPCVal.getDIEInteger().getValue()});
+ else
+ FunctionRanges.push_back({0, 1});
+ }
- if (FunctionRanges.size() == 1 && !opts::AlwaysConvertToRanges) {
- updateLowPCHighPC(&Die, Unit, DIEBldr, AddressWriter, LowPCVal,
- HighPCVal, FunctionRanges.back().LowPC,
- FunctionRanges.back().HighPC);
- return;
- }
+ if (FunctionRanges.size() == 1 && !opts::AlwaysConvertToRanges) {
+ updateLowPCHighPC(&Die, Unit, DIEBldr, AddressWriter, LowPCVal, HighPCVal,
+ FunctionRanges.back().LowPC,
+ FunctionRanges.back().HighPC);
+ return;
+ }
- updateDWARFObjectAddressRanges(
- Unit, DIEBldr, Die, RangesSectionWriter.addRanges(FunctionRanges));
+ updateDWARFObjectAddressRanges(Unit, DIEBldr, Die,
+ RangesSectionWriter.addRanges(FunctionRanges));
}
void DWARFRewriter::handleLexicalBlock(
``````````
</details>
https://github.com/llvm/llvm-project/pull/100811
More information about the llvm-commits
mailing list