[PATCH] D68199: [analyzer] DynamicTypeInfo: Simplify the API
Csaba Dabis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Oct 2 16:11:40 PDT 2019
Charusso marked 3 inline comments as done.
Charusso added a comment.
Sorry, I was sure it is working as expected.
================
Comment at: clang/lib/StaticAnalyzer/Core/DynamicType.cpp:53-57
if (const auto *TR = dyn_cast<TypedRegion>(MR))
- return DynamicTypeInfo(TR->getLocationType(), /*CanBeSub=*/false);
+ return new DynamicTypeInfo(TR->getLocationType(), /*CanBeSub=*/false);
- if (const auto *SR = dyn_cast<SymbolicRegion>(MR)) {
- SymbolRef Sym = SR->getSymbol();
- return DynamicTypeInfo(Sym->getType());
- }
+ if (const auto *SR = dyn_cast<SymbolicRegion>(MR))
+ return new DynamicTypeInfo(SR->getSymbol()->getType());
----------------
NoQ wrote:
> Do i have to do a `delete` manually every time i call this function?
Well, from now you do not.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D68199/new/
https://reviews.llvm.org/D68199
More information about the cfe-commits
mailing list