[PATCH] D141451: [clang] report inlining decisions with -Wattribute-{warning|error}

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 11 13:29:07 PST 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:2467-2468
+
+        const Function *Callee = CI->getCalledFunction();
+        if (Callee && (Callee->hasFnAttribute("dontcall-error") ||
+                       Callee->hasFnAttribute("dontcall-warn"))) {
----------------
Misses constexpr casts and aliases


================
Comment at: llvm/lib/Transforms/Utils/InlineFunction.cpp:2471
+          Metadata *MD = MDString::get(CI->getContext(), CalledFunc->getName());
+          if (MDNode *N = CI->getMetadata("inlined-from")) {
+            TempMDTuple Temp = cast<MDTuple>(N)->clone();
----------------
metadata usually uses . word separators


================
Comment at: llvm/test/Transforms/Inline/dontcall-attributes.ll:8
+declare void @fof() "dontcall-error"="oh no"
+
+define void @bar(i32 %x) {
----------------
test alias case?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141451



More information about the llvm-commits mailing list