mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-14 12:12:07 +00:00
[clang-tidy] FunctionSizeCheck: wrap FunctionASTVisitor into anon namespace, NFC
This check is relatively simple, and is often being used as an example. I'm aware of at least two cases, when simply copying the FunctionASTVisitor class to a new check resulted in a rather unobvious segfault. Having it in anonymous namespace prevents such a problem. No functionality change, so i opted to avoid phabricator, especially since clang-tidy reviews are seriously jammed. llvm-svn: 312912
This commit is contained in:
parent
c6ea4deb6d
commit
728284dc39
@ -16,6 +16,7 @@ using namespace clang::ast_matchers;
|
||||
namespace clang {
|
||||
namespace tidy {
|
||||
namespace readability {
|
||||
namespace {
|
||||
|
||||
class FunctionASTVisitor : public RecursiveASTVisitor<FunctionASTVisitor> {
|
||||
using Base = RecursiveASTVisitor<FunctionASTVisitor>;
|
||||
@ -85,6 +86,8 @@ public:
|
||||
unsigned CurrentNestingLevel = 0;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
FunctionSizeCheck::FunctionSizeCheck(StringRef Name, ClangTidyContext *Context)
|
||||
: ClangTidyCheck(Name, Context),
|
||||
LineThreshold(Options.get("LineThreshold", -1U)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user