================
@@ -124,12 +140,20 @@ class ExceptionAnalyzer {
     /// after filtering.
     bool ContainsUnknown;
 
+    bool UnknownFromMissingDefinition = false;
+    bool UnknownFromKnownUnannotated = false;
----------------
vbvictor wrote:

Do we need to store this in `ExceptionInfo` and pass it each time?
I think it's the responsibility of `ExeceptionAnalyzer` to store behavior when 
encountering an unknown function, and `ExceptionInfo` is just a "dataclass", 
not storage for options.
So we wouldn't have to write this piece of code:
```cpp
const bool ReportUnknown =
      IsUnknown && ((TreatFunctionsWithoutSpecificationAsThrowing ==
                         FunctionsThatShouldNotThrowPolicy::All &&
                     Info.hasUnknownFromKnownUnannotated()) ||
                    (TreatFunctionsWithoutSpecificationAsThrowing !=
                         FunctionsThatShouldNotThrowPolicy::None &&
                     Info.hasUnknownFromMissingDefinition()));
```
`ExceptionInfo` would already know by itself whether it throws or not 
(depending on what `ExeceptionAnalyzer` produced).



https://github.com/llvm/llvm-project/pull/168324
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to