[PATCH] D57855: [analyzer] Reimplement checker options

Kristóf Umann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 07:27:32 PDT 2019


Szelethus marked 3 inline comments as done.
Szelethus added a comment.

> Let's put at least a FIXME here that the documentation for this option was missing.

I'd prefer to just simply fix this. @NoQ, could you help us fill in the gaps? We need a desctiption for

- `nullability:NoDiagnoseCallsToSystemHeaders`
- `osx.cocoa.RetainCount:CheckOSObject`
- `osx.cocoa.RetainCount:leak-diagnostics-reference-allocation`
- `osx.cocoa.RetainCount:TrackNSCFStartParam`



================
Comment at: lib/Frontend/CompilerInvocation.cpp:425
   bool HasFailed = getStringOption(Config, Name, std::to_string(DefaultVal))
-                     .getAsInteger(10, OptionField);
+                     .getAsInteger(0, OptionField);
   if (Diags && HasFailed)
----------------
whisperity wrote:
> What is this trying to do?
Oh right, this is why (mind you, we had a checker option that was hexadecimal, but apparently never used, as it caused an assertation failure):

```
template<typename T >
std::enable_if<std::numeric_limits<T>::is_signed, bool>::type
llvm::StringRef::getAsInteger(unsigned Radix, T &Result) const
```
Parse the current string as an integer of the specified radix.

If Radix is specified as zero, this does radix autosensing using extended C rules: 0 is octal, 0x is hex, 0b is binary.

If the string is invalid or if only a subset of the string is valid, this returns true to signify the error. The string is considered erroneous if empty or if it overflows T.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D57855/new/

https://reviews.llvm.org/D57855





More information about the cfe-commits mailing list