================ @@ -0,0 +1,320 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include "InefficientContainerAssignmentCheck.h" +#include "../utils/OptionsUtils.h" +#include "clang/AST/ASTContext.h" +#include "clang/AST/DeclTemplate.h" +#include "clang/AST/ExprCXX.h" +#include "clang/AST/ParentMapContext.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "clang/Lex/Lexer.h" +#include "llvm/ADT/STLExtras.h" +#include "llvm/ADT/SmallPtrSet.h" +#include "llvm/ADT/SmallVector.h" +#include "llvm/ADT/StringExtras.h" +#include <optional> +#include <string> + +using namespace clang::ast_matchers; + +namespace clang::tidy::performance { + +namespace { + +/// How the assignment can be rewritten without the temporary. The order +/// matches the %select in the diagnostic. +enum class Rewrite { + Assign, ///< lhs.assign(args...) + AssignRange, ///< lhs.assign_range(range) + ClearResize, ///< lhs.clear(); lhs.resize(count) + InitList, ///< lhs = {...} + Direct, ///< lhs = source +}; ---------------- unterumarmung wrote:
I don't think we need to use Doxygen style comments in the private (non-API) code. Also I don't think we need comments for the code that is self-documenting. https://github.com/llvm/llvm-project/pull/222159 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
