Separate analysis and diagnosis components for pointer nullability verification.

- `pointer_nullability_analysis.h/cc`: accummulate nullability information of pointers.
- `pointer_nullability_diagnosis.h/cc`: checks null safety (e.g. if a dereference is safe).
- `pointer_nullability.h/cc`: common functions for updating a PointerValue's nullability.

PiperOrigin-RevId: 464823057
diff --git a/nullability_verification/pointer_nullability.h b/nullability_verification/pointer_nullability.h
new file mode 100644
index 0000000..96444b0
--- /dev/null
+++ b/nullability_verification/pointer_nullability.h
@@ -0,0 +1,39 @@
+// Part of the Crubit project, under the Apache License v2.0 with LLVM
+// Exceptions. See /LICENSE for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+#ifndef CRUBIT_NULLABILITY_VERIFICATION_POINTER_NULLABILITY_H_
+#define CRUBIT_NULLABILITY_VERIFICATION_POINTER_NULLABILITY_H_
+
+#include <utility>
+
+#include "clang/AST/Expr.h"
+#include "clang/Analysis/FlowSensitive/DataflowEnvironment.h"
+#include "clang/Analysis/FlowSensitive/Value.h"
+
+namespace clang {
+namespace tidy {
+namespace nullability {
+
+/// Returns the properties representing the nullness information of a pointer.
+///
+/// The first boolean indicates if the pointer's nullability is known.
+/// The second boolean indicates if the pointer's value is not null.
+std::pair<dataflow::AtomicBoolValue&, dataflow::AtomicBoolValue&>
+getPointerNullState(const Expr* PointerExpr, const dataflow::Environment& Env);
+
+/// Sets the nullness properties on the PointerValue assigned to `PointerExpr`
+/// if not already initialised.
+///
+/// The boolean properties may be constrained by passing in the BoolValues
+/// representing true or false to `KnownConstraint` and `NotNullConstraint`.
+/// Otherwise, the properties are set to freshly created atomic booleans.
+void initPointerNullState(const Expr* PointerExpr, dataflow::Environment& Env,
+                          dataflow::BoolValue* KnownConstraint,
+                          dataflow::BoolValue* NotNullConstraint = nullptr);
+
+}  // namespace nullability
+}  // namespace tidy
+}  // namespace clang
+
+#endif  // CRUBIT_NULLABILITY_VERIFICATION_POINTER_NULLABILITY_H_