|
clang-tools 22.0.0git
|
This class analysis if a FunctionDecl can in principle throw an exception, either directly or indirectly. More...
#include <ExceptionAnalyzer.h>
Classes | |
| class | ExceptionInfo |
| Bundle the gathered information about an entity like a function regarding it's exception behaviour. More... | |
Public Types | |
| enum class | State { Throwing , NotThrowing , Unknown } |
| using | CallStack = llvm::MapVector<const FunctionDecl *, SourceLocation> |
| We use a MapVector to preserve the order of the functions in the call stack as well as have fast lookup. | |
Public Member Functions | |
| ExceptionAnalyzer ()=default | |
| void | ignoreBadAlloc (bool ShallIgnore) |
| void | ignoreExceptions (llvm::StringSet<> ExceptionNames) |
| ExceptionInfo | analyze (const FunctionDecl *Func) |
| ExceptionInfo | analyze (const Stmt *Stmt) |
This class analysis if a FunctionDecl can in principle throw an exception, either directly or indirectly.
It can be configured to ignore custom exception types.
Definition at line 23 of file ExceptionAnalyzer.h.
| using clang::tidy::utils::ExceptionAnalyzer::CallStack = llvm::MapVector<const FunctionDecl *, SourceLocation> |
We use a MapVector to preserve the order of the functions in the call stack as well as have fast lookup.
Definition at line 34 of file ExceptionAnalyzer.h.
|
strong |
| Enumerator | |
|---|---|
| Throwing | The function can definitely throw given an AST. |
| NotThrowing | This function can not throw, given an AST. |
| Unknown | This can happen for extern functions without available definition. |
Definition at line 25 of file ExceptionAnalyzer.h.
|
default |
| ExceptionAnalyzer::ExceptionInfo clang::tidy::utils::ExceptionAnalyzer::analyze | ( | const FunctionDecl * | Func | ) |
Definition at line 662 of file ExceptionAnalyzer.cpp.
| ExceptionAnalyzer::ExceptionInfo clang::tidy::utils::ExceptionAnalyzer::analyze | ( | const Stmt * | Stmt | ) |
Definition at line 666 of file ExceptionAnalyzer.cpp.
|
inline |
Definition at line 134 of file ExceptionAnalyzer.h.
|
inline |
Definition at line 135 of file ExceptionAnalyzer.h.