================
@@ -0,0 +1,449 @@
+//===- BoundsChecking.cpp - Bounds checking related APIs --------*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// This file defines APIs for performing a bounds check (i.e. comparing a
+// symbolic Offset value to zero and a symbolic Extent value) and composing
+// descriptions that explain its results.
+//
+// This is intended as a replacement for `ProgramState::assumeInBound` to
+// avoid its incorrect logic and compensate for deficiencies of other parts of
+// the analyzer.
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/StaticAnalyzer/Checkers/BoundsChecking.h"
+#include "clang/StaticAnalyzer/Checkers/Taint.h"
+
+using llvm::formatv;
+
+namespace clang {
+namespace ento {
----------------
steakhal wrote:
```suggestion
namespace clang::ento {
```
It is usually better to `using` a namespace and have a partially qualified name
for defining functions when providing definitions.
Consider if you change the parameter types in the header but then forget to
update the CPP file.
Then the CPP file would just define new overloads to the forward declared
(different types!) fns.
However, if you were to use qualified names for providing definitions, then it
would be a hard error to qualify a name that wasn't forward declared.
Consequently, protect you against mismatching header and CPP files.
https://github.com/llvm/llvm-project/pull/202372
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits