[PATCH] D18004: [ELF] - refactor of SymbolBody::compare()

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 10 02:03:00 PST 2016


grimar added inline comments.

================
Comment at: ELF/Symbols.cpp:115
@@ -114,1 +114,3 @@
 
+static int compareCommons(DefinedCommon* A, DefinedCommon* B) {
+  if (A->Size < B->Size)
----------------
ruiu wrote:
>   DeifnedCommon* A, DefiendCommon* B
> 
> ->
> 
>   DeifnedCommon *A, DefiendCommon *B
Done.

================
Comment at: ELF/Symbols.cpp:117
@@ +116,3 @@
+  if (A->Size < B->Size)
+    return -compareCommons(B, A);
+  A->MaxAlignment = std::max(A->MaxAlignment, B->MaxAlignment);
----------------
ruiu wrote:
> I understand the intention but this seems a bit tricky. It only saves one line, so I wouldn't use a recursion.
> 
>   if (A->Size < B->Size) {
>     B->MaxAlignment = std::max(A->MaxAlignment, B->MaxAlignment);
>     return -1;
>   }
Done.


http://reviews.llvm.org/D18004





More information about the llvm-commits mailing list