[clang] [analyzer] Add MemSpace trait to program state (PR #123003)
DonĂ¡t Nagy via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 15 06:00:39 PST 2025
================
@@ -0,0 +1,62 @@
+//===-- MemSpaces.cpp ---------------------------------------------*- 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
+//
+//===----------------------------------------------------------------------===//
+//
+// TODO
+//
+//===----------------------------------------------------------------------===//
+
+#include "clang/StaticAnalyzer/Core/PathSensitive/MemSpaces.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h"
+#include "clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h"
+#include <cassert>
+
+REGISTER_MAP_WITH_PROGRAMSTATE(MemSpacesMap, const clang::ento::MemRegion *,
+ const clang::ento::MemSpaceRegion *)
+
+namespace clang {
+namespace ento {
+namespace memspace {
+
+ProgramStateRef setMemSpaceTrait(ProgramStateRef State, const MemRegion *MR,
+ const MemSpaceRegion *MS) {
+ // for now, this should only be called to update the trait for mem regions
----------------
NagyDonat wrote:
```suggestion
// For now, this should only be called to update the trait for mem regions
```
Comments (especially long comments like this) are capitalized.
Also, personally I'd write "memory" instead of "mem" in the flowing text of the comment.
https://github.com/llvm/llvm-project/pull/123003
More information about the cfe-commits
mailing list