[clang-tools-extra] [clang][dataflow] Change `diagnoseFunction` to take type of diagnostic list instead of diagnostic itself. (PR #66014)

Yitzhak Mandelbaum via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 12 08:14:42 PDT 2023


================
@@ -245,10 +245,10 @@ runDataflowAnalysis(
 ///   iterations.
 /// - This limit is still low enough to keep runtimes acceptable (on typical
 ///   machines) in cases where we hit the limit.
-template <typename AnalysisT, typename Diagnostic>
-llvm::Expected<std::vector<Diagnostic>> diagnoseFunction(
+template <typename AnalysisT, typename DiagnosticList>
+llvm::Expected<DiagnosticList> diagnoseFunction(
----------------
ymand wrote:

That's my intuition as well (that `llvm::SmallVector` is likely better). But, who knows? An analysis could expect to have a non-small number of diagnostics per line.  I really can't predict. So, I figured better to leave it open since the implementation doesn't care. I'm fine either way. The conservative approach is to go with `SmallVector` and open it up to other containers in the future if there's demand.

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


More information about the cfe-commits mailing list