[PATCH] D110364: [clang] Rework dontcall attributes

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 28 11:55:00 PDT 2021


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

thanks for the patch!



================
Comment at: llvm/lib/IR/DiagnosticInfo.cpp:408-427
+  if (F->hasFnAttribute("dontcall-error")) {
+    unsigned LocCookie = 0;
+    auto A = F->getFnAttribute("dontcall-error");
+    if (MDNode *MD = CI.getMetadata("srcloc"))
+      LocCookie =
+          mdconst::extract<ConstantInt>(MD->getOperand(0))->getZExtValue();
+    DiagnosticInfoDontCall D(F->getName(), A.getValueAsString(), DS_Error,
----------------
Any way to DRY up this code?



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110364



More information about the cfe-commits mailing list