Author: Balazs Benics Date: 2022-06-15T17:08:27+02:00 New Revision: 929e60b6bd2f463321b6e98db85a3d9c89236996
URL: https://github.com/llvm/llvm-project/commit/929e60b6bd2f463321b6e98db85a3d9c89236996 DIFF: https://github.com/llvm/llvm-project/commit/929e60b6bd2f463321b6e98db85a3d9c89236996.diff LOG: [analyzer] Relax constraints on const qualified regions The arithmetic restriction seems to be artificial. The comment below seems to be stale. Thus, we remove both. Depends on D127306. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D127763 Added: Modified: clang/lib/StaticAnalyzer/Core/MemRegion.cpp Removed: ################################################################################ diff --git a/clang/lib/StaticAnalyzer/Core/MemRegion.cpp b/clang/lib/StaticAnalyzer/Core/MemRegion.cpp index 96a985381acc..f0cda835e07c 100644 --- a/clang/lib/StaticAnalyzer/Core/MemRegion.cpp +++ b/clang/lib/StaticAnalyzer/Core/MemRegion.cpp @@ -975,9 +975,7 @@ const VarRegion *MemRegionManager::getVarRegion(const VarDecl *D, 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); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits