Create pointer nullability lattice.
We hope to make use of the Clang Dataflow Analysis framework to propagate nullability annotations (for example, on assignment of template-instantiated values). For this, we will alter the lattice used in pointer nullability analysis to contain maps from expressions and variable declarations to nullability annotations. This change introduces a custom lattice to the pointer nullability analysis. This lattice is still undistinguishable from a NoopLattice (we will add more functionality on a subsequent change).
PiperOrigin-RevId: 491586319
diff --git a/nullability_verification/pointer_nullability_lattice.h b/nullability_verification/pointer_nullability_lattice.h
new file mode 100644
index 0000000..506e2c0
--- /dev/null
+++ b/nullability_verification/pointer_nullability_lattice.h
@@ -0,0 +1,35 @@
+// 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 THIRD_PARTY_CRUBIT_NULLABILITY_VERIFICATION_POINTER_NULLABILITY_LATTICE_H_
+#define THIRD_PARTY_CRUBIT_NULLABILITY_VERIFICATION_POINTER_NULLABILITY_LATTICE_H_
+
+#include <ostream>
+
+#include "clang/Analysis/FlowSensitive/DataflowAnalysis.h"
+#include "clang/Analysis/FlowSensitive/DataflowLattice.h"
+
+namespace clang {
+namespace tidy {
+namespace nullability {
+
+class PointerNullabilityLattice {
+ public:
+ bool operator==(const PointerNullabilityLattice &Other) const { return true; }
+
+ dataflow::LatticeJoinEffect join(const PointerNullabilityLattice &Other) {
+ return dataflow::LatticeJoinEffect::Unchanged;
+ }
+};
+
+inline std::ostream &operator<<(std::ostream &OS,
+ const PointerNullabilityLattice &) {
+ return OS << "noop";
+}
+
+} // namespace nullability
+} // namespace tidy
+} // namespace clang
+
+#endif // THIRD_PARTY_CRUBIT_NULLABILITY_VERIFICATION_POINTER_NULLABILITY_LATTICE_H_