[PATCH] D62319: IR: add 'byval(<ty>)' variant to 'byval' function parameters

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 11:22:04 PDT 2019


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Seems good to me - thanks a bunch (:

(I'd probably suggest making the type parameter to byval non-optional in the IR and builder APIs as soon as it's convenient - that was my general approach in the previous work I did on opaque pointers)



================
Comment at: llvm/lib/IR/Attributes.cpp:552-553
+    if (AI.isTypeAttribute()) {
+      if (getKindAsEnum() == AI.getKindAsEnum())
+        llvm_unreachable("Comparison of types would be unstable");
+      return getKindAsEnum() < AI.getKindAsEnum();
----------------
Prefer assertion rather than branch-to-unreachable

  assert(getKindAsEnum() != AI.getKindAsEnum() ...


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62319





More information about the llvm-commits mailing list