[llvm] Optimize loops in MC. (PR #98114)

via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 8 22:55:24 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 915372a8db7a8d7a1af19cc9ec6ccb5a0d592d1f d2d3977a879a482665aa6ce1dc60532dae36e3be -- llvm/lib/MC/MCParser/AsmParser.cpp llvm/lib/MC/MCParser/MasmParser.cpp llvm/lib/MC/XCOFFObjectWriter.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/MC/XCOFFObjectWriter.cpp b/llvm/lib/MC/XCOFFObjectWriter.cpp
index 122f19367a..5253b25f68 100644
--- a/llvm/lib/MC/XCOFFObjectWriter.cpp
+++ b/llvm/lib/MC/XCOFFObjectWriter.cpp
@@ -1387,7 +1387,7 @@ unsigned XCOFFObjectWriter::getExceptionSectionSize() {
 
   for (auto I = ExceptionSection.ExceptionTable.begin(),
             E = ExceptionSection.ExceptionTable.end();
-      I != E; ++I)
+       I != E; ++I)
     // The size() gets +1 to account for the initial entry containing the
     // symbol table index.
     EntryNum += I->second.Entries.size() + 1;
@@ -1400,7 +1400,7 @@ unsigned XCOFFObjectWriter::getExceptionOffset(const MCSymbol *Symbol) {
   unsigned EntryNum = 0;
   for (auto I = ExceptionSection.ExceptionTable.begin(),
             E = ExceptionSection.ExceptionTable.end();
-      I != E; ++I) {
+       I != E; ++I) {
     if (Symbol == I->second.FunctionSymbol)
       break;
     EntryNum += I->second.Entries.size() + 1;
@@ -1670,8 +1670,8 @@ void XCOFFObjectWriter::writeSectionForExceptionSectionEntry(
     const MCAssembler &Asm, ExceptionSectionEntry &ExceptionEntry,
     uint64_t &CurrentAddressLocation) {
   for (auto I = ExceptionEntry.ExceptionTable.begin(),
-          E = ExceptionEntry.ExceptionTable.end();
-     I != E; ++I) {
+            E = ExceptionEntry.ExceptionTable.end();
+       I != E; ++I) {
     // For every symbol that has exception entries, you must start the entries
     // with an initial symbol table index entry
     W.write<uint32_t>(SymbolIndexMap[I->second.FunctionSymbol]);

``````````

</details>


https://github.com/llvm/llvm-project/pull/98114


More information about the llvm-commits mailing list