[clang] [llvm] [clang] report inlining decisions with -Wattribute-{warning|error} (PR #73552)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 27 11:02:50 PST 2023


================
@@ -794,6 +796,13 @@ void BackendConsumer::DontCallDiagHandler(const DiagnosticInfoDontCall &D) {
                               ? diag::err_fe_backend_error_attr
                               : diag::warn_fe_backend_warning_attr)
       << llvm::demangle(D.getFunctionName()) << D.getNote();
+
+  SmallVector<std::string> InliningDecisions = D.getInliningDecisions();
+  InliningDecisions.push_back(D.getCaller().str());
+  for (auto [index, value] : llvm::enumerate(InliningDecisions))
----------------
erichkeane wrote:

```suggestion
  for (const auto &[index, value] : llvm::enumerate(InliningDecisions))
```

Seems we don't modify either, and `value` is a string, so requiring a copy of the pair is expensive.

https://github.com/llvm/llvm-project/pull/73552


More information about the cfe-commits mailing list