[PATCH] D91272: [AIX] Support init priority

Sean Fertile via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 08:20:45 PST 2020


sfertile added a comment.

A couple of really minor comments, but otherwise LGTM.



================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:2000
+static unsigned mapToSinitPriority(unsigned P) {
+  if (P > 20 && P < 81) {
+    P = 20 + (P - 20) * 16;
----------------
Its simpler if we use returns:

```
if (P <=20)
  return P;

if (P < 81)
  return 20 + (P - 20) * 16;

etc ...
```


================
Comment at: llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp:2028
+
+  if (Priority < 0 || Priority > 65535)
+    report_fatal_error("invalid init priority");
----------------
Real minor nit: Move this inside the helper function.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91272/new/

https://reviews.llvm.org/D91272



More information about the llvm-commits mailing list