Add benchmarking support for pointer nullability analysis.
This change includes somewhat arbitrary functions as benchmarks. Most are synthetic, with two derived from a real example. We need to grow these into a more principled sets of benchmark functions.
PiperOrigin-RevId: 579872437
Change-Id: Iffc02c0dc2805015d11d847ebc9eb422eea2139e
diff --git a/nullability/BUILD b/nullability/BUILD
index 316833b..5c62ecf 100644
--- a/nullability/BUILD
+++ b/nullability/BUILD
@@ -186,3 +186,21 @@
"@llvm-project//third-party/unittest:gmock",
],
)
+
+cc_test(
+ name = "pointer_nullability_analysis_benchmark",
+ srcs = ["pointer_nullability_analysis_benchmark.cc"],
+ tags = ["benchmark"],
+ deps = [
+ ":pointer_nullability_analysis",
+ ":pointer_nullability_diagnosis",
+ "@absl//absl/log:check",
+ "@absl//absl/strings",
+ "@absl//absl/strings:string_view",
+ "@com_google_googletest//:gtest_main",
+ "@llvm-project//clang:analysis",
+ "@llvm-project//clang:ast",
+ "@llvm-project//clang:basic",
+ "@llvm-project//clang:testing",
+ ],
+)