summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/abseil
Commit message (Collapse)AuthorAgeFilesLines
* NFC: Fix trivial typos in commentsKazuaki Ishizaki2020-01-042-2/+2
|
* [NFC] Refactor representation of materialized temporariesTyker2019-11-191-1/+1
| | | | | | | | | | | | | | | Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718 Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: thakis, sammccall, ilya-biryukov, rnkovacs, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69360
* Revert "[NFC] Refactor representation of materialized temporaries"Nico Weber2019-11-171-1/+1
| | | | | | This reverts commit 08ea1ee2db5f9d6460fef1d79d0d1d1a5eb78982. It broke ./ClangdTests/FindExplicitReferencesTest.All on the bots, see comments on https://reviews.llvm.org/D69360
* [NFC] Refactor representation of materialized temporariesTyker2019-11-161-1/+1
| | | | | | | | | | | | | | | Summary: this patch refactor representation of materialized temporaries to prevent an issue raised by rsmith in https://reviews.llvm.org/D63640#inline-612718 Reviewers: rsmith, martong, shafik Reviewed By: rsmith Subscribers: rnkovacs, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69360
* Fix typo. "piont" => "point"Richard Trieu2019-08-201-1/+1
| | | | | | Found by Chris Morris (cwmorris). llvm-svn: 369316
* [clang-tools-extra] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-1/+1
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368944
* Enhance abseil-faster-strsplit-delimiter to handle other non-printable ↵Dmitri Gribenko2019-07-091-8/+16
| | | | | | | | | | | | | | | | | | | | | | | | | characters. Summary: Currently it fails on cases like '\001'. Note: Since `StringLiteral::outputString` dumps most nonprintable characters in octal value, the exact string literal format isn't preserved, e.g. `"\x01"` becomes `'\001'`. Reviewers: gribozavr Reviewed By: gribozavr Subscribers: lebedev.ri, Eugene.Zelenko, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64151 Patch by Xiaoyi Zhang. llvm-svn: 365463
* [clang-tidy] Made abseil-faster-strsplit-delimiter tests pass on C++17Dmitri Gribenko2019-06-131-18/+9
| | | | | | | | | | | | | | | | Reviewers: hokein, gribozavr Reviewed By: hokein, gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63253 Patch by Johan Vikström. llvm-svn: 363273
* [clang-tidy] Fixed abseil-time-subtraction to work on C++17Dmitri Gribenko2019-06-131-16/+35
| | | | | | | | | | | | | | | | Summary: Fixed abseil-time-subtraction to work on C++17 Reviewers: hokein, gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63261 Patch by Johan Vikström. llvm-svn: 363272
* [clang-tidy] Made abseil-upgrade-duration-conversions tests pass on c++17Dmitri Gribenko2019-06-131-8/+16
| | | | | | | | | | | | | | | | | | Summary: Made abseil-upgrade-duration-conversions tests pass on c++17 Reviewers: hokein, gribozavr Reviewed By: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63262 Patch by Johan Vikström. llvm-svn: 363270
* [clang-tidy] Fixed abseil-duration-unnecessary-conversion tests for c++17Dmitri Gribenko2019-06-131-3/+2
| | | | | | | | | | | | | | | | | | Summary: Fixed abseil-duration-unnecessary-conversion tests for c++17 Reviewers: hokein, gribozavr Reviewed By: gribozavr Subscribers: xazax.hun, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63263 Patch by Johan Vikström. llvm-svn: 363263
* [clang-tidy] Move all checks to the new registerPPCallbacks APIAlexander Kornienko2019-03-222-6/+6
| | | | llvm-svn: 356796
* [clang-tidy] Add additional patterns to the ↵Hyrum Wright2019-03-141-6/+30
| | | | | | | | abseil-duration-unnecessary-conversion check. Differential Revision: https://reviews.llvm.org/D59183 llvm-svn: 356141
* [clang-tidy] Add the abseil-time-compare checkHyrum Wright2019-03-116-8/+114
| | | | | | | | | This is an analog of the abseil-duration-comparison check, but for the absl::Time domain. It has a similar implementation and tests. Differential Revision: https://reviews.llvm.org/D58977 llvm-svn: 355835
* [clang-tidy] NFC: Negate the name and semantics of the isNotInMacro function.Hyrum Wright2019-03-085-10/+9
| | | | | | | This function is always used in a context where its result was also negated, which made for confusing naming and code. llvm-svn: 355702
* [clang-tidy] Add the abseil-time-subtraction checkHyrum Wright2019-02-276-0/+285
| | | | | | Differential Revision: https://reviews.llvm.org/D58137 llvm-svn: 355024
* [clang-tidy] Add the abseil-duration-unnecessary-conversion checkHyrum Wright2019-02-044-0/+97
| | | | | | Differential Revision: https://reviews.llvm.org/D57353 llvm-svn: 353079
* [clang-tidy] Rename time lookup functions; NFCHyrum Wright2019-02-023-7/+7
| | | | llvm-svn: 352964
* [clang-tidy] Fix a build error.Haojian Wu2019-01-281-1/+1
| | | | llvm-svn: 352364
* [clang-tidy] Add the abseil-duration-addition checkHyrum Wright2019-01-286-0/+162
| | | | | | Differential Revision: https://reviews.llvm.org/D57185 llvm-svn: 352362
* [clang-tidy] Rename the absl duration helper functions; NFCHyrum Wright2019-01-246-15/+17
| | | | llvm-svn: 352088
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1930-120/+90
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [clang-tidy] Add abseil-duration-conversion-cast checkHyrum Wright2019-01-174-0/+125
| | | | | | Differential Revision: https://reviews.llvm.org/D56532 llvm-svn: 351473
* [clang-tidy] Move the macro helper function to a common location; NFCHyrum Wright2019-01-163-22/+24
| | | | | | This is useful for multiple checks. llvm-svn: 351348
* [clang-tidy] Use the public hasInit matcher, rather than defining our own, NFCHyrum Wright2019-01-071-21/+7
| | | | llvm-svn: 350526
* [clang-tidy] Export the abseil duration inverse lookup function, NFCHyrum Wright2018-12-282-2/+7
| | | | | | This allows other tools to use this function. llvm-svn: 350133
* [clang-tidy] Be more liberal about literal zeroes in abseil checksHyrum Wright2018-12-212-6/+40
| | | | | | | | | Summary: Previously, we'd only match on literal floating or integral zeroes, but I've now also learned that some users spell that value as int{0} or float{0}, which also need to be matched. Differential Revision: https://reviews.llvm.org/D56012 llvm-svn: 349953
* [clang-tidy] Diagnose abseil-duration-comparison on macro argumentsHyrum Wright2018-12-194-20/+31
| | | | | | | | | | | | Summary: This change relaxes the requirements on the utility `rewriteExprFromNumberToDuration` function, and introduces new checking inside of the `abseil-duration-comparison` check to allow macro argument expression transformation. Differential Revision: https://reviews.llvm.org/D55784 llvm-svn: 349636
* [clang-tidy] Add the abseil-duration-subtraction checkHyrum Wright2018-12-137-116/+215
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This check uses the context of a subtraction expression as well as knowledge about the Abseil Time types, to infer the type of the second operand of some subtraction expressions in Duration conversions. For example: absl::ToDoubleSeconds(duration) - foo can become absl::ToDoubleSeconds(duration - absl::Seconds(foo)) This ensures that time calculations are done in the proper domain, and also makes it easier to further deduce the types of the second operands to these expressions. Reviewed By: JonasToth Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D55245 llvm-svn: 349073
* Use the standard Duration factory matcherJonas Toth2018-12-111-4/+2
| | | | | | | | | | | | | | | | | | Summary: A new check came in over the weekend; it should use our existing infrastructure for matching `absl::Duration` factories. Patch by hwright. Reviewers: JonasToth Reviewed By: JonasToth Subscribers: astrelni Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D55541 llvm-svn: 348842
* [clang-tidy]: Abseil: new check 'abseil-upgrade-duration-conversions'Eric Fiselier2018-12-074-0/+202
| | | | | | | | | | | | | Patch by Alex Strelnikov. Reviewed as D53830 Introduce a new check to upgrade user code based on upcoming API breaking changes to absl::Duration. The check finds calls to arithmetic operators and factory functions for absl::Duration that rely on an implicit user defined conversion to int64_t. These cases will no longer compile after proposed changes are released. Suggested fixes explicitly cast the argument int64_t. llvm-svn: 348633
* [clang-tidy] Fix unordered_map failure with specializing std::hash<> and ↵Jonas Toth2018-12-032-2/+20
| | | | | | remove previous wrong attempt at doing so llvm-svn: 348172
* [clang-tidy] Recommit: Add the abseil-duration-comparison checkJonas Toth2018-12-038-93/+422
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This check finds instances where Duration values are being converted to a numeric value in a comparison expression, and suggests that the conversion happen on the other side of the expression to a Duration. See documentation for examples. This also shuffles some code around so that the new check may perform in sone step simplifications also caught by other checks. Compilation is unbroken, because the hash-function is now directly specified for std::unordered_map, as 'enum class' does not compile as key (seamingly only on some compilers). Patch by hwright. Reviewers: aaron.ballman, JonasToth, alexfh, hokein Reviewed By: JonasToth Subscribers: sammccall, Eugene.Zelenko, xazax.hun, cfe-commits, mgorny Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D54737 llvm-svn: 348169
* Revert "[clang-tidy] Add the abseil-duration-comparison check"Jonas Toth2018-12-038-421/+93
| | | | | | This commit broke buildbots and needs adjustments. llvm-svn: 348165
* [clang-tidy] Add the abseil-duration-comparison checkJonas Toth2018-12-038-93/+421
| | | | | | | | | | | | | | | | | | | | | Summary: This check finds instances where Duration values are being converted to a numeric value in a comparison expression, and suggests that the conversion happen on the other side of the expression to a Duration. See documentation for examples. This also shuffles some code around so that the new check may perform in sone step simplifications also caught by other checks. Patch by hwright. Reviewers: aaron.ballman, JonasToth, alexfh, hokein Reviewed By: JonasToth Subscribers: sammccall, Eugene.Zelenko, xazax.hun, cfe-commits, mgorny Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D54737 llvm-svn: 348161
* Add the abseil-duration-factory-scale check.Aaron Ballman2018-11-184-0/+311
| | | | | | | | This check removes unneeded scaling of arguments when calling Abseil Time factory functions. Patch by Hyrum Wright. llvm-svn: 347163
* [clant-tidy] abseil: Add clangTooling to CMakeLists.txtHeejin Ahn2018-10-241-0/+1
| | | | | | Without this, builds with `-DBUILD_SHARED_LIBS=ON` fail. llvm-svn: 345191
* [clang-tidy] Add the abseil-duration-factory-float checkJonas Toth2018-10-244-0/+148
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This check finds cases where calls to an absl::Duration factory could use the more efficient integer overload. For example: // Original - Providing a floating-point literal. absl::Duration d = absl::Seconds(10.0); // Suggested - Use an integer instead. absl::Duration d = absl::Seconds(10); Patch by hwright. Reviewers: alexfh, hokein, aaron.ballman, JonasToth Reviewed By: hokein, JonasToth Subscribers: zturner, xazax.hun, Eugene.Zelenko, mgorny, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D53339 llvm-svn: 345167
* [Clang-tidy] Alphabetical sort of files/checks. Add space after clang-tidy ↵Eugene Zelenko2018-09-202-3/+3
| | | | | | in source code headers. llvm-svn: 342601
* [clang-tidy] Abseil: Add more directories that are slated for future absl ↵Benjamin Kramer2018-09-121-3/+4
| | | | | | expansion. llvm-svn: 342041
* [clang-tidy] Insert absl::StrAppend when replacing StrCat.Benjamin Kramer2018-09-111-1/+1
| | | | | | | There might be no using decl for StrAppend around, inserting the qualified name is less likely to break things. llvm-svn: 341929
* [clang-tidy] Add a missing comma after "flags"Benjamin Kramer2018-09-111-14/+5
| | | | llvm-svn: 341925
* [clang-tidy] Abseil: Allow macros inside of absl to use internal absl thingsBenjamin Kramer2018-09-071-1/+1
| | | | llvm-svn: 341643
* [clang-tidy] minor bug fix to AbseilMatcher.hEric Liu2018-09-051-4/+13
| | | | | | | | | | | | | This missing directory is not yet released, but is causing some problems internally. It's gonna be released eventually and received permission to include it here. This matcher will also be periodically updated by my team as we have more releases and or problems internally. Patch by Hugo Gonzalez! Differential Revision: https://reviews.llvm.org/D51699 llvm-svn: 341488
* [clang-tidy] Use simple string matching instead of RegexKirill Bobyrev2018-08-301-10/+20
| | | | | | | | | | | Instead of parsing and compiling the `llvm::Regex` each time, it's faster to use basic string matching for filename prefix check. Reviewed by: hokein Differential Revision: https://reviews.llvm.org/D51360 llvm-svn: 341061
* [clang-tidy] Add abseil-no-internal-dependencies checkJonas Toth2018-08-294-0/+88
| | | | | | | | | | | Finds instances where the user depends on internal details and warns them against doing so. Should not be run on internal Abseil files or Abseil source code. Patch by hugoeg! Differential Revision: https://reviews.llvm.org/D50542 llvm-svn: 340928
* Introduce the abseil-redundant-strcat-calls check.Aaron Ballman2018-08-294-0/+183
| | | | | | This flags redundant calls to absl::StrCat where the result is being passed to another call to absl::StrCat or absl::StrAppend. Patch by Hugo Gonzalez and Samuel Benzaquen. llvm-svn: 340918
* Introduce the abseil-str-cat-append check.Aaron Ballman2018-08-294-0/+142
| | | | | | This flags uses of absl::StrCat when absl::StrAppend should be used instead. Patch by Hugo Gonzalez and Benjamin Kramer. llvm-svn: 340915
* [clang-tidy] Abseil: no namepsace checkHaojian Wu2018-08-285-0/+132
| | | | | | | | | | This check ensures that users of Abseil do not open namespace absl in their code, as that violates our compatibility guidelines. AbseilMatcher.h written by Hugo Gonzalez. Patch by Deanna Garcia! llvm-svn: 340800
* [clang-tidy] Abseil: faster strsplit delimiter checkHaojian Wu2018-08-224-0/+171
| | | | | | | | | | | This check is an abseil specific check that checks for code using single character string literals as delimiters and transforms the code into characters. The check was developed internally and has been running at google, this is just a move to open source the check. It was originally written by @sbenza. Patch by Deanna Garcia! llvm-svn: 340411
OpenPOWER on IntegriCloud