blob: 85bb713309484db1bb680d2369fbe5501c4f8e62 [file] [log] [blame]
//===--- ExceptionEscapeCheck.h - clang-tidy --------------------*- C++ -*-===//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "../ClangTidyCheck.h"
#include "../utils/ExceptionAnalyzer.h"
#include "llvm/ADT/StringSet.h"
namespace clang {
namespace tidy {
namespace bugprone {
/// Finds functions which should not throw exceptions: Destructors, move
/// constructors, move assignment operators, the main() function,
/// swap() functions, functions marked with throw() or noexcept and functions
/// given as option to the checker.
/// For the user-facing documentation see:
class ExceptionEscapeCheck : public ClangTidyCheck {
ExceptionEscapeCheck(StringRef Name, ClangTidyContext *Context);
void storeOptions(ClangTidyOptions::OptionMap &Opts) override;
void registerMatchers(ast_matchers::MatchFinder *Finder) override;
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;
std::string RawFunctionsThatShouldNotThrow;
std::string RawIgnoredExceptions;
llvm::StringSet<> FunctionsThatShouldNotThrow;
utils::ExceptionAnalyzer Tracer;
} // namespace bugprone
} // namespace tidy
} // namespace clang