}
ExceptionAnalyzer::ExceptionInfo
-ExceptionAnalyzer::analyze(const FunctionDecl *Func) {
+ExceptionAnalyzer::analyzeImpl(const FunctionDecl *Func) {
ExceptionInfo ExceptionList;
// Check if the function has already been analyzed and reuse that result.
} else
ExceptionList = FunctionCache[Func];
+ return ExceptionList;
+}
+
+template <typename T>
+ExceptionAnalyzer::ExceptionInfo
+ExceptionAnalyzer::analyzeDispatch(const T *Node) {
+ ExceptionInfo ExceptionList = analyzeImpl(Node);
+
if (ExceptionList.getBehaviour() == State::NotThrowing ||
ExceptionList.getBehaviour() == State::Unknown)
return ExceptionList;
return ExceptionList;
}
+
+ExceptionAnalyzer::ExceptionInfo
+ExceptionAnalyzer::analyze(const FunctionDecl *Func) {
+ return analyzeDispatch(Func);
+}
+
} // namespace utils
} // namespace tidy
throwsException(const Stmt *St, const ExceptionInfo::Throwables &Caught,
llvm::SmallSet<const FunctionDecl *, 32> &CallStack);
+ ExceptionInfo analyzeImpl(const FunctionDecl *Func);
+
+ template <typename T> ExceptionInfo analyzeDispatch(const T *Node);
+
bool IgnoreBadAlloc = true;
llvm::StringSet<> IgnoredExceptions;
std::map<const FunctionDecl *, ExceptionInfo> FunctionCache;
};
+
} // namespace utils
} // namespace tidy
} // namespace clang