[PATCH] D127763: [analyzer] Relax constraints on const qualified regions

Balázs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 15 08:08:53 PDT 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG929e60b6bd2f: [analyzer] Relax constraints on const qualified regions (authored by steakhal).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127763/new/

https://reviews.llvm.org/D127763

Files:
  clang/lib/StaticAnalyzer/Core/MemRegion.cpp


Index: clang/lib/StaticAnalyzer/Core/MemRegion.cpp
===================================================================
--- clang/lib/StaticAnalyzer/Core/MemRegion.cpp
+++ clang/lib/StaticAnalyzer/Core/MemRegion.cpp
@@ -975,9 +975,7 @@
   if (D->hasGlobalStorage() && !D->isStaticLocal()) {
     QualType Ty = D->getType();
     assert(!Ty.isNull());
-    if (Ty.isConstQualified() && Ty->isArithmeticType()) {
-      // TODO: We could walk the complex types here and see if everything is
-      // constified.
+    if (Ty.isConstQualified()) {
       sReg = getGlobalsRegion(MemRegion::GlobalImmutableSpaceRegionKind);
     } else if (Ctx.getSourceManager().isInSystemHeader(D->getLocation())) {
       sReg = getGlobalsRegion(MemRegion::GlobalSystemSpaceRegionKind);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127763.437183.patch
Type: text/x-patch
Size: 768 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220615/a6b6183d/attachment.bin>


More information about the cfe-commits mailing list