This is a NFC refactoring to change makeIntValWithPtrWidth
and remove getZeroWithPtrWidth to use types when forming values to match
pointer widths. Some targets may have different pointer widths depending
upon address space, so this needs to be comprehended.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h | ||
---|---|---|
335–336 | This function should have a different name. | |
clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp | ||
2613 | We peobably wanted to use a different tspe for this expressuon. 'getArrayIndexType()' is a better fit IMO. |
Looks like the API was used incorrectly 50% of the time anyway :)
I have one nit but other than that looks good.
clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp | ||
---|---|---|
2613 | TotalSize is literally size_t so ASTContext.getSizeType() is the right type. getArrayIndexType() is signed so it's different. |
This function should have a different name.
Probbaly the makeIntValWithWidth() is a better alternative.
Ah but even this is far less than ideal.