Commit Graph

1472 Commits

Author SHA1 Message Date
NAKAMURA Takumi 66b0a87ae8 clang-tidy/cppcoreguidelines/ProTypeMemberInitCheck.cpp: Use raw_string_ostream::str() to flush the buffer explicitly.
llvm-svn: 267290
2016-04-23 14:54:28 +00:00
Alexander Kornienko 5142c0d7fa [clang-tidy] Fix misc-macro-repeated-side-effects false positive with stringified arguments
llvm-svn: 267254
2016-04-23 00:00:08 +00:00
Eugene Zelenko 6cac934051 [Clang-tidy] Fix Clang warning in misc/StringConstructorCheck.h.
Using LLVM_ENABLE_WARNINGS=ON is good idea.

llvm-svn: 267228
2016-04-22 21:33:33 +00:00
Haojian Wu bee3c88ec6 [clang-tidy] fix link in Release Notes
Summary: This is intended to fix https://llvm.org/bugs/show_bug.cgi?id=27426

Patch by Kirill Bobyrev!

Reviewers: alexfh, LegalizeAdulthood, hokein

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19406

llvm-svn: 267155
2016-04-22 14:43:39 +00:00
NAKAMURA Takumi 70191d628f clangTidyReadabilityModule: Add clangTidyUtils in libdeps, corresponding to r267003.
llvm-svn: 267087
2016-04-22 00:33:39 +00:00
Etienne Bergeron 7e02656004 [clang-tidy] Fix broken build bot.
Summary:
There is a build bot that doesn't support 'constexpr'.

```
FAILED: C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe   /nologo /TP /DWIN32 /D_WINDOWS   /W4 -wd4141 -wd4146 -wd4180 -wd4244 -wd4258 -wd4267 -wd4291 -wd4345 -wd4351 -wd4355 -wd4456 -wd4457 -wd4458 -wd4459 -wd4503 -wd4624 -wd4722 -wd4800 -wd4100 -wd4127 -wd4512 -wd4505 -wd4610 -wd4510 -wd4702 -wd4245 -wd4706 -wd4310 -wd4701 -wd4703 -wd4389 -wd4611 -wd4805 -wd4204 -wd4577 -wd4091 -wd4592 -wd4319 -wd4324 -w14062 -we4238 /Zc:inline /Oi /Zc:rvalueCast /MD /O2 /Ob2 -Itools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc -ID:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\include -Itools\clang\include -Iinclude -ID:\buildslave\clang-x64-ninja-win7\llvm\include    -UNDEBUG  /EHs-c- /GR- /showIncludes -DCLANG_ENABLE_ARCMT -DCLANG_ENABLE_OBJC_REWRITER -DCLANG_ENABLE_STATIC_ANALYZER -DGTEST_HAS_RTTI=0 -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_DEBUG_POINTER_IMPL="" -D_GNU_SOURCE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS /Fotools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\SuspiciousStringCompareCheck.cpp.obj /Fdtools\clang\tools\extra\clang-tidy\misc\CMakeFiles\clangTidyMiscModule.dir\ /FS -c D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C2144: syntax error : 'char' should be preceded by ';'
D:\buildslave\clang-x64-ninja-win7\llvm\tools\clang\tools\extra\clang-tidy\misc\SuspiciousStringCompareCheck.cpp(25) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
ninja: build stopped: subcommand failed.
program finished with exit code 1
```

Reviewers: alexfh, sbenza

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19379

llvm-svn: 267027
2016-04-21 18:15:35 +00:00
Eugene Zelenko 656eb13fe0 [Release Notes] Mention Clang-tidy misc-string-constructor and misc-suspicious-string-compare checks.
Fix excessive line in misc-string-constructor documentation.

llvm-svn: 267026
2016-04-21 18:13:09 +00:00
Etienne Bergeron 1dbd582387 [clang-tidy] New checker to detect suspicious string constructor.
Summary:
Checker to validate string constructor parameters.

A common mistake is to swap parameter for the fill-constructor.
```
  std::string str('x', 4);
  std::string str('4', x);
```

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19146

llvm-svn: 267011
2016-04-21 17:28:08 +00:00
Etienne Bergeron bae829ede5 [clang-tidy] Add new checker for comparison with runtime string functions.
Summary:
This checker is validating suspicious usage of string compare functions.

Example:
```
  if (strcmp(...))       // Implicitly compare to zero
  if (!strcmp(...))      // Won't warn
  if (strcmp(...) != 0)  // Won't warn
```

This patch was checked over large amount of code.
There is three checks:
  [*] Implicit comparator to zero (coding-style, many warnings found),
  [*] Suspicious implicit cast to non-integral (bugs!?, almost none found),
  [*] Comparison to suspicious constant (bugs!?, found two cases),

Example:
[[https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c |
https://github.com/kylepjohnson/sigma/blob/master/sigma/native-installers/debian/dependencies/files/opt/sigma/E/HEURISTICS/che_to_precgen.c]]

```
      else if(strcmp(id, "select") == 0)
      {
         array->array[i].key1 = 25;
      }
      else if(strcmp(id, "sk") == 28)      // BUG!?
      {
         array->array[i].key1 = 20;
      }
```

Reviewers: alexfh

Subscribers: Eugene.Zelenko, cfe-commits

Differential Revision: http://reviews.llvm.org/D18703

llvm-svn: 267009
2016-04-21 17:19:36 +00:00
Etienne Bergeron 9d26599078 [clang-tidy] Cleanup some ast-matchers and lift some to utils.
Summary:
Little cleanup to lift-out and to remove some frequently used
ast-matchers.

Some of theses matchers are candidates to be lifted to ASTMatchers.h.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19200

llvm-svn: 267003
2016-04-21 16:57:56 +00:00
Alexander Kornienko bfb43b7298 [Clang-tidy] Fix for crash in modernize-raw-string-literal check
Summary:
Clang-tidy modernize-raw-string-literal check crashes on run-time assert while it is evaluating compiler predefined identifiers such as
- __FUNCTION__
- __func__
- __PRETTY_FUNCTION__

Check is asserting because it cannot find opening quote for such string literal. It occurs only on debug build config.
I think that it would be good to prune such cases by crossing off predefined expressions - there is no need to evaluate such matches.

Reviewers: LegalizeAdulthood, alexfh

Subscribers: cfe-commits

Patch by Marek Jenda!

Differential Revision: http://reviews.llvm.org/D19331

llvm-svn: 266992
2016-04-21 14:39:12 +00:00
Haojian Wu 9cba1b52ef Fix cast compiler warning message in include-fixer.
Reviewers: bkramer

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19323

llvm-svn: 266970
2016-04-21 09:16:32 +00:00
NAKAMURA Takumi f2c717be82 IncludeFixerTest.cpp: Tweak not to assume clang-tools-extra were onto clang/tools/extra.
llvm-svn: 266874
2016-04-20 14:14:16 +00:00
Benjamin Kramer 6b23626192 [include-fixer] Add a prototype for a new include fixing tool.
Summary:
The goal of this tool is fairly simple, look up unknown identifiers in a
global database and add the corresponding #include line. It accomplishes
this by hooking into Sema as an ExternalSemaSource and responding to typo
correction callbacks. This means we can see the unknown identifier before
it's being munged by error recovery.

This doesn't work perfectly yet as some typo corrections don't emit
callbacks (delayed typos), but I think this is fixable. We also handle
only one include at a time as this is meant to be run directly from
the editing environment eventually. Adding multiple includes at the same
time is tricky because of error recovery.

This version only has a a dummy database, so all you can do is fixing
missing includes of <string>, but the indexer to build a database will
follow soon.

Reviewers: djasper

Subscribers: ioeric, hokein, cfe-commits

Differential Revision: http://reviews.llvm.org/D19314

llvm-svn: 266870
2016-04-20 12:43:43 +00:00
Daniel Jasper 25e17df663 clang-tidy: [misc-unused-using-decls] Support template types.
This fixes llvm.org/PR27429.

llvm-svn: 266866
2016-04-20 09:48:56 +00:00
Daniel Jasper a204c0ad18 clang-tidy: [misc-unused-using-decls] Always use the canonical decl to
identify things.

This fixes llvm.org/PR27430.

llvm-svn: 266864
2016-04-20 08:58:27 +00:00
Haojian Wu 257914e7c9 Fix a crash in cppcoreguidelines-pro-type-member-init related to missing constructor bodies.
Summary: Fixes a crash in cppcoreguidelines-pro-type-member-init when checking some record types with a constructor without a body. We now check to make sure the constructor has a body before looking for missing members and base initializers.

Patch by Michael Miller!

Reviewers: aaron.ballman, alexfh, hokein

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19270

llvm-svn: 266862
2016-04-20 08:29:08 +00:00
Eugene Zelenko 5a783d0a1f [Clang-tidy] Fix extra semicolon warning in cppcoreguidelines/ProTypeMemberInitCheck.cpp.
llvm-svn: 266795
2016-04-19 18:49:21 +00:00
Eugene Zelenko e0e87aff5c [Release Notes] Mention Clang-tidy misc-unused-using-decls check.
llvm-svn: 266770
2016-04-19 17:31:58 +00:00
Daniel Jasper 727fd1aeed Initial version of misc-unused-using-decl check.
llvm-svn: 266735
2016-04-19 13:48:39 +00:00
Gabor Horvath 533c01d9b1 [clang-tidy] readability-container-size-empty fixes
Summary: This patch fixes PR27410 and adds std::basic_string support.

Reviewers: Eugene.Zelenko, hokein

Subscribers: cfe-commits, o.gyorgy

Differential Revision: http://reviews.llvm.org/D19262

llvm-svn: 266734
2016-04-19 13:29:05 +00:00
Alex Denisov 71c8440e55 Replace hardcoded comment at 'lit.site.cfg.in'
At the moment almost every lit.site.cfg.in contains two lines comment:

  ## Autogenerated by LLVM/Clang configuration.
  # Do not edit!

The patch adds variable LIT_SITE_CFG_IN_HEADER, that is replaced from
configure_lit_site_cfg with the note and some useful information.

llvm-svn: 266518
2016-04-16 07:01:42 +00:00
Craig Topper 11657c88b3 Add missing override keyword to silence -Winconsistent-missing-override. NFC
llvm-svn: 266511
2016-04-16 02:42:03 +00:00
Etienne Bergeron 9cfd8cea6b [clang-tidy] Add more detection rules for redundant c_str calls.
Summary:
The string class contains methods which support receiving either a string literal or a string object.

For example, calls to append can receive either a char* or a string.
```
  string& append (const string& str);
  string& append (const char* s);
```

Which make these cases equivalent, and the .c_str() useless:
```
  std::string s = "123";
  str.append(s);
  str.append(s.c_str());
```

In these cases, removing .c_str()  doesn't provide any size or speed improvement.
It's only a readability issue.

If the string contains embedded NUL characters,  the string literal and the string
object won't produce the same semantic.

Reviewers: alexfh, sbenza

Subscribers: LegalizeAdulthood, aaron.ballman, chapuni, Eugene.Zelenko, cfe-commits

Differential Revision: http://reviews.llvm.org/D18475

llvm-svn: 266463
2016-04-15 18:12:06 +00:00
Eugene Zelenko dca3812252 [Release Notes] mention Clang-tidy misc-multiple-statement-macro check.
llvm-svn: 266455
2016-04-15 17:32:19 +00:00
Etienne Bergeron 1f696b316c [clang-tidy] Add new checker for suspicious sizeof expressions
Summary:
This check is finding suspicious cases of sizeof expression.

Sizeof expression is returning the size (in bytes) of a type or an
expression. Programmers often abuse or misuse this expression.

This checker is adding common set of patterns to detect some
of these bad constructs.


Some examples found by this checker:

R/packages/ifultools/ifultools/src/fra_neig.c
```
        /* free buffer memory */
        (void) mutil_free( dist_buff, sizeof( ctr * sizeof( double ) ) );
        (void) mutil_free( nidx_buff, sizeof( ctr * sizeof( sint32 ) ) );
```


graphviz/v2_20_2/lib/common/utils.c
```
static Dtdisc_t mapDisc = {
    offsetof(item, p),
    sizeof(2 * sizeof(void *)),
    offsetof(item, link),
    (Dtmake_f) newItem,
    (Dtfree_f) freeItem,
    (Dtcompar_f) cmpItem,
    NIL(Dthash_f),
    NIL(Dtmemory_f),
    NIL(Dtevent_f)
};
```


mDNSResponder/mDNSShared/dnsextd.c
```
	context = ( TCPContext* ) malloc( sizeof( TCPContext ) );
	require_action( context, exit, err = mStatus_NoMemoryErr; LogErr( "AcceptTCPConnection", "malloc" ) );
	mDNSPlatformMemZero( context, sizeof( sizeof( TCPContext ) ) );
	context->d		 = self;
```

Reviewers: alexfh

Subscribers: malcolm.parsons, Eugene.Zelenko, cfe-commits

Differential Revision: http://reviews.llvm.org/D19014

llvm-svn: 266451
2016-04-15 16:36:00 +00:00
Etienne Bergeron 3c5be6c9a7 [clang-tidy] Add checker for operations between integrals and pointers
Summary:
This check is finding suspicious operations involving pointers and integral types; which are most likely bugs.

Examples:
subversion/v1_6/subversion/libsvn_subr/utf.c
```
static const char *
fuzzy_escape(const char *src, apr_size_t len, apr_pool_t *pool)
{
  [...]
   while (src_orig < src_end)
    {
      if (! svn_ctype_isascii(*src_orig) || src_orig == '\0')   // Should be *src_orig
        {
```

apache2/v2_2_23/modules/metadata/mod_headers.c
```
static char *parse_format_tag(apr_pool_t *p, format_tag *tag, const char **sa)
{
  [...]
    tag->arg = '\0';   // ERROR: tag->arg has type char*

    /* grab the argument if there is one */
    if (*s == '{') {
        ++s;
        tag->arg = ap_getword(p,&s,'}');
    }
```

Reviewers: alexfh

Subscribers: Eugene.Zelenko, cfe-commits

Differential Revision: http://reviews.llvm.org/D19118

llvm-svn: 266450
2016-04-15 16:31:15 +00:00
Samuel Benzaquen 4fa2d57c6d [clang-tidy] Add check misc-multiple-statement-macro
Summary:
The check detects multi-statement macros that are used in unbraced conditionals.
Only the first statement will be part of the conditionals and the rest will fall
outside of it and executed unconditionally.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18766

llvm-svn: 266369
2016-04-14 21:15:57 +00:00
Aaron Ballman b602ee7d8f Add support for type aliases to modernize-redundant-void-arg.cpp
Patch by Clement Courbet.

llvm-svn: 266358
2016-04-14 19:28:13 +00:00
Etienne Bergeron 47205aa773 [clang-tidy] Fix documentation generation.
Summary: The patch is fixing the generation of clang-tidy documentation.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19121

llvm-svn: 266333
2016-04-14 16:08:04 +00:00
NAKAMURA Takumi 42b5969862 clang-tools-extra/test/clang-tidy/readability-deleted-default.cpp: Add -fno-ms-compatibility.
llvm-svn: 266265
2016-04-13 23:50:45 +00:00
Alexander Kornienko 855d97e30c Complete support for C++ Core Guidelines Type.6: Always initialize a member variable.
Summary: Added the remaining features needed to satisfy C++ Core Guideline Type.6: Always initialize a member variable to cppcoreguidelines-pro-type-member-init. The check now flags all default-constructed uses of record types without user-provided default constructors that would leave their memory in an undefined state. The check suggests value initializing them instead.

Reviewers: flx, alexfh, aaron.ballman

Subscribers: klimek, aaron.ballman, LegalizeAdulthood, cfe-commits

Patch by Michael Miller!

Differential Revision: http://reviews.llvm.org/D18584

llvm-svn: 266191
2016-04-13 11:35:47 +00:00
Alexander Kornienko 4191b90c75 [clang-tidy] Add a readability-deleted-default clang-tidy check.
Checks if constructors and assignment operators that are marked '= default' are
actually deleted by the compiler.

Patch by Alex Pilkiewicz!

Differential Revision: http://reviews.llvm.org/D18961

llvm-svn: 266190
2016-04-13 11:33:40 +00:00
Alexander Kornienko 6110cca6ef [clang-tidy] add_new_check.py should fail if check name starts with the module name
+ updated formatting

llvm-svn: 266181
2016-04-13 08:46:32 +00:00
Matthias Gehre 018c1d4243 [clang-tidy] fix readability-avoid-const-params-in-decls creating invalid code in fix-its
Summary:
The Fix-Its for the added test cases were before:
-void F11(const unsigned int /*version*/);
+void F11(unsigned int int /*version*/);

-void F12(const bool b = true);
+void F12(_Bool true);

Reviewers: fowles, hokein, sbenza, alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18993

llvm-svn: 266044
2016-04-12 05:45:13 +00:00
Eugene Zelenko 2f7ec9134d [Release Notes] Sort checks alphabetically.
llvm-svn: 265813
2016-04-08 17:21:27 +00:00
Alexander Kornienko 477e5d8d31 [clang-tidy] cppcoreguidelines-interfaces-global-init
Summary:
This check flags initializers of globals that access extern objects, and therefore can lead to order-of-initialization problems (this recommandation is part of CPP core guidelines).
Note that this only checks half of the guideline for now (it does not enforce using constexpr functions).

Reviewers: aaron.ballman, alexfh

Subscribers: aaron.ballman, etienneb, Eugene.Zelenko, cfe-commits

Patch by Clement Courbet!

Differential Revision: http://reviews.llvm.org/D18649

llvm-svn: 265774
2016-04-08 09:51:06 +00:00
Eugene Zelenko b869289cf3 Mention readability-static-definition-in-anonymous-namespace in release notes.
Consistency in using ` and ``.

Differential revision: http://reviews.llvm.org/D18797

llvm-svn: 265698
2016-04-07 17:28:35 +00:00
Etienne Bergeron a5fd19ba1e [clang-tidy] add new checker for string literal with NUL character.
Summary:
This patch adds the support for detecting suspicious string
literals and their //incorrect// usage.

The following example shows a incorrect character escaping leading 
to an embedded NUL character. 
```
  std::string str = "\0x42";   // Should be "\x42".
```

The patch also add detection of truncated literal when a literal
is passed to a string constructor.

Reviewers: hokein, alexfh

Subscribers: LegalizeAdulthood, bcraig, Eugene.Zelenko, bkramer, cfe-commits

Differential Revision: http://reviews.llvm.org/D18783

llvm-svn: 265691
2016-04-07 16:16:36 +00:00
Etienne Bergeron 2c82ebe813 [clang-tidy] fix a crash with -fdelayed-template-parsing in UnnecessaryValueParamCheck.
Summary:
This is the same kind of bug than [[ http://reviews.llvm.org/D18238 | D18238 ]].

Fix crashes caused by deferencing null pointer when declarations parsing may be delayed.
The body of the declarations may be null.

The crashes were observed with a Windows build of clang-tidy and the following command-line.
```
command-line switches: -fms-compatibility-version=19 -fms-compatibility
```

Reviewers: alexfh

Subscribers: kimgr, LegalizeAdulthood, cfe-commits

Differential Revision: http://reviews.llvm.org/D18852

llvm-svn: 265681
2016-04-07 14:58:13 +00:00
Benjamin Kramer a62e223281 [clang-tidy] Remove unnecessary getName() on Decls and Types feeding into a DiagnosticBuilder
Going through a string removes some of the smarts of the diagnosic printer
and makes the code more complicated. This change has some cosmetic impact
on the output but that's mostly minor.

llvm-svn: 265680
2016-04-07 14:55:25 +00:00
Etienne Bergeron 53f7c0ea8e [clang-tidy] Fix infinite loop in MisplacedWideningCastCheck.
Summary:
In Release mode, the check was infinite looping over chromium code base.

It seems there is something strange with the creation of the Maps.
I believe the compiler is making some assumption with the implicit conversion from enum <-> int.

By moving the map to a standard switch/cases, we no longer allocate memory and we can keep the same behavior. For a small amount of elements, this is fine.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18833

llvm-svn: 265679
2016-04-07 14:52:52 +00:00
Etienne Bergeron f6660dab02 [clang-tidy] Fix FP with readability-redundant-string-init for default arguments
Summary:
Clang-tidy is reporting a warning of redundant string initialisation
on a string parameter initialized with empty string.

See bug: 27087

The reported example is:
```
#include <string>
void fn(std::string a = "");
```

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18829

llvm-svn: 265671
2016-04-07 14:18:53 +00:00
Alexander Kornienko b5485b8ade [docs] Update version (http://llvm.org/PR27253)
llvm-svn: 265655
2016-04-07 10:17:23 +00:00
Gabor Horvath 0dbd37543c [clang-tidy] Assertion fix in misc-misplaced-widening-cast check.
llvm-svn: 265544
2016-04-06 14:49:15 +00:00
Etienne Bergeron 4eaeacec6d [clang-tidy] filter plugins and plugin arguments of the command-line
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
2016-04-06 14:07:51 +00:00
Etienne Bergeron 500846c283 [clang-tidy] fix building clang-tidy documentation.
Summary:
The clang-tidy documentation can't be generated because of broken links.

```
Warning, treated as error:
/home/etienneb/llvm/llvm/tools/clang/tools/extra/docs/clang-tidy/checks/google-readability-function-size.rst:: WARNING: document isn't included in any toctree
```

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18803

llvm-svn: 265539
2016-04-06 13:57:22 +00:00
Gabor Horvath 5273f615c4 [clang-tidy] Extension of checker misc-misplaced-widening-cast
Summary:
Existing checker misc-misplaced-widening-cast was extended:
- New use cases: casted expression as lhs or rhs of a logical comparison or function argument
- New types: beside int, long and long long various char types, short and int128 added
- New option to check implicit casts: forgetting a cast is at least as common and as dangerous as misplacing it. This option can be disabled.

This patch depends on AST Matcher patches D17986 and D18243 and also contains fix for checker misc-bool-pointer-implicit-conversion needed because of the fix in the AST Matcher patch.

Reviewers: hokein, alexfh

Subscribers: o.gyorgy, xazax.hun, cfe-commits

Differential Revision: http://reviews.llvm.org/D17987

llvm-svn: 265532
2016-04-06 12:04:51 +00:00
Haojian Wu c253f8b06b [clang-tidy] Add a check to detect static definitions in anonymous namespace.
Summary: Fixes PR26595

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18180

llvm-svn: 265384
2016-04-05 11:42:08 +00:00
Etienne Bergeron 009ec085db [clang-tidy] Fix documentation of misc-suspicious-missing-comma
Summary:
The clang-tidy documentation generation was broken since commit : http://reviews.llvm.org/D18457

I ran locally the documentation generation and I fixed errors related to that specific check.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18764

llvm-svn: 265375
2016-04-05 01:41:02 +00:00