r229593 - [analyzer] Refactoring: clarified the way the proper check kind is chosen.

Anton Yartsev anton.yartsev at gmail.com
Thu Mar 5 18:07:18 PST 2015


>>> @@ -2479,8 +2499,10 @@ void MallocChecker::printState(raw_ostre
>>>     for (RegionStateTy::iterator I = RS.begin(), E = RS.end(); I != 
>>> E; ++I) {
>>>       const RefState *RefS = State->get<RegionState>(I.getKey());
>>>       AllocationFamily Family = RefS->getAllocationFamily();
>>> -      Optional<MallocChecker::CheckKind> CheckKind = 
>>> getCheckIfTracked(Family);
>>> -
>>> +      auto CheckKind = 
>>> getCheckIfTracked(MakeVecFromCK(CK_MallocOptimistic,
>>> + 
>>>                                                       CK_MallocPessimistic,
>>> + 
>>>                                                       CK_NewDeleteChecker),
>>> +                                         Family);
>>
>> This is a generic printing routine, which is used for debugging. Why 
>> is this restricted to the specific checkers?
> This particular branch handles leak detecting checkers which are 
> CK_MallocOptimistic, CK_MallocPessimistic, and CK_NewDeleteChecker.
Wrong answer:)

Here we try to deduce the concrete checker from the family. This is 
impossible as there are several checkers responsible for each family.
For now I left the behavior to those before the commit.
This should be fixed somehow. There are combinations of enabled/disabled 
checkers when the name of the checker may be deduced from the family 
unambiguously. I'll think about it.

-- 
Anton




More information about the cfe-commits mailing list