chromium/src/tools/clang.git
4 weeks agoAdd logic for catching unsafe scoped_refptr conversions to T* in returns master
dcheng@chromium.org [Mon, 18 Aug 2014 08:16:04 +0000 (08:16 +0000)]
Add logic for catching unsafe scoped_refptr conversions to T* in returns

The tool doesn't attempt to handle all potential unsafe conversions. It
only attempts to catch a conservative subset of the conversions that are
definitely unsafe, such as returning a local scoped_refptr<T> or
temporary.
If it encounters something that isn't simple to resolve as safe/unsafe
(for example, a reference may be bound to a variable with local storage,
which is unsafe, or it may be bound to a member, which is probably safe),
it prefers to skip rewriting anything at all, so it can be manually
resolved.

BUG=110610
R=rsleevi@chromium.org

Review URL: https://codereview.chromium.org/472923002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@290225 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 weeks agoBlink GC plugin: Ensure that left-most vtable is the first thing to be initialized...
zerny@chromium.org [Wed, 13 Aug 2014 14:13:11 +0000 (14:13 +0000)]
Blink GC plugin: Ensure that left-most vtable is the first thing to be initialized for polymorphic classes with trace methods.

This is done by ensuring one of two properties for any polymorphic class with a trace method.
1. If the trace method is virtual, then the left-most base class must define a virtual trace method too.
2. If the trace method is non-virtual, then the left-most base class must define some virtual method.

BUG=334149
R=ager@chromium.org

Review URL: https://codereview.chromium.org/455263004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@289285 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 weeks agoImplement rewrite logic for assigning a temporary scoped_refptr to T*.
dcheng@chromium.org [Mon, 11 Aug 2014 21:26:05 +0000 (21:26 +0000)]
Implement rewrite logic for assigning a temporary scoped_refptr to T*.

This is always potentially dangerous. For example:
scoped_refptr<Foo> CreateFoo();
void BuggyFunction() {
  Foo* x = CreateFoo();
  // x now points to a deleted object.
}
In these cases, the tool prefers to rewrite the declaration type to
scoped_refptr<T> instead of adding an explicit conversion to T* with
get().

BUG=110610
R=mdempsky@chromium.org, rsleevi@chromium.org

Review URL: https://codereview.chromium.org/453873002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@288795 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 weeks agoRoll ASan/Win to r215347
timurrrr@chromium.org [Mon, 11 Aug 2014 12:20:14 +0000 (12:20 +0000)]
Roll ASan/Win to r215347

BUG=345874
TBR=rnk@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/459773002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@288694 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 weeks agoRoll ASan/Win to r215204 to pick up a fix for SymInitialize failure
timurrrr@chromium.org [Fri, 8 Aug 2014 17:07:29 +0000 (17:07 +0000)]
Roll ASan/Win to r215204 to pick up a fix for SymInitialize failure

BUG=394220
TBR=rnk@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/456833002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@288382 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoscoped_refptr implicit conversion cleanup tool.
dcheng@chromium.org [Thu, 7 Aug 2014 23:38:58 +0000 (23:38 +0000)]
scoped_refptr implicit conversion cleanup tool.

Adapted from rsleevi's original patch. The initial version of the tool rewrites
all implicit conversions of scoped_refptr<T> to T*, even unsafe ones where a
temporary scoped_refptr<T> is assigned to a T*. A small tweak/hack has also
been added to run_tool.py to allow it to handle replacements that contain
embedded newlines.

BUG=110610
R=mdempsky@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/446203003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@288163 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoFix bitrot in Chrome clang tool infrastructure.
dcheng@chromium.org [Wed, 6 Aug 2014 20:07:19 +0000 (20:07 +0000)]
Fix bitrot in Chrome clang tool infrastructure.

- LLVM now uses C++11, so need to use LLVM_OVERRIDE anymore.
- Small changes in Clang interfaces for flags and FrontendFactory
  instantiation.
- clang-format-diff.py works slightly differently now, so update the
  run_tool.py wrapper to invoke it correctly.
- Delete tools that are no longer needed.

BUG=
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/448693003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@287841 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agomac: Actually include libc++ headers in clang package.
thakis@chromium.org [Tue, 5 Aug 2014 20:41:56 +0000 (20:41 +0000)]
mac: Actually include libc++ headers in clang package.

Follow-up to r270095 where I tried to do this already, but wasn't quite
successful. (It worked on my box, but nowhere else.)

BUG=400088
R=hans@chromium.org

Review URL: https://codereview.chromium.org/440813003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@287585 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoWin-Clang update.py: implement more principled search for CMake
hans@chromium.org [Tue, 5 Aug 2014 19:04:25 +0000 (19:04 +0000)]
Win-Clang update.py: implement more principled search for CMake

BUG=82385
NOTRY=true

Review URL: https://codereview.chromium.org/440163002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@287576 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoRoll ASan/Win to r214846
timurrrr@chromium.org [Tue, 5 Aug 2014 10:06:05 +0000 (10:06 +0000)]
Roll ASan/Win to r214846

BUG=345874
NOTRY=true
TBR=rnk@chromium.org

Review URL: https://codereview.chromium.org/443603002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@287503 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoWin-Clang update script: update paths for 3.6
hans@chromium.org [Mon, 4 Aug 2014 15:58:29 +0000 (15:58 +0000)]
Win-Clang update script: update paths for 3.6

BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/417173003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@287342 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 weeks agoBlink GC plugin: Require that fields are actually traced by the visitor and identify...
zerny@chromium.org [Mon, 4 Aug 2014 09:52:10 +0000 (09:52 +0000)]
Blink GC plugin: Require that fields are actually traced by the visitor and identify tracing of dependently-templated base classes.

Prior to this we only required that fields occurred within the trace method.
Thus we would accept seemingly correct code such as:
  m_foo->trace(visitor)
which can result in a dangling pointer.

BUG=395036,334149
R=haraken@chromium.org

Review URL: https://codereview.chromium.org/430213003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@287310 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

7 weeks agoClang roll 209387:214024 (take 2)
hans@chromium.org [Wed, 30 Jul 2014 16:23:00 +0000 (16:23 +0000)]
Clang roll 209387:214024 (take 2)

- The previous attempt failed due to crashing layout tests (fast/text-autosize).
  That was fixed in Blink r179171.

- This roll seems to cause a slight binary size increase, perhaps related
  to changed inlining behaviour. On Linux this is offset by the switch to
  Clang just having saved megs of binary size. On Mac this is unfortunate,
  but since we haven't rolled in a long time, we decided not to consider
  it a blocker.

- Note: this version adds optimizations based on exploiting that references
  must refer to valid objects, and so if 'foo' is a reference, checks such
  as "if (&foo == NULL)" can be optimized away.

BUG=381489
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/430603002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@286532 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

7 weeks agoRevert of "Clang roll 209387:214024"
alancutter@chromium.org [Tue, 29 Jul 2014 09:53:35 +0000 (09:53 +0000)]
Revert of "Clang roll 209387:214024"

Reason for revert:
Clang roll caused release build of Blink test runner to start crashing on
the following layout tests:
fast/text-autosizing/constrained-floats.html
fast/text-autosizing/form-controls-autosizing-button-input-elements.html
fast/text-autosizing/form-controls-autosizing-fieldset-element.html
fast/text-autosizing/form-controls-autosizing-select-element.html

Original issue's description:
> Clang roll 209387:214024
>
> BUG=381489
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=286068

TBR=hans@chromium.org,thakis@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=398348

Review URL: https://codereview.chromium.org/427763002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@286153 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

7 weeks agoClang roll 209387:214024
hans@chromium.org [Tue, 29 Jul 2014 03:02:34 +0000 (03:02 +0000)]
Clang roll 209387:214024

BUG=381489

Review URL: https://codereview.chromium.org/426703002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@286068 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

8 weeks agoRoll ASan/Win to r213658
timurrrr@chromium.org [Tue, 22 Jul 2014 17:09:48 +0000 (17:09 +0000)]
Roll ASan/Win to r213658

This version of the RTL should handle SEH and C++ exceptions better
BUG=345874,394325
NOTRY=true
TBR=rnk@chromium.org

Review URL: https://codereview.chromium.org/411583004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@284713 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoclang/blink_gc_plugin: Replace 'WebCore' with 'blink'
mkwst@chromium.org [Thu, 17 Jul 2014 16:35:51 +0000 (16:35 +0000)]
clang/blink_gc_plugin: Replace 'WebCore' with 'blink'

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/401613002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@283795 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoRoll ASan/Win to 213197 to pick up LLVM r213151
timurrrr@chromium.org [Thu, 17 Jul 2014 08:46:53 +0000 (08:46 +0000)]
Roll ASan/Win to 213197 to pick up LLVM r213151

This should fix ASan CHECK failures when a report happens after Chrome used DbgHelp once
BUG=394220,345874
TBR=rnk@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/393323005

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@283718 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoRoll ASan/Win to r212815
timurrrr@chromium.org [Fri, 11 Jul 2014 16:19:21 +0000 (16:19 +0000)]
Roll ASan/Win to r212815

This should enable NULL deref and wild memory access detection!

TBR=rnk@chromium.org
BUG=345874
NOTRY=true

Review URL: https://codereview.chromium.org/387013002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@282632 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoRevert of Revert of Turn on clang by default on linux, 3rd try. (https://codereview...
yutak@chromium.org [Thu, 10 Jul 2014 07:36:38 +0000 (07:36 +0000)]
Revert of Revert of Turn on clang by default on linux, 3rd try. (https://codereview.chromium.org/378363006/)

Reason for revert:
This change should not have been reverted, since
it was easy to just disable these tests. thakis
explicitly requested "please ping thakis before
reverting it".

Original issue's description:
> Revert of Turn on clang by default on linux, 3rd try. (https://codereview.chromium.org/379413002/)
>
> Reason for revert:
> NaClBrowserTestNonSfiMode.Messaging and NaClBrowserTestNonSfiMode.Irt failed.
>
> http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests/builds/12124/steps/browser_tests/logs/Irt
> http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests/builds/12124/steps/browser_tests/logs/Messaging
>
> Original issue's description:
> > Turn on clang by default on linux, 3rd try.
> >
> > This is mostly to collect performance and size data for now, and to find out
> > if more bots need work. Unless things look really good, I'm going to revert
> > this by thursday morning (PDT).
> >
> > BUG=360311
> > TBR=ajwong@chromium.org
> >
> > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282246
>
> TBR=awong@chromium.org,thakis@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=360311
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282265

TBR=awong@chromium.org,thakis@chromium.org,horo@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=360311

Review URL: https://codereview.chromium.org/382743002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@282266 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoRevert of Turn on clang by default on linux, 3rd try. (https://codereview.chromium...
horo@chromium.org [Thu, 10 Jul 2014 07:27:19 +0000 (07:27 +0000)]
Revert of Turn on clang by default on linux, 3rd try. (https://codereview.chromium.org/379413002/)

Reason for revert:
NaClBrowserTestNonSfiMode.Messaging and NaClBrowserTestNonSfiMode.Irt failed.

http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests/builds/12124/steps/browser_tests/logs/Irt
http://build.chromium.org/p/chromium.linux/builders/Linux%20Tests/builds/12124/steps/browser_tests/logs/Messaging

Original issue's description:
> Turn on clang by default on linux, 3rd try.
>
> This is mostly to collect performance and size data for now, and to find out
> if more bots need work. Unless things look really good, I'm going to revert
> this by thursday morning (PDT).
>
> BUG=360311
> TBR=ajwong@chromium.org
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282246

TBR=awong@chromium.org,thakis@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=360311

Review URL: https://codereview.chromium.org/378363006

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@282265 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoTurn on clang by default on linux, 3rd try.
thakis@chromium.org [Thu, 10 Jul 2014 03:55:24 +0000 (03:55 +0000)]
Turn on clang by default on linux, 3rd try.

This is mostly to collect performance and size data for now, and to find out
if more bots need work. Unless things look really good, I'm going to revert
this by thursday morning (PDT).

BUG=360311
TBR=ajwong@chromium.org

Review URL: https://codereview.chromium.org/379413002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@282246 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoBump ASan/Win revision by ~2000
timurrrr@chromium.org [Wed, 9 Jul 2014 09:13:05 +0000 (09:13 +0000)]
Bump ASan/Win revision by ~2000
By the way, we should do this more often than once in 2000 revisions :)

BUG=345874
TBR=rnk@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/374373002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@281996 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoRevert r281914
thakis@chromium.org [Wed, 9 Jul 2014 04:33:11 +0000 (04:33 +0000)]
Revert r281914

Many 32bit bots fail with "bits/predef" not found. Examples:
http://build.chromium.org/p/chromium.webkit/builders/WebKit%20Linux%2032/builds/25814/steps/compile/logs/stdio
http://build.chromium.org/p/chromium/builders/Linux/builds/51225

BUG=360311
NOTRY=true
NOTREECHECKS=true
TBR=ajwong@chromium.org

Review URL: https://codereview.chromium.org/378183002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@281928 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoTurn on clang by default on linux, 2nd try.
thakis@chromium.org [Wed, 9 Jul 2014 04:03:27 +0000 (04:03 +0000)]
Turn on clang by default on linux, 2nd try.

This is mostly to collect performance and size data for now. Unless things
look really good, I'm going to revert this by wednesday morning (PDT).

BUG=360311
TBR=awong@chromium.org

Review URL: https://codereview.chromium.org/380573002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@281914 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

2 months agoSupport ignorance of base class finalizers.
sigbjornf@opera.com [Tue, 8 Jul 2014 15:33:35 +0000 (15:33 +0000)]
Support ignorance of base class finalizers.

When checking if a class needs a finalizer, allow some of its base
classes to be ignored, even if they do have a declared destructor.

This is done so as to handle WebCore::ScriptWrappable use better while
in transition. i.e., WebCore::ScriptWrappable's destructor does not
have to be invoked when sweeping, and when Oilpan will be on by
default, ScriptWrappable will not define one. However, until that
time, it still provides a user-defined destructor, and to allow the
class to be used as base in conjunction with GarbageCollected<>, we
will now look past it when checking the finalizer requirement.

R=zerny@chromium.org
BUG=

Review URL: https://codereview.chromium.org/374593002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@281758 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoClang update.py: check for LLVM_FORCE_HEAD_REVISION in the environment
hans@chromium.org [Thu, 19 Jun 2014 21:54:40 +0000 (21:54 +0000)]
Clang update.py: check for LLVM_FORCE_HEAD_REVISION in the environment

The FYI builders will set this to enforce using the latest revision.

BUG=82385
NOTRY=true

Review URL: https://codereview.chromium.org/336163004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@278500 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoChrome clang plugin cleanup part 1 of ??
dcheng@chromium.org [Thu, 19 Jun 2014 21:14:37 +0000 (21:14 +0000)]
Chrome clang plugin cleanup part 1 of ??

The clang plugin has grown organically over its lifetime. This patch
just splits apart the options struct, the PluginASTAction (which most
developers don't care about), and the actual ASTConsumer into separate
units.

R=erg@chromium.org

Review URL: https://codereview.chromium.org/348543002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@278487 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoUse a faster rolling fixed Clang revision for ASan on Windows
rnk@chromium.org [Thu, 19 Jun 2014 04:27:34 +0000 (04:27 +0000)]
Use a faster rolling fixed Clang revision for ASan on Windows

We want a fixed Clang revision for ASan on Windows because ClusterFuzz
produces archived builds.  We don't want Clang to change underfoot and
produce a bad Chromium build that gets archived.

Long term, when ASan for Windows stabilizes, we should remove this
extra fixed revision and use the mainline Chromium revision.  For now,
we don't build with -Werror with Clang on Windows, so it isn't as
important to be in sync with other platforms.

R=thakis@chromium.org
BUG=82385, 345874
NOTRY=true

Review URL: https://codereview.chromium.org/341963002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@278271 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoRevert of Pick a fixed Clang revision for Windows now that we have an LKGR ASan build...
thakis@chromium.org [Tue, 17 Jun 2014 19:42:43 +0000 (19:42 +0000)]
Revert of Pick a fixed Clang revision for Windows now that we have an LKGR ASan builder (https://codereview.chromium.org/320383004/)

Reason for revert:
This was landed despite an explicit "not lgtm"

Original issue's description:
> Pick a fixed Clang revision for Windows now that we have an LKGR ASan builder
> This way, the LKGR builder and the developers who want to try ASan (or just Clang) on Windows won't get a broken Clang revision.
>
> The FYI bots got LLVM_WIN_REVISION=HEAD in r276301 so won't be affected.
>
> BUG=82385,345874
> NOTRY=true
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=276366

TBR=hans@chromium.org,rnk@chromium.org,timurrrr@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=82385,345874

Review URL: https://codereview.chromium.org/342533002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@277837 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoPick a fixed Clang revision for Windows now that we have an LKGR ASan builder
timurrrr@chromium.org [Wed, 11 Jun 2014 12:23:59 +0000 (12:23 +0000)]
Pick a fixed Clang revision for Windows now that we have an LKGR ASan builder
This way, the LKGR builder and the developers who want to try ASan (or just Clang) on Windows won't get a broken Clang revision.

The FYI bots got LLVM_WIN_REVISION=HEAD in r276301 so won't be affected.

BUG=82385,345874
NOTRY=true

Review URL: https://codereview.chromium.org/320383004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@276366 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoBlink GC plugin: disallow own pointers to GC allocated collections.
zerny@chromium.org [Wed, 4 Jun 2014 14:07:59 +0000 (14:07 +0000)]
Blink GC plugin: disallow own pointers to GC allocated collections.

BUG=334149
R=haraken@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/318623002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@274816 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoPackage libclang_rt.san-{i386,x86_64}.a for Chromium Clang.
glider@chromium.org [Wed, 28 May 2014 14:30:25 +0000 (14:30 +0000)]
Package libclang_rt.san-{i386,x86_64}.a for Chromium Clang.

BUG=174801
R=thakis@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/303473011

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@273223 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoBlink GC plugin: support checking structures in anonymous namespaces.
zerny@chromium.org [Wed, 28 May 2014 05:54:06 +0000 (05:54 +0000)]
Blink GC plugin: support checking structures in anonymous namespaces.

BUG=334149
R=wibling@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/306473005

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@273166 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoRoll Clang 206824:209387
hans@chromium.org [Fri, 23 May 2014 15:55:17 +0000 (15:55 +0000)]
Roll Clang 206824:209387

BUG=370448
NOTRY=true

Review URL: https://codereview.chromium.org/296983008

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@272541 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoRemove no longer needed "svn revert" lines.
thakis@chromium.org [Thu, 22 May 2014 22:15:01 +0000 (22:15 +0000)]
Remove no longer needed "svn revert" lines.

They were added after we had to add some local patches for a tricky clang roll
two months ago.  We've done several rolls without local patches since then.

BUG=341352
NOTRY=true

Review URL: https://codereview.chromium.org/292333005

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@272342 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

3 months agoBlink GC plugin: disallow GC derived types as part-object fields.
zerny@chromium.org [Wed, 21 May 2014 11:46:55 +0000 (11:46 +0000)]
Blink GC plugin: disallow GC derived types as part-object fields.

BUG=334149
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/292743006

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@271880 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoBlink GC plugin: look for checked namespaces within the list of namespaces.
zerny@chromium.org [Tue, 20 May 2014 07:30:32 +0000 (07:30 +0000)]
Blink GC plugin: look for checked namespaces within the list of namespaces.

Previously only the innermost namespace was matched against causing structures in, eg, namespace WebCore::Foo to not be checked.

BUG=334149
R=haraken@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/294903002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@271608 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoWin-clang update script: make an auxiliary copy of the sanitizer headers
hans@chromium.org [Fri, 16 May 2014 17:03:57 +0000 (17:03 +0000)]
Win-clang update script: make an auxiliary copy of the sanitizer headers

This dir will be put on the include path for MSVC to pick up when invoked
as fallback compiler.

BUG=345874
NOTRY=true

Review URL: https://codereview.chromium.org/281413006

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@271039 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoWin-clang update script: copy asan_blacklist.txt into the right place.
hans@chromium.org [Fri, 16 May 2014 02:40:09 +0000 (02:40 +0000)]
Win-clang update script: copy asan_blacklist.txt into the right place.

BUG=371303
NOTRY=true

Review URL: https://codereview.chromium.org/286193002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@270905 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoBlink GC plugin: remove temporary exceptions for the TreeShared/Node hierarchy.
zerny@chromium.org [Tue, 13 May 2014 14:59:20 +0000 (14:59 +0000)]
Blink GC plugin: remove temporary exceptions for the TreeShared/Node hierarchy.

BUG=334149
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/270623009

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@270096 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoBundle libc++ headers with clang.
thakis@chromium.org [Tue, 13 May 2014 14:58:21 +0000 (14:58 +0000)]
Bundle libc++ headers with clang.

That way, -stdlib=libc++ works better, at least on OS X.

BUG=371034
TEST=`echo '#include <vector>" > test.cc ; bin/clang -c test.cc -stdlib=libc++ -isysroot $(xcrun -show-sdk-path)`
no longer complains about not finding the vector header on OS X.
NOTRY=true

Review URL: https://codereview.chromium.org/281753002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@270095 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoBlink GC plugin: require that trace call base::trace and traceAfterDispatch call...
zerny@chromium.org [Tue, 13 May 2014 09:15:18 +0000 (09:15 +0000)]
Blink GC plugin: require that trace call base::trace and traceAfterDispatch call base::traceAfterDispatch.

BUG=334149
R=wibling@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/278523004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@270057 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoBlink GC plugin: require a trace method if a class derives multiple bases that need...
zerny@chromium.org [Mon, 12 May 2014 11:03:03 +0000 (11:03 +0000)]
Blink GC plugin: require a trace method if a class derives multiple bases that need tracing.

BUG=334149
R=haraken@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/273873002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@269764 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoBlink GC plugin: disallow pure-virtual trace methods.
zerny@chromium.org [Sat, 10 May 2014 06:31:15 +0000 (06:31 +0000)]
Blink GC plugin: disallow pure-virtual trace methods.

BUG=334149
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/278513005

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@269547 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoclang: Instead of having update.sh clobber out/, add a define with the current revision.
thakis@chromium.org [Fri, 9 May 2014 22:01:28 +0000 (22:01 +0000)]
clang: Instead of having update.sh clobber out/, add a define with the current revision.

When clang is turned on or off, or when clang is updated, all .o files and all
precompiled headers need to be rebuilt. This is currently done by having the
update script remove the out/ directory. This has issues:
* It fails to catch build directories with different names (e.g. out_android)
* It removes other build artifacts (like resources) that don't need rebuilding
* It doesn't happen when turning clang off (i.e. moving clang -> gcc).

Instead, let common.gypi add a define with the current clang revision to each
source file. This way, the clang revision is on each compile's command line
and the build system's commandline tracking can take care of the rebuilding.

BUG=nativeclient:3840
NOTRY=true

Review URL: https://codereview.chromium.org/268363020

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@269427 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoBlink GC plugin: require that GC derived classes do not override their new(size_t...
zerny@chromium.org [Mon, 5 May 2014 13:20:07 +0000 (13:20 +0000)]
Blink GC plugin: require that GC derived classes do not override their new(size_t) operator.

BUG=334149
R=wibling@chromium.org

Review URL: https://codereview.chromium.org/261973002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@268164 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoClang update script (Windows): fix asan runtime copying
hans@chromium.org [Fri, 2 May 2014 21:47:19 +0000 (21:47 +0000)]
Clang update script (Windows): fix asan runtime copying

Fix the copying of asan runtime. I'll try to come up with a more permanent
solution, but this should get the ASan buildbot going in the meantime.

BUG=82385
NOTRY=true

Review URL: https://codereview.chromium.org/263003002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@267932 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoBlink GC plugin: fix construction of collection edges containing primitive types.
zerny@chromium.org [Fri, 2 May 2014 17:24:14 +0000 (17:24 +0000)]
Blink GC plugin: fix construction of collection edges containing primitive types.

R=ager@chromium.org
BUG=

Review URL: https://codereview.chromium.org/262883004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@267836 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoChanged clang update script so it clobbers the entire chromium out dir.
dyen@chromium.org [Wed, 30 Apr 2014 23:15:54 +0000 (23:15 +0000)]
Changed clang update script so it clobbers the entire chromium out dir.

When updating Clang, we must delete the all object files to force a
rebuild of all source files using the new compiler. It is now safe
to simply delete the chromium output directory since the update script
is run from DEPS before the gyp files are generated. This is much
safer as deleting object files may introduce unintended consequences
with dependencies.

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3840
TEST=None

Review URL: https://codereview.chromium.org/263443003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@267370 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoFix IsGCMixin predicate to correctly identify classes with multiple mixin bases.
zerny@chromium.org [Tue, 29 Apr 2014 11:31:59 +0000 (11:31 +0000)]
Fix IsGCMixin predicate to correctly identify classes with multiple mixin bases.

R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/260073010

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@266851 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

4 months agoRoll Clang 206155:206824
hans@chromium.org [Wed, 23 Apr 2014 18:42:02 +0000 (18:42 +0000)]
Roll Clang 206155:206824

BUG=365727

Review URL: https://codereview.chromium.org/247813003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@265694 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoRoll Clang 204777:206155
hans@chromium.org [Wed, 16 Apr 2014 23:17:46 +0000 (23:17 +0000)]
Roll Clang 204777:206155

BUG=363667

Review URL: https://codereview.chromium.org/239243004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@264340 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoclang plugin: Fix tests when running on OS X 10.9
thakis@chromium.org [Wed, 16 Apr 2014 03:04:16 +0000 (03:04 +0000)]
clang plugin: Fix tests when running on OS X 10.9

On 10.9, trunk clang defaults to targeting libc++. Clang expects to bundle
the libc++ headers to be able to use libc++, but we don't currently do this.
Instead, tell the plugin tests to use libstdc++ and pass a sysroot flag.

(The blink oilpan plugin doesn't use and standard library includes, so it
doesn't need this change at the moment.)

BUG=none
TEST=tools/clang/plugins/tests/test.sh third_party/llvm-build/Release+Asserts
NOTRY=true

Review URL: https://codereview.chromium.org/239753005

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@264089 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoClang update.py: tiny fix to the regexes
hans@chromium.org [Mon, 14 Apr 2014 18:53:10 +0000 (18:53 +0000)]
Clang update.py: tiny fix to the regexes

Remove erroneous word boundary marker. It seems "\b(make_clang_dir)=\b"
wouldn't match "make_clang_dir=../foo/bar".

Also, much less importantly, "\b(clang|asan)=1\b" wouldn't match "clang=10".

BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/237323003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@263687 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoCheck that GC base classes are left-most derived and that RawPtr<T> are not used...
zerny@chromium.org [Tue, 8 Apr 2014 13:21:32 +0000 (13:21 +0000)]
Check that GC base classes are left-most derived and that RawPtr<T> are not used as fields.

BUG=334149
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/228503002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@262387 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoRevert "Turn on clang by default on linux."
thakis@chromium.org [Sat, 5 Apr 2014 20:06:28 +0000 (20:06 +0000)]
Revert "Turn on clang by default on linux."

We don't have 32bit clang binaries, but several 32bit builders.
(And since clang now needs a c++11 compiler newer than gcc4.6 to
compile, we can't tell these bots to just build clang themselves
either.)

BUG=360311

Review URL: https://codereview.chromium.org/227133002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@262030 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoTurn on clang by default on linux.
thakis@chromium.org [Sat, 5 Apr 2014 18:27:00 +0000 (18:27 +0000)]
Turn on clang by default on linux.

This is mostly to collect performance and size data for now. Unless things
look really good, I'm going to revert this by end-of-day sunday.

BUG=360311
TBR=awong@chromium.org

Review URL: https://codereview.chromium.org/226253008

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@262025 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoUpgrade blink plugin to pick up r261132.
thakis@chromium.org [Thu, 3 Apr 2014 04:15:07 +0000 (04:15 +0000)]
Upgrade blink plugin to pick up r261132.

BUG=334149
TBR=zerny@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/223043003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@261274 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoclang update script cleanups: Remove Xcode 3.2 step, replace "cd -" with "popd".
thakis@chromium.org [Wed, 2 Apr 2014 15:53:23 +0000 (15:53 +0000)]
clang update script cleanups: Remove Xcode 3.2 step, replace "cd -" with "popd".

No intended behavior change.

BUG=none
NOTRY=true

Review URL: https://codereview.chromium.org/221273002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@261133 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoAdd temporary exceptions for the TreeShared hierarchy to the Blink GC plugin.
zerny@chromium.org [Wed, 2 Apr 2014 15:48:28 +0000 (15:48 +0000)]
Add temporary exceptions for the TreeShared hierarchy to the Blink GC plugin.

While transitioning the Node hierarchy we allow Persistent fields from within the hierarchy and allow raw pointers to the hierarchy from stack-allocated objects.

Also, fixes a typo introduced in r260833.

BUG=334149
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/220403003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@261132 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoroll clang 202555:204777
thakis@chromium.org [Wed, 2 Apr 2014 03:37:33 +0000 (03:37 +0000)]
roll clang 202555:204777

BUG=357890
TBR=hans@chromium.org

Review URL: https://codereview.chromium.org/221623003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@261042 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoroll clang 202554:202555
thakis@chromium.org [Tue, 1 Apr 2014 22:42:21 +0000 (22:42 +0000)]
roll clang 202554:202555

This rolls in just clang r202555, which is a formatting change -- so this change
doesn't modify the compiler itself.

It does deploy the following things:
1.) On Mac, clang now packages libc++. This will hopefully allow clang to
    continue running on OS X 10.6, even when clang is built with a dependency
    on a standard library that provides c++11 features. (http://crbug.com/202555)
2.) It picks up r260249 for the plugin, fixing a crash in the plugin
    (http://crbug.com/202555) and turning the warning off by default.
3.) It picks up oilplan plugin changes up to r260911.

This also changes the bundle build script to use the bootstrap compiler to
compile libc++ in bootstrap builds, and tweaks the script to keep clang
asan/android buildable with the r9d ndk (http://crbug.com/357890)

BUG=358500,356816,357890
TBR=hans@chromium.org

Review URL: https://codereview.chromium.org/217323005

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@260962 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoclang/mac: Bundle libc++.dylib with clang.
thakis@chromium.org [Tue, 1 Apr 2014 18:28:25 +0000 (18:28 +0000)]
clang/mac: Bundle libc++.dylib with clang.

clang now uses c++11, which on OS X means it depends on libc++.
OS X 10.6 doesn't have libc++ yet, but some bots still are on 10.6 and
upgrading them will take a bit longer. Bundle libc++ with the clang package,
and set rpaths so that both clang and plugins refer to the bundled libc++
instead of /usr/lib/libc++.1.dylib.

(System libraries will still cause libstdc++ to be loaded as well. Since libc++
keeps its symbols in std::__1:: and aliases everything to that, loading libc++
and libstdc++ in the same process is safe.)

Also don't set MACOSX_DEPLOYMENT_TARGET while building the bootstrap
compiler (Xcode's clang complains when using -stdlib=libc++ when targeting
10.6 or older; open-source luckily doesn't for some reason).

Also pass -isysroot; when building on OS X 10.9, /usr/include doesn't exist
unless the command line tools are installed.

BUG=358500
TEST=Run package.sh (with a tweaked clang revision, to not clobber an
existing package). Upload produced tgz file somewhere, download it on
a 10.6 box. Clang should run.

R=hans@chromium.org

Review URL: https://codereview.chromium.org/218613009

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@260908 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoAdd flag to gather statistics from the Blink points-to graph.
zerny@chromium.org [Tue, 1 Apr 2014 11:21:27 +0000 (11:21 +0000)]
Add flag to gather statistics from the Blink points-to graph.

This also fixes an error where the edge key of subclass edges was non-unique causing subclass edge entries to be incorrectly overwritten.

BUG=334149
NOTRY=true

Review URL: https://codereview.chromium.org/219213004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@260833 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoRe-enable the clang check for enum constants.
tsepez@chromium.org [Fri, 28 Mar 2014 20:05:13 +0000 (20:05 +0000)]
Re-enable the clang check for enum constants.

The patch adds a flag to disable the feature, so as to avoid future reverts.
There is also a check to avoid mixed signed comparisons, as can
arise with enums from C files.  We need not bother checking these.

BUG=356816
R=mark@chromium.org
R=thakis@chromium.org

Re-enable flag.

patch from issue 150943005

Review URL: https://codereview.chromium.org/213403010

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@260249 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoAvoid updating clang if the user set make_clang_dir in GYP_DEFINES
rnk@chromium.org [Thu, 27 Mar 2014 19:01:17 +0000 (19:01 +0000)]
Avoid updating clang if the user set make_clang_dir in GYP_DEFINES

R=hans@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/214883004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259944 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoRemoving the misleading comments about mac-only.
mithro@mithis.com [Thu, 27 Mar 2014 15:50:01 +0000 (15:50 +0000)]
Removing the misleading comments about mac-only.

clang is regularly used on Linux too and work is going on to make Windows work.

BUG=

Review URL: https://codereview.chromium.org/212203002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259882 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoCleanup of the Blink GC plugin code.
zerny@chromium.org [Thu, 27 Mar 2014 07:36:35 +0000 (07:36 +0000)]
Cleanup of the Blink GC plugin code.

- Add override to overridden methods.
- Move assert out of exhaustive switch to avoid compile warnings.
- Code formatting.

BUG=334149
R=ager@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/212593004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259809 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoRevert of Add a check to the FindBadConstructs.cpp clang plugin for bad enum last...
thakis@chromium.org [Wed, 26 Mar 2014 20:46:51 +0000 (20:46 +0000)]
Revert of Add a check to the FindBadConstructs.cpp clang plugin for bad enum last values. (https://codereview.chromium.org/150943005/)

Reason for revert:
Caused crbug.com/356815 and crbug.com/356816 and doesn't have a flag to turn it off.

Original issue's description:
> Add a check to the FindBadConstructs.cpp clang plugin for bad enum last values.
>
> One common coding patern is to define an enum as in:
>   enum Color { RED, GREEN, BLUE, COLOR_LAST=BLUE };
> but this is fragile when someone adds a new constant and forgets
> to update the COLOR_LAST constant.
>
> This change looks for enums that have a xxx_LAST or xxxLast member,
> and warns if there are any higher-valued constants present.
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=251894

TBR=erg@google.com,darin@chromium.org,erg@chromium.org,tsepez@chromium.org
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/212673008

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259675 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoDisallow Member fields in "unmanaged" classes.
zerny@chromium.org [Wed, 26 Mar 2014 14:25:02 +0000 (14:25 +0000)]
Disallow Member fields in "unmanaged" classes.

An unmanaged class is a class that is allocated on the non-managed C++ heap. In other words, an "unmanaged" object is not GC allocated, stack allocated, inline allocated in a collection, or allocated as a part of a GC allocated object.

BUG=334149
R=ager@chromium.org, haraken@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/212943002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259574 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoVerify inner classes in the Blink GC plugin.
zerny@chromium.org [Wed, 26 Mar 2014 14:15:06 +0000 (14:15 +0000)]
Verify inner classes in the Blink GC plugin.

Checks of inner classes were missing due to incorrect code for ignoring non-blink namespaces.

BUG=334149
R=ager@chromium.org

Review URL: https://codereview.chromium.org/210203003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259568 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoAdd ignore-cycles and pickle-graph flags to the process-graph script.
zerny@chromium.org [Wed, 26 Mar 2014 11:44:36 +0000 (11:44 +0000)]
Add ignore-cycles and pickle-graph flags to the process-graph script.

The ignore-cycles takes a file containing the output of cycles that are to be ignored.
The pickle-graph takes a file name that the completed graph will be read from or saved to.

BUG=334149
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/211063003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259554 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoclang roll 198389:202554 revolutions
thakis@chromium.org [Wed, 26 Mar 2014 00:14:35 +0000 (00:14 +0000)]
clang roll 198389:202554 revolutions

First try: https://codereview.chromium.org/195623002
Second try: https://codereview.chromium.org/211213004

Difference from "second try" is passing --enable-libedit=no to
configure, to not depend on libedit.3.dylib (which doesn't exist on
OS X 10.6), see diff from patch set 1 to 2.

The linux package wasn't rebuilt, so it's configured without that flag.
That shouldn't cause issues hopefully.

BUG=351479, 287029, 341352, 333968, 335325
R=hans@chromium.org
TBR=hans@chromium.org

Review URL: https://codereview.chromium.org/211733007

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259411 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoRevert 259371 "clang roll 198389:202554 reloaded"
thakis@chromium.org [Tue, 25 Mar 2014 22:56:20 +0000 (22:56 +0000)]
Revert 259371 "clang roll 198389:202554 reloaded"

Even though the libc++ dependency is gone, clang still depends on
/usr/lib/libedit.3.dylib suddently, which doesn't exist on 10.6. Backing out
while I investigate...

> clang roll 198389:202554 reloaded
>
> The first try is at https://codereview.chromium.org/195623002/ . Patch set 1
> is identical to that CL, patch set 2 has what changed.
>
> The big change is that clang/mac is built in gnu++98 mode and doesn't link
> to libc++, to buy us time until the next roll for upgrading our bots to 10.7.
> This includes blink plugin changes up to r256229 (inclusive).
>
> BUG=351479, 287029, 341352, 333968, 335325
> R=hans@chromium.org
> TBR=hans@chromium.org
>
> Review URL: https://codereview.chromium.org/211213004

TBR=thakis@chromium.org

Review URL: https://codereview.chromium.org/211493005

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259378 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoclang roll 198389:202554 reloaded
thakis@chromium.org [Tue, 25 Mar 2014 22:42:36 +0000 (22:42 +0000)]
clang roll 198389:202554 reloaded

The first try is at https://codereview.chromium.org/195623002/ . Patch set 1
is identical to that CL, patch set 2 has what changed.

The big change is that clang/mac is built in gnu++98 mode and doesn't link
to libc++, to buy us time until the next roll for upgrading our bots to 10.7.
This includes blink plugin changes up to r256229 (inclusive).

BUG=351479, 287029, 341352, 333968, 335325
R=hans@chromium.org
TBR=hans@chromium.org

Review URL: https://codereview.chromium.org/211213004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259371 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoRename Blink GC plugin flag from detect-cycles to dump-graph.
zerny@chromium.org [Tue, 25 Mar 2014 16:29:35 +0000 (16:29 +0000)]
Rename Blink GC plugin flag from detect-cycles to dump-graph.

BUG=334149
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/210803002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@259231 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoDon't allow raw pointers to GC allocated objects in stack allocated objects.
zerny@chromium.org [Mon, 24 Mar 2014 12:45:09 +0000 (12:45 +0000)]
Don't allow raw pointers to GC allocated objects in stack allocated objects.

BUG=334149
R=haraken@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/197583012

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@258915 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoGlobal cycle detection analysis.
zerny@chromium.org [Mon, 24 Mar 2014 09:38:08 +0000 (09:38 +0000)]
Global cycle detection analysis.

This adds a detect-cycles flag to the plugin which will cause each compilation unit to output a .graph.json file describing the points-to graph of that compilation unit. The process-graph.py script can then be used to process the graph files to detect cycles involving GC roots.

BUG=334149
R=ager@chromium.org

Review URL: https://codereview.chromium.org/207913002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@258898 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

5 months agoOnly check GC dispatch methods for GC derived types.
zerny@chromium.org [Mon, 24 Mar 2014 07:18:43 +0000 (07:18 +0000)]
Only check GC dispatch methods for GC derived types.

BUG=334149
R=haraken@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/209803002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@258885 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoAdd checks for stack-allocated types and their uses in fields.
zerny@chromium.org [Thu, 20 Mar 2014 18:07:49 +0000 (18:07 +0000)]
Add checks for stack-allocated types and their uses in fields.

- If A derives B, then A is stack allocated iff B is stack allocated.
- Fields to stack allocated types can only appear in stack allocated classes.

BUG=334149
R=ager@chromium.org

Review URL: https://codereview.chromium.org/206123004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@258346 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoRename finalize to finalizeGarbageCollectedObject and strengthen its tests.
zerny@chromium.org [Thu, 20 Mar 2014 15:11:45 +0000 (15:11 +0000)]
Rename finalize to finalizeGarbageCollectedObject and strengthen its tests.

We now require that:
- Classes with a finalize dispatch have no vtable.
- Classes with a finalize dispatch define a trace dispatch.
- Classes with a finalize dispatch have a finalized GC base.
- Finalized classes with a trace dispatch define a finalize dispatch.

BUG=352755
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/206263006

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@258307 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoCheck consistency of manual trace and finalization dispatching.
zerny@chromium.org [Tue, 18 Mar 2014 19:09:42 +0000 (19:09 +0000)]
Check consistency of manual trace and finalization dispatching.

This adds checks that overridden trace methods are always virtual and that manual implementations are always on non-virtual/polymorphic classes.
At each subclass definition of a class implementing manual trace/finalize dispatching, the plugin checks for a dispatch to the subclass if possible.

BUG=334149
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/197863003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@257710 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoRevert 257618 "roll clang 198389:202554"
thakis@chromium.org [Tue, 18 Mar 2014 11:57:13 +0000 (11:57 +0000)]
Revert 257618 "roll clang 198389:202554"

A bunch of mac builder bots are still on 10.6 (http://crbug.com/353529)

> roll clang 198389:202554
>
> This change contains several big changes, many of the caused by upstream
> llvm enabling c++11 in their codebase and thus having higher minimum
> requirements for their toolchain and runtime environment:
>
> * clang on OS X now requires libc++, which means it'll only run on OS X 10.7+,
>   so change the deployment target from 10.5 to 10.7 (we were planning on
>   requiring 10.8 or 10.9, see bug 335325, but since several people are waiting
>   on a new clang, let's go to 10.7 only for now and do more as a follow-up)
> * On OS X, the compiler is only usable with libc++ if libc++ is checked out
>   and `make install` is run, so do that for the phase 1 compiler.
>   (Chrome doesn't use libc++ yet, so we don't do that for the bootstrapped
>   compiler.)
> * clang on linux now needs libstdc++ 4.7+ which isn't present on precise.
>   So we now include a newer libstdc++ in the compiler bundle (meaning
>   this clang should still run on precise).
> * clang is broken for android at r202554. To unblock oilpan, merge three
>   later changes into this roll, llvm r202793, r203601, and r203635
>
> Regular, less tricky clang roll stuff:
> * Disable the new warning -Wabsolute-value for now (crbug.com/351479
>   for turning it on)
> * Disable -Wno-tautological-pointer-compare for libxml where it now
>   fires.
> * Since this bundles a new version of the oilpan plugin, bump its suffix to _3
> * Change plugin code to track upstream api change
> * Remove plugin flag check-url-directory as that's now always on
>
> Due to the c++11 stuff, it's likely that this change will get reverted a few times.
>
> BUG=351479, 287029,341352,333968,335325
> TBR=hans@chromium.org
>
> Review URL: https://codereview.chromium.org/195623002

TBR=thakis@chromium.org

Review URL: https://codereview.chromium.org/203313004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@257620 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoroll clang 198389:202554
thakis@chromium.org [Tue, 18 Mar 2014 10:53:25 +0000 (10:53 +0000)]
roll clang 198389:202554

This change contains several big changes, many of the caused by upstream
llvm enabling c++11 in their codebase and thus having higher minimum
requirements for their toolchain and runtime environment:

* clang on OS X now requires libc++, which means it'll only run on OS X 10.7+,
  so change the deployment target from 10.5 to 10.7 (we were planning on
  requiring 10.8 or 10.9, see bug 335325, but since several people are waiting
  on a new clang, let's go to 10.7 only for now and do more as a follow-up)
* On OS X, the compiler is only usable with libc++ if libc++ is checked out
  and `make install` is run, so do that for the phase 1 compiler.
  (Chrome doesn't use libc++ yet, so we don't do that for the bootstrapped
  compiler.)
* clang on linux now needs libstdc++ 4.7+ which isn't present on precise.
  So we now include a newer libstdc++ in the compiler bundle (meaning
  this clang should still run on precise).
* clang is broken for android at r202554. To unblock oilpan, merge three
  later changes into this roll, llvm r202793, r203601, and r203635

Regular, less tricky clang roll stuff:
* Disable the new warning -Wabsolute-value for now (crbug.com/351479
  for turning it on)
* Disable -Wno-tautological-pointer-compare for libxml where it now
  fires.
* Since this bundles a new version of the oilpan plugin, bump its suffix to _3
* Change plugin code to track upstream api change
* Remove plugin flag check-url-directory as that's now always on

Due to the c++11 stuff, it's likely that this change will get reverted a few times.

BUG=351479, 287029,341352,333968,335325
TBR=hans@chromium.org

Review URL: https://codereview.chromium.org/195623002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@257618 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoRename NO_TRACE_CHECKING to GC_PLUGIN_IGNORE and add support for annotating classes...
zerny@chromium.org [Fri, 14 Mar 2014 21:18:10 +0000 (21:18 +0000)]
Rename NO_TRACE_CHECKING to GC_PLUGIN_IGNORE and add support for annotating classes as ignored.

BUG=334149
R=ager@chromium.org

Review URL: https://codereview.chromium.org/196023018

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@257202 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoRelax the check on access to GC managed fields in destructors.
zerny@chromium.org [Fri, 14 Mar 2014 14:38:52 +0000 (14:38 +0000)]
Relax the check on access to GC managed fields in destructors.

We would like to allow safe usage, such as checking that a Member contains null in an assert. With this CL, we disallow the use of the -> and [] operators on fields and also disallow fields to occur as arguments to calls.

BUG=334149
R=ager@chromium.org

Review URL: https://codereview.chromium.org/200033002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@257098 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoCheck that classes with non-trivial destructors have finalization support.
zerny@chromium.org [Fri, 14 Mar 2014 10:45:14 +0000 (10:45 +0000)]
Check that classes with non-trivial destructors have finalization support.

Uses clang's notion of when a class has a 'trivial destructor' to determine when garbage-collected types need finalization.

BUG=334149
NOTRY=true

Review URL: https://codereview.chromium.org/192933002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@257072 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoOnly require tracing of immediate bases if they inherit a non-pure trace method.
zerny@chromium.org [Tue, 11 Mar 2014 15:03:25 +0000 (15:03 +0000)]
Only require tracing of immediate bases if they inherit a non-pure trace method.

This change also checks the formal parameter type is Visitor when identifying tracing methods.

R=ager@chromium.org
BUG=334149
NOTRY=true

Review URL: https://codereview.chromium.org/190543011

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@256229 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoRemove check_url_directory flag from clang plugin.
tfarina@chromium.org [Tue, 11 Mar 2014 11:07:38 +0000 (11:07 +0000)]
Remove check_url_directory flag from clang plugin.

This is now always on.

BUG=287029
TEST=url_unittets builds under clang plugin without warnings/errors.
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/185543003

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@256191 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoCheck some finalization properties.
zerny@chromium.org [Wed, 5 Mar 2014 18:59:31 +0000 (18:59 +0000)]
Check some finalization properties.

  - Classes that have a user-declared destructor must inherit from a finalized GC base.
  - Destructors in GC derived class must not access GC managed fields.

BUG=334149
R=ager@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/187483004

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@255109 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoUpdate oilpan plugin, now includes plugin code as of r255054.
thakis@chromium.org [Wed, 5 Mar 2014 18:45:46 +0000 (18:45 +0000)]
Update oilpan plugin, now includes plugin code as of r255054.

As described on https://code.google.com/p/chromium/wiki/UpdatingClang ,
lower part.

We replaced the existing clang-198389.tgz package on googlestorage
with a new one that's identical to the old one (same compiler binary) except
that there's now a libBlinkPlugin_2.so in the package too. That so isn't used
yet, so this shouldn't have a behavior change (except that it'll cause runhooks
to update everyone's clang packages to the one including the plugin.)

BUG=334149
R=zerny@chromium.org

Review URL: https://codereview.chromium.org/185943005

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@255100 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoAdd GarbageCollectedMixin as a GC base.
zerny@chromium.org [Wed, 5 Mar 2014 10:19:59 +0000 (10:19 +0000)]
Add GarbageCollectedMixin as a GC base.

BUG=334149
R=ager@chromium.org, vegorov@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/177653011

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@254998 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoCheck correct smart-pointer usage.
zerny@chromium.org [Wed, 5 Mar 2014 01:32:36 +0000 (01:32 +0000)]
Check correct smart-pointer usage.

 * Check that OwnPtr, RefPtr and raw-pointer fields don't point to GC derived types.
 * Inside GC derived class, check that fields don't define GC roots.

BUG=334149
R=ager@chromium.org, vegorov@chromium.org, thakis@chromium.org

Review URL: https://codereview.chromium.org/184103014

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@254902 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoAdded edge hierarchy describing the pointer structure of record fields.
zerny@chromium.org [Tue, 4 Mar 2014 08:52:05 +0000 (08:52 +0000)]
Added edge hierarchy describing the pointer structure of record fields.

BUG=334149

Review URL: https://codereview.chromium.org/178663009

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@254736 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoTurn on clang plugin checks for //url directory.
tfarina@chromium.org [Mon, 3 Mar 2014 14:51:09 +0000 (14:51 +0000)]
Turn on clang plugin checks for //url directory.

Once this sticks, the check can be removed entirely.

BUG=287029
R=thakis@chromium.org

Review URL: https://codereview.chromium.org/183763018

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@254463 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoMake TracingStatus an immutable value.
zerny@chromium.org [Fri, 28 Feb 2014 15:39:36 +0000 (15:39 +0000)]
Make TracingStatus an immutable value.

This change also removes weakness related code which will be implemented differently in a subsequent CL.

BUG=334149
R=ager@chromium.org

Review URL: https://codereview.chromium.org/182313006

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@254131 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoCleanup Blink GC config and add support for persistent heap collections.
zerny@chromium.org [Thu, 27 Feb 2014 17:18:21 +0000 (17:18 +0000)]
Cleanup Blink GC config and add support for persistent heap collections.

BUG=334149
R=ager@chromium.org

Review URL: https://codereview.chromium.org/182703002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@253850 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoCheck tracing of fields and base classes in trace-method bodies.
zerny@chromium.org [Wed, 26 Feb 2014 19:49:53 +0000 (19:49 +0000)]
Check tracing of fields and base classes in trace-method bodies.

Errors are described at:
http://www.chromium.org/developers/blink-gc-plugin-errors

BUG=334149
R=thakis@chromium.org, ager@chromium.org

Review URL: https://codereview.chromium.org/179873005

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@253562 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

6 months agoRequire trace methods on structures with fields that need tracing.
zerny@chromium.org [Wed, 26 Feb 2014 07:27:00 +0000 (07:27 +0000)]
Require trace methods on structures with fields that need tracing.

This CL checks that trace methods are declared based on the class/struct fields.
Errors are described at:
http://www.chromium.org/developers/blink-gc-plugin-errors

To avoid erroneous checks, the STACK_ALLOCATED macro can be used to
mark a structure as only allocated on the stack, and the
NO_TRACE_CHECKING macro can be used to ignore a field for the
purpose of trace checking.

BUG=334149
R=haraken@chromium.org, thakis@chromium.org, vegorov@chromium.org, wibling@chromium.org
NOTRY=true

Review URL: https://codereview.chromium.org/163603002

git-svn-id: http://src.chromium.org/svn/trunk/src/tools/clang@253389 4ff67af0-8c30-449e-8e8b-ad334ec8d88c