Author: alexfh Date: Mon Aug 22 12:19:23 2016 New Revision: 279442 URL: http://llvm.org/viewvc/llvm-project?rev=279442&view=rev Log: [clang-tidy docs] Further cleanup of options
Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-nullptr.rst clang-tools-extra/trunk/docs/clang-tidy/checks/performance-faster-string-find.rst clang-tools-extra/trunk/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst?rev=279442&r1=279441&r2=279442&view=diff ============================================================================== --- clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst (original) +++ clang-tools-extra/trunk/docs/clang-tidy/checks/cppcoreguidelines-pro-type-member-init.rst Mon Aug 22 12:19:23 2016 @@ -24,13 +24,14 @@ types without a user-provided constructo fix is to zero initialize the variable via ``{}`` for C++11 and beyond or ``= {}`` for older language versions. -IgnoreArrays option -------------------- +Options +------- -For performance critical code, it may be important to not zero -fixed-size array members. If on, IgnoreArrays will not warn about -array members that are not zero-initialized during construction. -IgnoreArrays is false by default. +.. option:: IgnoreArrays + + If set to non-zero, the check will not warn about array members that are not + zero-initialized during construction. For performance critical code, it may + be important to not initialize fixed-size array members. Default is `0`. This rule is part of the "Type safety" profile of the C++ Core Guidelines, corresponding to rule Type.6. See Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst?rev=279442&r1=279441&r2=279442&view=diff ============================================================================== --- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst (original) +++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-emplace.rst Mon Aug 22 12:19:23 2016 @@ -22,9 +22,9 @@ Before: std::vector<MyClass> v; v.push_back(MyClass(21, 37)); - std::vector<std::pair<int,int>> w; + std::vector<std::pair<int, int>> w; - w.push_back(std::pair<int,int>(21, 37)); + w.push_back(std::pair<int, int>(21, 37)); w.push_back(std::make_pair(21L, 37L)); After: @@ -34,7 +34,7 @@ After: std::vector<MyClass> v; v.emplace_back(21, 37); - std::vector<std::pair<int,int>> w; + std::vector<std::pair<int, int>> w; w.emplace_back(21, 37); // This will be fixed to w.push_back(21, 37); in next version w.emplace_back(std::make_pair(21L, 37L); @@ -80,9 +80,11 @@ other classes use the :option:`SmartPoin Check also fires if any argument of constructor call would be: -- bitfield (bitfields can't bind to rvalue/universal reference) -- ``new`` expression (to avoid leak) -or if the argument would be converted via derived-to-base cast. + + - bitfield (bitfields can't bind to rvalue/universal reference) + + - ``new`` expression (to avoid leak) or if the argument would be converted via + derived-to-base cast. This check requires C++11 of higher to run. Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-nullptr.rst URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-nullptr.rst?rev=279442&r1=279441&r2=279442&view=diff ============================================================================== --- clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-nullptr.rst (original) +++ clang-tools-extra/trunk/docs/clang-tidy/checks/modernize-use-nullptr.rst Mon Aug 22 12:19:23 2016 @@ -41,10 +41,9 @@ Options .. option:: UserNullMacros - By default this check will only replace the ``NULL`` macro and will skip any - user-defined macros that behaves like ``NULL``. The user can use the - :option:`UserNullMacros` option to specify a comma-separated list of macro - names that will be transformed along with ``NULL``. + Comma-separated list of macro names that will be transformed along with + ``NULL``. By default this check will only replace the ``NULL`` macro and will + skip any similar user-defined macros. Example ^^^^^^^ Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/performance-faster-string-find.rst URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/performance-faster-string-find.rst?rev=279442&r1=279441&r2=279442&view=diff ============================================================================== --- clang-tools-extra/trunk/docs/clang-tidy/checks/performance-faster-string-find.rst (original) +++ clang-tools-extra/trunk/docs/clang-tidy/checks/performance-faster-string-find.rst Mon Aug 22 12:19:23 2016 @@ -4,12 +4,8 @@ performance-faster-string-find ============================== Optimize calls to ``std::string::find()`` and friends when the needle passed is -a single character string literal. -The character literal overload is more efficient. - -By default only ``std::basic_string`` is considered. This list can be modified by -passing a `;` separated list of class names using the `StringLikeClasses` -option. The methods to consired are fixed, though. +a single character string literal. The character literal overload is more +efficient. Examples: @@ -20,3 +16,13 @@ Examples: // becomes str.find('A'); + +Options +------- + +.. option:: StringLikeClasses + + Semicolon-separated list of names of string-like classes. By default only + ``std::basic_string`` is considered. The list of methods to consired is + fixed. + Modified: clang-tools-extra/trunk/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst?rev=279442&r1=279441&r2=279442&view=diff ============================================================================== --- clang-tools-extra/trunk/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst (original) +++ clang-tools-extra/trunk/docs/clang-tidy/checks/readability-simplify-boolean-expr.rst Mon Aug 22 12:19:23 2016 @@ -3,7 +3,6 @@ readability-simplify-boolean-expr ================================= - Looks for boolean expressions involving boolean constants and simplifies them to use the appropriate boolean expression directly. @@ -73,9 +72,15 @@ Examples: ``struct X``, the conditional return ``if (x) return true; return false;`` becomes ``return static_cast<bool>(x);`` -When a conditional boolean return or assignment appears at the end of a -chain of ``if``, ``else if`` statements, the conditional statement is left -unchanged unless the option ``ChainedConditionalReturn`` or -``ChainedConditionalAssignment``, respectively, is specified as non-zero. -The default value for both options is zero. +Options +------- + +.. option:: ChainedConditionalReturn + + If non-zero, conditional boolean return statements at the end of an + ``if/else if`` chain will be transformed. Default is `0`. + +.. option:: ChainedConditionalAssignment + If non-zero, conditional boolean assignments at the end of an ``if/else + if`` chain will be transformed. Default is `0`. _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits