[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-12 Thread Kristóf Umann via cfe-commits
Szelethus wrote: Superceding this patch to 108373. https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-12 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus closed https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
@@ -490,6 +491,47 @@ SVal SValBuilder::evalUnaryOp(ProgramStateRef state, UnaryOperator::Opcode opc, llvm_unreachable("Unexpected unary operator"); } +namespace { +/// Iterate through to store to find the actual value this LazyCompoundVal +/// corresponds to. Further readin

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat requested changes to this pull request. Unfortunately I found several fundamental issues within the implementation of `extractActualValueFrom()` -- see inline comments for details. Moreover I'm not convinced that this "replace `LazyCompoundVal`s with actual values"

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-04 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Donát Nagy via cfe-commits
@@ -315,6 +315,62 @@ static bool isFunctionMacroExpansion(SourceLocation Loc, return EInfo.isFunctionMacroExpansion(); } +static const LocationContext *getFirstNonCtorCall(const LocationContext *LCtx) { + while (llvm::isa_and_nonnull(LCtx->getDecl())) +LCtx = LCtx->get

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Donát Nagy via cfe-commits
@@ -718,6 +718,91 @@ class NoStateChangeFuncVisitor : public BugReporterVisitor { PathSensitiveBugReport &R) final; }; +/// Put a diagnostic on return statement of all inlined functions +/// for which the region of interest \p RegionOfInter

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Donát Nagy via cfe-commits
@@ -718,6 +718,91 @@ class NoStateChangeFuncVisitor : public BugReporterVisitor { PathSensitiveBugReport &R) final; }; +/// Put a diagnostic on return statement of all inlined functions +/// for which the region of interest \p RegionOfInter

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Donát Nagy via cfe-commits
@@ -315,6 +315,62 @@ static bool isFunctionMacroExpansion(SourceLocation Loc, return EInfo.isFunctionMacroExpansion(); } +static const LocationContext *getFirstNonCtorCall(const LocationContext *LCtx) { + while (llvm::isa_and_nonnull(LCtx->getDecl())) +LCtx = LCtx->get

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat edited https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Donát Nagy via cfe-commits
https://github.com/NagyDonat commented: First part of my review, I'll continue tomorrow. https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commit

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Donát Nagy via cfe-commits
@@ -538,7 +541,8 @@ ProgramStateRef CStringChecker::checkInit(CheckerContext &C, OS << ") in the "; printIdxWithOrdinalSuffix(OS, Buffer.ArgumentIndex + 1); OS << " argument is undefined"; -emitUninitializedReadBug(C, State, Buffer.Expression, OS.str()); +em

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus edited https://github.com/llvm/llvm-project/pull/106982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-static-analyzer-1 Author: Kristóf Umann (Szelethus) Changes SValBuilder used to early exit when we did binary operations when one of the operands was a LazyCompoundVal. Riding on the new docs patch (#97407), this patch extracts the actual value b

[clang] [analyzer] Implement binary operations on LazyCompoundVals (PR #106982)

2024-09-02 Thread Kristóf Umann via cfe-commits
https://github.com/Szelethus created https://github.com/llvm/llvm-project/pull/106982 SValBuilder used to early exit when we did binary operations when one of the operands was a LazyCompoundVal. Riding on the new docs patch (#97407), this patch extracts the actual value behind the LazyCompound