[PATCH] D126844: [BOLT][NFC] Fix braces in BinaryEmitter

Maksim Panchenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 1 18:30:04 PDT 2022


maksfb created this revision.
maksfb added reviewers: yota9, Amir, ayermolo, rafauler, zr33, nhuhuan.
Herald added a project: All.
maksfb requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D126844

Files:
  bolt/lib/Core/BinaryEmitter.cpp


Index: bolt/lib/Core/BinaryEmitter.cpp
===================================================================
--- bolt/lib/Core/BinaryEmitter.cpp
+++ bolt/lib/Core/BinaryEmitter.cpp
@@ -328,10 +328,9 @@
   // Emit CFI start
   if (Function.hasCFI()) {
     Streamer.emitCFIStartProc(/*IsSimple=*/false);
-    if (Function.getPersonalityFunction() != nullptr) {
+    if (Function.getPersonalityFunction() != nullptr)
       Streamer.emitCFIPersonality(Function.getPersonalityFunction(),
                                   Function.getPersonalityEncoding());
-    }
     MCSymbol *LSDASymbol =
         EmitColdPart ? Function.getColdLSDASymbol() : Function.getLSDASymbol();
     if (LSDASymbol)
@@ -414,10 +413,9 @@
       continue;
 
     if ((opts::AlignBlocks || opts::PreserveBlocksAlignment) &&
-        BB->getAlignment() > 1) {
+        BB->getAlignment() > 1)
       Streamer.emitCodeAlignment(BB->getAlignment(), &*BC.STI,
                                  BB->getAlignmentMaxBytes());
-    }
     Streamer.emitLabel(BB->getLabel());
     if (!EmitCodeOnly) {
       if (MCSymbol *EntrySymbol = BF.getSecondaryEntryPointSymbol(*BB))
@@ -540,15 +538,14 @@
     auto NextData = std::next(DataIter);
     auto CodeIter = Islands.CodeOffsets.lower_bound(*DataIter);
     if (CodeIter == Islands.CodeOffsets.end() &&
-        NextData == Islands.DataOffsets.end()) {
+        NextData == Islands.DataOffsets.end())
       EndOffset = BF.getMaxSize();
-    } else if (CodeIter == Islands.CodeOffsets.end()) {
+    else if (CodeIter == Islands.CodeOffsets.end())
       EndOffset = *NextData;
-    } else if (NextData == Islands.DataOffsets.end()) {
+    else if (NextData == Islands.DataOffsets.end())
       EndOffset = *CodeIter;
-    } else {
+    else
       EndOffset = (*CodeIter > *NextData) ? *NextData : *CodeIter;
-    }
 
     if (FunctionOffset == EndOffset)
       continue; // Size is zero, nothing to emit
@@ -874,9 +871,8 @@
 void BinaryEmitter::emitLSDA(BinaryFunction &BF, bool EmitColdPart) {
   const BinaryFunction::CallSitesType *Sites =
       EmitColdPart ? &BF.getColdCallSites() : &BF.getCallSites();
-  if (Sites->empty()) {
+  if (Sites->empty())
     return;
-  }
 
   // Calculate callsite table size. Size of each callsite entry is:
   //
@@ -886,9 +882,8 @@
   //
   //  sizeof(dwarf::DW_EH_PE_data4) * 3 + sizeof(uleb128(action))
   uint64_t CallSiteTableLength = Sites->size() * 4 * 3;
-  for (const BinaryFunction::CallSite &CallSite : *Sites) {
+  for (const BinaryFunction::CallSite &CallSite : *Sites)
     CallSiteTableLength += getULEB128Size(CallSite.Action);
-  }
 
   Streamer.SwitchSection(BC.MOFI->getLSDASection());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D126844.433609.patch
Type: text/x-patch
Size: 2663 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220602/6ee02d51/attachment.bin>


More information about the llvm-commits mailing list