summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/ClangTidy.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Make format style customizableJonas Devlieghere2016-11-301-6/+6
| | | | | | | | | | | | | | Summary: I came across an outstanding FIXME to make the format style customizable. Inspired by the include fixer, I added an new option `-style` to configure the fallback style in case no clang-format configuration file is found. The default remains "llvm". Reviewers: Prazek, aaron.ballman, hokein, alexfh Subscribers: cfe-commits, malcolm.parsons Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D27142 llvm-svn: 288258
* Use AnalyzerOptions::getRegisteredCheckers() instead of ↵Alexander Kornienko2016-11-081-40/+30
| | | | | | | | | | | | | | clang/StaticAnalyzer/Checkers/Checkers.inc Summary: Depends on D26310. Reviewers: zaks.anna, hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26311 llvm-svn: 286219
* [clang-tidy] Clean up code after applying replacements.Alexander Kornienko2016-10-171-24/+79
| | | | | | | | | | | | | | | Summary: Remove empty namespaces and initializer list commas / colons in affected ranges. Initial patch: proper options for enabling the cleanup and specifying the format style are needed. Reviewers: hokein, ioeric Subscribers: beanz, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D24572 llvm-svn: 284399
* [clang-tidy] Fix the order of ExtraArgsBeforeAlexander Kornienko2016-08-231-4/+8
| | | | | | Added tests for the relative order of -extra-arg(-before) and ExtraArgs(Before). llvm-svn: 279516
* Fix clang-tidy crash when a single fix is applied on multiple files.Eric Liu2016-08-091-24/+32
| | | | | | | | | | | | | | | Summary: tooling::Replacements only holds replacements for a single file, so this patch makes Fix a map from file paths to tooling::Replacements so that it can be applied on multiple files. Reviewers: hokein, alexfh Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D23257 llvm-svn: 278101
* Reapply r276973 "Adjust Registry interface to not require plugins to export ↵John Brawn2016-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a registry" This differs from the previous version by being more careful about template instantiation/specialization in order to prevent errors when building with clang -Werror. Specifically: * begin is not defined in the template and is instead instantiated when Head is. I think the warning when we don't do that is wrong (PR28815) but for now at least do it this way to avoid the warning. * Instead of performing template specializations in LLVM_INSTANTIATE_REGISTRY instead provide a template definition then do explicit instantiation. No compiler I've tried has problems with doing it the other way, but strictly speaking it's not permitted by the C++ standard so better safe than sorry. Original commit message: Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. llvm-svn: 277806
* Revert r276973 "Adjust Registry interface to not require plugins to export a ↵John Brawn2016-07-281-1/+1
| | | | | | | | | registry" Buildbot failures when building with clang -Werror. Reverting while I try to figure this out. llvm-svn: 277008
* Reapply r276856 "Adjust Registry interface to not require plugins to export ↵John Brawn2016-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | a registry" This version has two fixes compared to the original: * In Registry.h the template static members are instantiated before they are used, as clang gives an error if you do it the other way around. * The use of the Registry template in clang-tidy is updated in the same way as has been done everywhere else. Original commit message: Currently the Registry class contains the vestiges of a previous attempt to allow plugins to be used on Windows without using BUILD_SHARED_LIBS, where a plugin would have its own copy of a registry and export it to be imported by the tool that's loading the plugin. This only works if the plugin is entirely self-contained with the only interface between the plugin and tool being the registry, and in particular this conflicts with how IR pass plugins work. This patch changes things so that instead the add_node function of the registry is exported by the tool and then imported by the plugin, which solves this problem and also means that instead of every plugin having to export every registry they use instead LLVM only has to export the add_node functions. This allows plugins that use a registry to work on Windows if LLVM_EXPORT_SYMBOLS_FOR_PLUGINS is used. llvm-svn: 276973
* Unbreak extra tools build post r275882.Benjamin Kramer2016-07-181-0/+1
| | | | llvm-svn: 275886
* Fix include path in ClangTidy.cpp.Stephen Hines2016-04-281-1/+1
| | | | | | | | | | | | | | Summary: https://llvm.org/bugs/show_bug.cgi?id=27355 To compile with other binary output directory structures in build systems like Android. Reviewers: srhines, alexfh Subscribers: tberghammer, danalbert, cfe-commits Differential Revision: http://reviews.llvm.org/D19249 llvm-svn: 267835
* [clang-tidy] filter plugins and plugin arguments of the command-lineEtienne Bergeron2016-04-061-16/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch remove the plugin argument from the command-line. Loading plugins was making clang-tidy to fail when running over chromium (linux). Example of a command-line executed when running clang-tidy over chromium (from the compilation database). ``` ../../third_party/llvm-build/Release+Asserts/bin/clang++ -MMD -MF obj/third_party/WebKit/Source/core/fetch/webcore_shared.Resource.o.d -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -D_FILE_OFFSET_BITS=64 -DCHROMIUM_BUILD -DCR_CLANG_REVISION=264915-1 -DCOMPONENT_BUILD -DUI_COMPOSITOR_IMAGE_TRANSPORT -DUSE_AURA=1 -DUSE_PANGO=1 -DUSE_CAIRO=1 -DUSE_DEFAULT_RENDER_THEME=1 -DUSE_LIBJPEG_TURBO=1 -DUSE_X11=1 -DUSE_CLIPBOARD_AURAX11=1 -DENABLE_WEBRTC=1 -DENABLE_MEDIA_ROUTER=1 -DENABLE_PEPPER_CDMS -DENABLE_NOTIFICATIONS -DENABLE_TOPCHROME_MD=1 -DUSE_UDEV -DFIELDTRIAL_TESTING_ENABLED -DENABLE_TASK_MANAGER=1 -DENABLE_EXTENSIONS=1 -DENABLE_PDF=1 -DENABLE_PLUGINS=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_THEMES=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_MDNS=1 -DENABLE_SERVICE_DISCOVERY=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DBLINK_CORE_IMPLEMENTATION=1 -DBLINK_IMPLEMENTATION=1 -DINSIDE_BLINK -DGL_GLEXT_PROTOTYPES -DMOJO_USE_SYSTEM_IMPL -DCHROME_PNG_WRITE_SUPPORT -DPNG_USER_CONFIG -DENABLE_LAYOUT_UNIT_IN_INLINE_BOXES=0 -DENABLE_OILPAN=1 -DWTF_USE_CONCATENATED_IMPULSE_RESPONSES=1 -DENABLE_INPUT_MULTIPLE_FIELDS_UI=1 -DWTF_USE_ICCJPEG=1 -DWTF_USE_QCMSLIB=1 -DWTF_USE_WEBAUDIO_FFMPEG=1 -DWTF_USE_DEFAULT_RENDER_THEME=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_NOEXCEPT= -DSKIA_DLL -DGR_GL_IGNORE_ES3_MSAA=0 -DSK_SUPPORT_GPU=1 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DLIBXML_STATIC -DLIBXSLT_STATIC -DV8_SHARED -DUSING_V8_SHARED -DUSE_LIBPCI=1 -DUSE_OPENSSL=1 -DUSE_GLIB=1 -DUSE_NSS_CERTS=1 -DUSE_NSS_VERIFIER=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -D_DEBUG -D_GLIBCXX_DEBUG=1 -Igen -I../../third_party/WebKit/Source -Igen/blink -I../../third_party/WebKit -I../../third_party/WebKit/Source/core/testing -I../../third_party/WebKit/Source/core/testing/v8 -I../.. -I../../skia/config -I../../third_party/khronos -I../../gpu -Igen/angle -I../../third_party/angle/include -I../../third_party/ffmpeg -Igen/third_party/WebKit -I../../third_party/iccjpeg -I../../third_party/libpng -I../../third_party/libwebp -I../../third_party/ots/include -I../../third_party/zlib -I../../third_party/libjpeg_turbo -I../../third_party/icu/source/i18n -I../../third_party/icu/source/common -I../../skia/ext -I../../third_party/skia/include/core -I../../third_party/skia/include/effects -I../../third_party/skia/include/pdf -I../../third_party/skia/include/gpu -I../../third_party/skia/include/lazy -I../../third_party/skia/include/pathops -I../../third_party/skia/include/pipe -I../../third_party/skia/include/ports -I../../third_party/skia/include/utils -I../../third_party/libxml/linux/include -I../../third_party/libxml/src/include -I../../third_party/libxslt -I../../third_party/npapi -I../../third_party/npapi/bindings -I../../third_party/qcms/src -I../../third_party/snappy/linux -I../../third_party/snappy/src -I../../v8/include -fstack-protector --param=ssp-buffer-size=4 -Werror -pthread -fno-strict-aliasing -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -fvisibility=hidden -pipe -fPIC -Xclang -load -Xclang /home/etienneb/chromium/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion -fcolor-diagnostics -B/home/etienneb/chromium/src/third_party/binutils/Linux_x64/Release/bin -Wheader-hygiene -Wno-char-subscripts -Wno-unneeded-internal-declaration -Wno-covered-switch-default -Wstring-conversion -Wno-c++11-narrowing -Wno-deprecated-register -Wno-inconsistent-missing-override -Wno-shift-negative-value -Wglobal-constructors -Wexit-time-destructors -fno-strict-aliasing -Xclang -load -Xclang /home/etienneb/chromium/src/third_party/llvm-build/Release+Asserts/lib/libBlinkGCPlugin.so -Xclang -add-plugin -Xclang blink-gc-plugin -Xclang -plugin-arg-blink-gc-plugin -Xclang enable-oilpan -Xclang -plugin-arg-blink-gc-plugin -Xclang warn-raw-ptr -pthread -I/home/etienneb/chromium/src/build/linux/debian_wheezy_amd64-sysroot/usr/include/glib-2.0 -I/home/etienneb/chromium/src/build/linux/debian_wheezy_amd64-sysroot/usr/lib/x86_64-linux-gnu/glib-2.0/include -m64 -march=x86-64 --sysroot=/home/etienneb/chromium/src/build/linux/debian_wheezy_amd64-sysroot -O0 -g -funwind-tables -gsplit-dwarf -g0 -fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -c ../../third_party/WebKit/Source/core/fetch/Resource.cpp -o obj/third_party/WebKit/Source/core/fetch/webcore_shared.Resource.o ``` The plugins are added with the following arguments: ``` -Xclang -load -Xclang /home/etienneb/chromium/src/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so -Xclang -add-plugin -Xclang find-bad-constructs -Xclang -plugin-arg-find-bad-constructs -Xclang check-templates -Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion ``` Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18806 llvm-svn: 265542
* [clang-tidy] Skip reporting of not applicable fixes.Etienne Bergeron2016-03-221-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Invalid source location are causing clang-tidy to crash when manipulating an invalid file. Macro definitions on the command line have locations in a virtual buffer and therefore don't have a corresponding valid FilePath. A recent patch added path conversion to absolute path. As the FilePath may now be empty, the result of makeAbsolutePath may incorrectly be the folder WorkingDir. The crash occurs in getLocation which is not able to find the appropriate FileEntry (null pointer). ``` SmallString<128> FixAbsoluteFilePath = Fix.getFilePath(); Files.makeAbsolutePath(FixAbsoluteFilePath); FixLoc = getLocation(FixAbsoluteFilePath, Fix.getOffset()); ``` With relative path, the code was not crashing because getLocation was skipping empty path. Example of code: ``` int main() { return X; } ``` With the given command-line: ``` clang-tidy test.cc --checks=misc-macro-* -- -DX=0+0 ``` Reviewers: alexfh, aaron.ballman Subscribers: aaron.ballman, cfe-commits Differential Revision: http://reviews.llvm.org/D18262 llvm-svn: 264073
* [clang-tidy] Fix a crash issue when clang-tidy runs with compilation database.Haojian Wu2016-02-261-2/+32
| | | | | | | | | | | | | | | | | | | | | Summary: The clang-tidy will trigger an assertion if it's not in the building directory. TEST: cd <llvm-repo>/ ./build/bin/clang-tidy --checks=-*,modernize-use-nullptr -p build tools/clang/tools/extra/clang-tidy/ClangTidy.cpp The crash issue is gone after applying this patch. Fixes PR24834, PR26241 Reviewers: bkramer, alexfh Subscribers: rizsotto.mailinglist, cfe-commits Differential Revision: http://reviews.llvm.org/D17335 llvm-svn: 261991
* [clang-tdiy] Add header file extension configuration support.Haojian Wu2016-02-051-1/+13
| | | | | | | | | | | | Summary: * Add a `HeaderFileExtensions` check option in misc-definitions-in-headers, google-build-namespaces and google-global-names-in-headers. Reviewers: aaron.ballman, alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D16113 llvm-svn: 259879
* Teach clang-tidy how to upgrade warnings into errors.Jonathan Roelofs2016-01-131-3/+15
| | | | | | | | | Similar in format to the `-checks=` argument, this new `-warnings-as-errors=` argument upgrades any warnings emitted by the former to errors. http://reviews.llvm.org/D15528 llvm-svn: 257642
* [clang-tidy] Test commit (playing with git-svn)Alexander Kornienko2015-11-161-3/+2
| | | | llvm-svn: 253203
* [clang-tidy] Remove unused #includes.Alexander Kornienko2015-11-131-2/+0
| | | | | | | | | | Summary: Testing Phab with git-svn Reviewers: alexfh Differential Revision: http://reviews.llvm.org/D14649 llvm-svn: 253036
* Add ExtraArgs and ExtraArgsBefore options to enable clang warnings via ↵Alexander Kornienko2015-11-091-0/+14
| | | | | | | | | | | | | | configuration files. Summary: This patch depends on http://reviews.llvm.org/D14191 Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D14192 llvm-svn: 252485
* Make a bunch of static arrays const.Craig Topper2015-10-181-1/+1
| | | | llvm-svn: 250641
* [clang-tidy] Static Analyzer checker configuration options pass-through.Gabor Horvath2015-03-111-0/+12
| | | | | | | | Reviewed by: Alexander Kornienko Differential Revision: http://reviews.llvm.org/D8164 llvm-svn: 231941
* Add flag --enable-check-profile to clang-tidy.Samuel Benzaquen2014-10-231-2/+10
| | | | | | | | | | | | | | | Summary: Add flag --enable-check-profile to clang-tidy. It turns on per-matcher profiles in MatchFinder and prints a report to stderr at the end. Reviewers: alexfh Subscribers: curdeius, cfe-commits Differential Revision: http://reviews.llvm.org/D5937 llvm-svn: 220491
* Implemented clang-tidy-check-specific options.Alexander Kornienko2014-09-121-9/+41
| | | | | | | | | | | | | | | | | Summary: Each check can implement readOptions and storeOptions methods to read and store custom options. Each check's options are stored in a local namespace to avoid name collisions and provide some sort of context to the user. Reviewers: bkramer, klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5296 llvm-svn: 217661
* Implemented clang-tidy configurability via .clang-tidy files.Alexander Kornienko2014-09-041-6/+8
| | | | | | | | | | | | | | | | | Summary: This adds a support for the .clang-tidy file reading using FileOptionsProvider, -dump-config option, and changes tests to not depend on default checks set. Reviewers: klimek, bkramer, djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5186 llvm-svn: 217155
* [clang-tidy] Add an option to export suggested fixes into a file.Benjamin Kramer2014-09-041-0/+12
| | | | | | | | Allows gathering fixes and applying them with clang-apply-fixes. Differential Revision: http://reviews.llvm.org/D5176 llvm-svn: 217139
* Adjust call 'CreateAnalysisConsumer' due to API tweak.Ted Kremenek2014-08-271-3/+1
| | | | llvm-svn: 216551
* Recommit 213308: unique_ptr-ify ownership of ASTConsumers (reverted in r213324)David Blaikie2014-08-101-13/+14
| | | | | | | | After post-commit review and community discussion, this seems like a reasonable direction to continue, making ownership semantics explicit in the source using the type system. llvm-svn: 215324
* Rename ChecksFilter to GlobList, as there's nothing specific to checks in it.Alexander Kornienko2014-08-061-6/+6
| | | | | | | | | | | | | | | | | | Summary: Rename ChecksFilter to GlobList, as there's nothing specific to checks in it. It's a rather generic way to represent sets of strings (or patterns), so it may be used for something else in ClangTidy. The new name would not look strange when used to filter other entities. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4806 llvm-svn: 214961
* Plug memory leaks.Benjamin Kramer2014-07-241-5/+5
| | | | | | | Most of the changes are mechanic std::unique_ptr insertions. All leaks were detected by LeakSanitizer. llvm-svn: 213851
* Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie2014-07-171-14/+13
| | | | | | | | | This reverts commit r213308. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. llvm-svn: 213324
* unique_ptr-ify ownership of ASTConsumersDavid Blaikie2014-07-171-13/+14
| | | | llvm-svn: 213308
* Set up clang-tidy diagnostic consumer to print types etc.Alexander Kornienko2014-07-141-0/+1
| | | | | | | | | | | | Reviewers: bkramer Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4494 llvm-svn: 212941
* clang-tidy: Instantiate llvm::Registry<clang::tidy::ClangTidyModule>.NAKAMURA Takumi2014-07-031-0/+2
| | | | llvm-svn: 212271
* Consistently handle clang-tidy check names in ClangTidyError.Alexander Kornienko2014-07-021-26/+27
| | | | | | | | | | | | | | | | | | | Summary: This patch removes " [check-name]" from the end of ClangTidyMessage::Message. The " [check-name]" part is only appended when printing diagnostics on the console. Clang errors are now marked with "clang-diagnostic-error" check name, remarks and unknown warnings are marked with "clang-diagnostic-unknown". Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4356 llvm-svn: 212180
* [C++11] Use 'nullptr'.Craig Topper2014-06-091-1/+1
| | | | llvm-svn: 210447
* Allow per-file clang-tidy options.Alexander Kornienko2014-06-051-35/+49
| | | | | | | | | | | | | | | | | | Summary: This patch makes it possible for clang-tidy clients to provide different options for different translation units. The option, which doesn't make sense to be file-dependent, was moved to a separate ClangTidyGlobalOptions struct. Added parsing of ClangTidyOptions. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3979 llvm-svn: 210260
* Never filter-out compile errors in clang-tidy, display them as errors.Alexander Kornienko2014-06-021-2/+3
| | | | | | | | | | | | | | | | | | Summary: No filters should affect the display of errors. Fixed a few tests, which had compile errors. We need to think what we should do with mapped errors (-Werror). Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3982 llvm-svn: 210044
* Renamed runClangTidy argument Ranges to InputFiles, removed a TODO comment.Alexander Kornienko2014-05-281-4/+2
| | | | | | No functional changes. llvm-svn: 209743
* Store Errors inside ClangTidyContext instead of just pointer to an externalAlexander Kornienko2014-05-091-6/+5
| | | | | | | | | | | | | | | array. This simplifies usage of ClangTidyContext a bit and seems to be more consistent. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3685 llvm-svn: 208407
* Print stats on displayed and ignored warnings.Alexander Kornienko2014-05-071-4/+5
| | | | | | | | | | | | | | | | Summary: Also displays a hint to use -header-filter='.*' in case any warnings are in non-user code. This will help discoverability of this option. Reviewers: klimek Reviewed By: klimek Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3621 llvm-svn: 208174
* Add a clang-tidy flag to support temporary destructor-aware analysis ↵Alex McCarthy2014-04-301-12/+18
| | | | | | | | | | | | (workaround for bug 15599). Reviewers: alexfh Subscribers: jordan_rose, klimek, djasper, cfe-commits Differential Revision: http://reviews.llvm.org/D3556 llvm-svn: 207652
* Add ClangTidyOptions to encapsulate all clang-tidy options.Alexander Kornienko2014-04-291-7/+4
| | | | | | | | | | | | Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3544 llvm-svn: 207532
* ClangTidy.cpp: Don't use non-static member initializer, for msc17.NAKAMURA Takumi2014-03-271-3/+3
| | | | llvm-svn: 204931
* Output messages when clang-tidy applies fix-its.Alexander Kornienko2014-03-271-49/+85
| | | | | | | | | | | | Reviewers: djasper, klimek Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3192 llvm-svn: 204909
* Post-filter clang-tidy diagnostic messages.Alexander Kornienko2014-03-201-21/+13
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch implements filtering of clang-tidy diagnostic messages by the check name, so that "clang-tidy -checks=^llvm-" won't output any clang warnings, for example. This is also helpful to run specific static-analyzer checks: static analyzer always needs core checks to be enabled, but the user may be interested only in the checks he asked for. This patch also exposes warning option names for built-in diagnostics. We need to have a namespace for these names to avoid collisions and to allow convenient filtering, so I prefix them with "-W". I'm not sure it's the best thing to do, and maybe "W" or "clang-diagnostic-" or something like this would be better. Reviewers: klimek Reviewed By: klimek CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3121 llvm-svn: 204321
* [C++11] Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-091-1/+1
| | | | | | | | This removes all references to OwningPtr, which should be fairly undisruptive to out-of-tree projects since they are unlikely to use clang-tools-extra as a library instead of a set of tools. llvm-svn: 203382
* Use the appropriate operator<< instead of addRanges.Alexander Kornienko2014-03-061-14/+6
| | | | llvm-svn: 203118
* Use range-based for loops for better readability. No functional changes ↵Alexander Kornienko2014-03-061-64/+40
| | | | | | | | | | | | | | intended. Reviewers: chandlerc Reviewed By: chandlerc CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2979 llvm-svn: 203101
* Fixed formatting.Alexander Kornienko2014-03-051-3/+1
| | | | llvm-svn: 202969
* Determine support for colored output from stdout instead of stderr since ↵Craig Topper2014-03-031-1/+1
| | | | | | that's where the diagnostics go. llvm-svn: 202680
* Add a level parameter to ClangTidyCheck::diag.Peter Collingbourne2014-03-021-2/+3
| | | | | | | | | The goal is to make it possible for checks to emit diagnostics at levels other than 'warning'. Differential Revision: http://llvm-reviews.chandlerc.com/D2913 llvm-svn: 202668
OpenPOWER on IntegriCloud