arsenm added inline comments.

================
Comment at: llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp:208
     }
+    // TODO: is this the best pass for this?
+    for (BasicBlock &BB : F) {
----------------
Why not just do in in codegen in IRTranslator/SelectionDAGBuilder?


================
Comment at: llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp:212
+        if (CallBase *CB = dyn_cast<CallBase>(&I)) {
+          if (Function *Callee = CB->getCalledFunction()) {
+            if (Callee->hasFnAttribute("user-diagnostic")) {
----------------
What's the expected behavior if the function is called indirectly?


================
Comment at: llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp:219
+              DiagnosticInfoUser DU(
+                  Callee->getFnAttribute("user-diagnostic").getValueAsString(),
+                  Callee->getName(), LocCookie);
----------------
Just do one getFnAttribute instead of pre-checking it?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D106030

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to