]> granicus.if.org Git - clang/log
clang
8 years ago[MS ABI] Don't zero-initialize vbptrs in bases
David Majnemer [Mon, 2 Nov 2015 09:01:44 +0000 (09:01 +0000)]
[MS ABI] Don't zero-initialize vbptrs in bases

Certain CXXConstructExpr nodes require zero-initialization before a
constructor is called.  We had a bug in the case where the constructor
is called on a virtual base: we zero-initialized the base's vbptr field.
A complementary bug is present in MSVC where no zero-initialization
occurs for the subobject at all.

This fixes PR25370.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251783 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: Be slightly more cautious when formatting subsequent lines after a...
Daniel Jasper [Sun, 1 Nov 2015 00:27:35 +0000 (00:27 +0000)]
clang-format: Be slightly more cautious when formatting subsequent lines after a change. With r251474, clang-format could indent the entire rest of the file, if there is a missing closing brace, e.g. while writing code in an editor.

Summary:
With this change, clang-format stops formatting when either it leaves
the current scope or when it comes back to the initial scope after
going into a nested one.

Reviewers: klimek

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251760 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MSVC Compat] Permit conversions from pointer-to-function to pointer-to-object iff...
David Majnemer [Sat, 31 Oct 2015 08:42:14 +0000 (08:42 +0000)]
[MSVC Compat] Permit conversions from pointer-to-function to pointer-to-object iff -fms-compatibility

We permit implicit conversion from pointer-to-function to
pointer-to-object when -fms-extensions is specified.  This is rather
unfortunate, move this into -fms-compatibility and only permit it within
system headers unless -Wno-error=microsoft-cast is specified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251738 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGen] Call SetInternalFunctionAttributes to attach function
Akira Hatanaka [Sat, 31 Oct 2015 01:28:07 +0000 (01:28 +0000)]
[CodeGen] Call SetInternalFunctionAttributes to attach function
attributes to internal functions.

This patch fixes CodeGenModule::CreateGlobalInitOrDestructFunction to
use SetInternalFunctionAttributes instead of SetLLVMFunctionAttributes
to attach function attributes to internal functions.

Also, make sure the correct CGFunctionInfo is passed instead of always
passing what arrangeNullaryFunction returns.

rdar://problem/20828324

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251734 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSema: correct typo recovery with blocks
Saleem Abdulrasool [Sat, 31 Oct 2015 00:39:15 +0000 (00:39 +0000)]
Sema: correct typo recovery with blocks

Handle blocks in the tree transform for the typo correction as otherwise, the
capture may miss.  This would trigger an assertion.  Thanks to Doug Gregor for
the help with this!

Fixes PR25001.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251729 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCGExprConstant.cpp: Appease Modules.
NAKAMURA Takumi [Fri, 30 Oct 2015 16:37:27 +0000 (16:37 +0000)]
CGExprConstant.cpp: Appease Modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251713 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSupport watchOS and tvOS in compiler-rt builds
Tim Northover [Fri, 30 Oct 2015 16:30:51 +0000 (16:30 +0000)]
Support watchOS and tvOS in compiler-rt builds

Hopefully autotools will be deprecated soon and this entire file can go away,
but until then...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251712 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSupport tvOS and watchOS availability attributes
Tim Northover [Fri, 30 Oct 2015 16:30:49 +0000 (16:30 +0000)]
Support tvOS and watchOS availability attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251711 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoARMv7k: implement ABI changes for watchOS from standard iOS.
Tim Northover [Fri, 30 Oct 2015 16:30:45 +0000 (16:30 +0000)]
ARMv7k: implement ABI changes for watchOS from standard iOS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251710 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDisable SjLj exceptions for watchOS
Tim Northover [Fri, 30 Oct 2015 16:30:41 +0000 (16:30 +0000)]
Disable SjLj exceptions for watchOS

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251709 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWatch and TV OS: wire up basic ABI choices
Tim Northover [Fri, 30 Oct 2015 16:30:36 +0000 (16:30 +0000)]
Watch and TV OS: wire up basic ABI choices

This sets the mostly expected Darwin default ABI options for these two
platforms. Active changes from these defaults for watchOS are in a later patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251708 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPreprocessor: define correct tvOS and watchOS version macros
Tim Northover [Fri, 30 Oct 2015 16:30:30 +0000 (16:30 +0000)]
Preprocessor: define correct tvOS and watchOS version macros

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251707 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSupport watchOS and tvOS driver options
Tim Northover [Fri, 30 Oct 2015 16:30:27 +0000 (16:30 +0000)]
Support watchOS and tvOS driver options

This patch should add support for almost all command-line options and
driver tinkering necessary to produce a correct "clang -cc1"
invocation for watchOS and tvOS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251706 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModules: Add a declaration in clang/Serialization/GlobalModuleIndex.h.
NAKAMURA Takumi [Fri, 30 Oct 2015 15:54:34 +0000 (15:54 +0000)]
Modules: Add a declaration in clang/Serialization/GlobalModuleIndex.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251703 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReapply r251621 "[Analyzer] Widening loops which do not exit"
Sean Eveson [Fri, 30 Oct 2015 15:23:57 +0000 (15:23 +0000)]
Reapply r251621 "[Analyzer] Widening loops which do not exit"

It was not the cause of the build bot failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251702 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang/module.modulemap: Exclude Frontend/PCHContainerOperations.h in Clang_Frontend.
NAKAMURA Takumi [Fri, 30 Oct 2015 15:14:55 +0000 (15:14 +0000)]
clang/module.modulemap: Exclude Frontend/PCHContainerOperations.h in Clang_Frontend.

FIXME: It should be dissolved to interface and impl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251701 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "[mips] Add support for the new mips-mti-linux toolchain."
Vasileios Kalintiris [Fri, 30 Oct 2015 11:28:39 +0000 (11:28 +0000)]
Revert "[mips] Add support for the new mips-mti-linux toolchain."

This reverts commits r251633. I'll investigate the test failure off trunk in
order to keep the buildbots clean.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251698 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert r251621 "[Analyzer] Widening loops which do not exit" (bot failure)
Sean Eveson [Fri, 30 Oct 2015 11:13:07 +0000 (11:13 +0000)]
Revert r251621 "[Analyzer] Widening loops which do not exit" (bot failure)

Seems to be causing clang-cmake-mips build bot to fail (timeout)

http://lab.llvm.org:8011/builders/clang-cmake-mips/builds/10299

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251697 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRevert "Try to run and investigate the mips-mti-linux.c test failure on ARM buildbots."
Renato Golin [Fri, 30 Oct 2015 11:12:36 +0000 (11:12 +0000)]
Revert "Try to run and investigate the mips-mti-linux.c test failure on ARM buildbots."

This reverts commit r251695. Debug is meant to be done off tree, not use the buildbots
experiments. I'll help investigate this problem off trunk.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251696 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTry to run and investigate the mips-mti-linux.c test failure on ARM buildbots.
Vasileios Kalintiris [Fri, 30 Oct 2015 10:35:38 +0000 (10:35 +0000)]
Try to run and investigate the mips-mti-linux.c test failure on ARM buildbots.

This should be a NFC for every toolchain other than mips-mti-linux (where we
print the list of directories searched for crt files). It will soon be
reverted once we hit the clang-cmake-armv7-a15-selfhost-neon buildbot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251695 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd "equalsNode" for types and "isCopyAssignmentOperator" matchers.
Angel Garcia Gomez [Fri, 30 Oct 2015 09:35:51 +0000 (09:35 +0000)]
Add "equalsNode" for types and "isCopyAssignmentOperator" matchers.

Summary: This matchers are going to be used in modernize-use-default, but are generic enough to be placed in ASTMatchers.h.

Reviewers: klimek

Subscribers: alexfh, cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251693 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUpdate debug-info-scope test to remove "FIXME", which is fixed in r251689
Dehao Chen [Fri, 30 Oct 2015 05:08:43 +0000 (05:08 +0000)]
Update debug-info-scope test to remove "FIXME", which is fixed in r251689

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251691 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFormat: support inline namespaces
Saleem Abdulrasool [Fri, 30 Oct 2015 05:07:56 +0000 (05:07 +0000)]
Format: support inline namespaces

Correct handling for C++17 inline namespaces.  We would previously fail to
identify the inline namespaces as a namespace name since multiple ones may be
concatenated now with C++17.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251690 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoInitialize @catch variables correctly in fragile-runtime ARC.
John McCall [Fri, 30 Oct 2015 00:56:02 +0000 (00:56 +0000)]
Initialize @catch variables correctly in fragile-runtime ARC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251677 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix the emission of ARC ivar layouts in the non-fragile Mac runtime.
John McCall [Thu, 29 Oct 2015 23:36:14 +0000 (23:36 +0000)]
Fix the emission of ARC ivar layouts in the non-fragile Mac runtime.

My previous change in this area accidentally broke the rule when
InstanceBegin was not a multiple of the word size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251666 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMark InternalDebugOpt driver options as CoreOptions.
Nico Weber [Thu, 29 Oct 2015 20:53:49 +0000 (20:53 +0000)]
Mark InternalDebugOpt driver options as CoreOptions.

Mostly has the effect of making -ccc-print-phases usable from clang-cl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251653 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd support for __builtin_{add,sub,mul}_overflow.
John McCall [Thu, 29 Oct 2015 20:48:01 +0000 (20:48 +0000)]
Add support for __builtin_{add,sub,mul}_overflow.

Patch by David Grayson!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251651 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSuppress uninteresting output from crash-recovery-modules.m
Nico Weber [Thu, 29 Oct 2015 20:43:31 +0000 (20:43 +0000)]
Suppress uninteresting output from crash-recovery-modules.m

No behavior change, but it makes this test a bit easier to debug when it fails.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251650 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: [JS] Add goog.setTestOnly to the list of stuff that
Daniel Jasper [Thu, 29 Oct 2015 19:05:20 +0000 (19:05 +0000)]
clang-format: [JS] Add goog.setTestOnly to the list of stuff that
is import-statement-like and shouldn't be wrapped.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251643 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoadd support of the latest Ubuntu (Xenial Xerus)
Sylvestre Ledru [Thu, 29 Oct 2015 17:27:55 +0000 (17:27 +0000)]
add support of the latest Ubuntu (Xenial Xerus)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251639 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a link to the DXR project
Ehsan Akhgari [Thu, 29 Oct 2015 17:20:17 +0000 (17:20 +0000)]
Add a link to the DXR project

DXR is a project developed at Mozilla that implements a code indexing
and browsing utility on top of libclang that has features such as
call graph querying.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251638 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Add support for the new mips-mti-linux toolchain.
Vasileios Kalintiris [Thu, 29 Oct 2015 15:33:53 +0000 (15:33 +0000)]
[mips] Add support for the new mips-mti-linux toolchain.

The original commit in r249137 added the mips-mti-linux toolchain. However,
the newly added tests of that commit failed in few buildbots. This commit
re-applies the original changes but XFAILs the test file which caused
the buildbot failures. This will allow us to examine what's going wrong
without having to commit/revert large changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251633 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Analyzer] Widening loops which do not exit
Sean Eveson [Thu, 29 Oct 2015 10:04:41 +0000 (10:04 +0000)]
[Analyzer] Widening loops which do not exit

Summary:
Dear All,

We have been looking at the following problem, where any code after the constant bound loop is not analyzed because of the limit on how many times the same block is visited, as described in bugzillas #7638 and #23438. This problem is of interest to us because we have identified significant bugs that the checkers are not locating. We have been discussing a solution involving ranges as a longer term project, but I would like to propose a patch to improve the current implementation.

Example issue:
```
for (int i = 0; i < 1000; ++i) {...something...}
int *p = 0;
*p = 0xDEADBEEF;
```

The proposal is to go through the first and last iterations of the loop. The patch creates an exploded node for the approximate last iteration of constant bound loops, before the max loop limit / block visit limit is reached. It does this by identifying the variable in the loop condition and finding the value which is “one away” from the loop being false. For example, if the condition is (x < 10), then an exploded node is created where the value of x is 9. Evaluating the loop body with x = 9 will then result in the analysis continuing after the loop, providing x is incremented.

The patch passes all the tests, with some modifications to coverage.c, in order to make the ‘function_which_gives_up’ continue to give up, since the changes allowed the analysis to progress past the loop.

This patch does introduce possible false positives, as a result of not knowing the state of variables which might be modified in the loop. I believe that, as a user, I would rather have false positives after loops than do no analysis at all. I understand this may not be the common opinion and am interested in hearing your views. There are also issues regarding break statements, which are not considered. A more advanced implementation of this approach might be able to consider other conditions in the loop, which would allow paths leading to breaks to be analyzed.

Lastly, I have performed a study on large code bases and I think there is little benefit in having “max-loop” default to 4 with the patch. For variable bound loops this tends to result in duplicated analysis after the loop, and it makes little difference to any constant bound loop which will do more than a few iterations. It might be beneficial to lower the default to 2, especially for the shallow analysis setting.

Please let me know your opinions on this approach to processing constant bound loops and the patch itself.

Regards,

Sean Eveson
SN Systems - Sony Computer Entertainment Group

Reviewers: jordan_rose, krememek, xazax.hun, zaks.anna, dcoughlin

Subscribers: krememek, xazax.hun, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251621 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix a soon to be invalid test
Xinliang David Li [Thu, 29 Oct 2015 04:04:07 +0000 (04:04 +0000)]
Fix a soon to be invalid test

Remove a check that won't be valid when LLVM stops
emitting runtime hook user function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251611 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agotest: fix overzealous match
Saleem Abdulrasool [Thu, 29 Oct 2015 03:52:14 +0000 (03:52 +0000)]
test: fix overzealous match

Accidentally made the test too strict.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251603 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDriver: CrossWindows sanitizers link support
Saleem Abdulrasool [Thu, 29 Oct 2015 03:36:45 +0000 (03:36 +0000)]
Driver: CrossWindows sanitizers link support

Add the required libraries to the linker invocation when building with
sanitizers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251600 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDriver: inline some small arrays
Saleem Abdulrasool [Thu, 29 Oct 2015 03:36:42 +0000 (03:36 +0000)]
Driver:  inline some small arrays

Use an initializer list to remove a couple of small static arrays.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251599 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDriver: tweak CrossWindows sanitizer support
Saleem Abdulrasool [Thu, 29 Oct 2015 03:36:38 +0000 (03:36 +0000)]
Driver: tweak CrossWindows sanitizer support

Indicate support for ASAN on the CrossWindows toolchain.  Although this is
insufficient, this at least permits the handling of the driver flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251598 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Update analyzer website for release of checker-277.
Devin Coughlin [Thu, 29 Oct 2015 01:23:57 +0000 (01:23 +0000)]
[analyzer] Update analyzer website for release of checker-277.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251591 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[Sema] Implement -Wdouble-promotion for clang.
George Burgess IV [Thu, 29 Oct 2015 00:28:52 +0000 (00:28 +0000)]
[Sema] Implement -Wdouble-promotion for clang.

GCC has a warning called -Wdouble-promotion, which warns you when
an implicit conversion increases the width of a floating point type.

This is useful when writing code for architectures that can perform
hardware FP ops on floats, but must fall back to software emulation for
larger types (i.e. double, long double).

This fixes PR15109 <https://llvm.org/bugs/show_bug.cgi?id=15109>.

Thanks to Carl Norum for the patch!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251588 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[WinEH] Mark calls inside cleanups as noinline
Reid Kleckner [Wed, 28 Oct 2015 23:06:42 +0000 (23:06 +0000)]
[WinEH] Mark calls inside cleanups as noinline

This works around PR25162. The MSVC tables make it very difficult to
correctly inline a C++ destructor that contains try / catch.  We've
attempted to address PR25162 in LLVM's backend, but it feels pretty
infeasible.  MSVC and ICC both appear to avoid inlining such complex
destructors.

Long term, we want to fix this by making the inliner smart enough to
know when it is inlining into a cleanup, so it can inline simple
destructors (~unique_ptr and ~vector) while avoiding destructors
containing try / catch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251576 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix the calling convention of Mingw64 long double values
Reid Kleckner [Wed, 28 Oct 2015 22:29:52 +0000 (22:29 +0000)]
Fix the calling convention of Mingw64 long double values

GCC uses the x87DoubleExtended model for long doubles, and passes them
indirectly by address through function calls.

Also replace the existing mingw-long-double assembly emitting test with
an IR-level test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251567 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFix missing builtin identifier infos with PCH+modules
Ben Langmuir [Wed, 28 Oct 2015 22:25:37 +0000 (22:25 +0000)]
Fix missing builtin identifier infos with PCH+modules

Use the *current* state of "is-moduleness" rather than the state at
serialization time so that if we read a builtin identifier from a module
that wasn't "interesting" to that module, we will still write it out to
a PCH that imports that module.

Otherwise, we would get mysterious "unknown builtin" errors when using
PCH+modules.

rdar://problem/23287656

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251565 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Preserve the order checkers were enabled/disabled.
Anton Yartsev [Wed, 28 Oct 2015 20:43:39 +0000 (20:43 +0000)]
[analyzer] Preserve the order checkers were enabled/disabled.

In addition to r251524: preserve the order the checkers were enabled/disabled to be deterministic.
Additionally return the number of arguments read by 'ProcessArgs' - for debug purpose.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251552 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMove global classes into anonymous namespaces. NFC.
Benjamin Kramer [Wed, 28 Oct 2015 17:16:26 +0000 (17:16 +0000)]
Move global classes into anonymous namespaces. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251528 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Make inclusion/exclusion of checkers less ambiguous.
Anton Yartsev [Wed, 28 Oct 2015 16:28:57 +0000 (16:28 +0000)]
[analyzer] Make inclusion/exclusion of checkers less ambiguous.

A checker may be enabled/disabled multiple times via -enable-checker and -disable-checker scan-build arguments. Currently the conflicting and repetitive arguments are passed to the analyzer as is.
With this patch only the last enable/disable of a particular checker is accepted and passed to the analyzer.
This change is mostly done for the upcoming 'config for scan-build' patch when multiple inclusions/exclusions of a checker are expected to be more common.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251524 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoPut global classes into the appropriate namespace.
Benjamin Kramer [Wed, 28 Oct 2015 13:54:16 +0000 (13:54 +0000)]
Put global classes into the appropriate namespace.

Most of the cases belong into an anonymous namespace. No functionality
change intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251514 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWhen running clang with an arm triple such as '--target=thumbv7m-none-eabi'
Alexandros Lamprineas [Wed, 28 Oct 2015 10:10:03 +0000 (10:10 +0000)]
When running clang with an arm triple such as '--target=thumbv7m-none-eabi'
that has a thumb only CPU by default (cortex-m3), and when using the assembler,
the default thumb state of the CPU does not get passed via the triple to LLVM:

$ clang -target thumbv7m-none-eabi -c -v test.s
clang -cc1as ... -triple armv7m-none--eabi ... test.s

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251507 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoReflow comment.
Eric Christopher [Wed, 28 Oct 2015 06:56:25 +0000 (06:56 +0000)]
Reflow comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251501 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRefine r251469 to give better (and more localizable) diagnostics
John McCall [Wed, 28 Oct 2015 05:03:19 +0000 (05:03 +0000)]
Refine r251469 to give better (and more localizable) diagnostics
for all the reasons that ARC makes things implicitly unavailable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251496 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDriver: support -fuse-ld= on cross windows
Saleem Abdulrasool [Wed, 28 Oct 2015 04:45:58 +0000 (04:45 +0000)]
Driver: support -fuse-ld= on cross windows

Update the linker selection to support the `-fuse-ld=` option for selecting a
linker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251493 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd a test case for r251476.
Akira Hatanaka [Wed, 28 Oct 2015 02:32:19 +0000 (02:32 +0000)]
Add a test case for r251476.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251477 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[CodeGen] Attach function attributes to Objective-C and OpenMP
Akira Hatanaka [Wed, 28 Oct 2015 02:30:47 +0000 (02:30 +0000)]
[CodeGen] Attach function attributes to Objective-C and OpenMP
functions.

This commit fixes a bug in CGOpenMPRuntime.cpp and CGObjC.cpp where
some of the function attributes are not attached to newly created
functions.

rdar://problem/20828324

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251476 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: When a line is formatted, also format subsequence lines if their indent...
Daniel Jasper [Wed, 28 Oct 2015 01:08:22 +0000 (01:08 +0000)]
clang-format: When a line is formatted, also format subsequence lines if their indent is off.

Summary: This is especially important so that if a change is solely inserting a block around a few statements, clang-format-diff.py will still clean up and add indentation to the inner parts.

Reviewers: klimek

Subscribers: cfe-commits, klimek

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251474 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAdd the ability to define "fake" arguments on attributes.
John McCall [Wed, 28 Oct 2015 00:17:34 +0000 (00:17 +0000)]
Add the ability to define "fake" arguments on attributes.

Fake arguments are automatically handled for serialization, cloning,
and other representational tasks, but aren't included in pretty-printing
or parsing (should we eventually ever automate that).

This is chiefly useful for attributes that can be written by the
user, but which are also frequently synthesized by the compiler,
and which we'd like to remember details of the synthesis for.
As a simple example, use this to narrow the cases in which we were
generating a specialized note for implicitly unavailable declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251469 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: Increase cut-off limit for number of analyzed states.
Daniel Jasper [Tue, 27 Oct 2015 22:55:55 +0000 (22:55 +0000)]
clang-format: Increase cut-off limit for number of analyzed states.

With more complex structures in C++ Lambdas and JavaScript function
literals, the old value was simply to small. However, this is a
temporary solution, I need to look at this more closely a) to find a
fundamentally better approach and b) to look at whether the more recent
usage of NoLineBreak makes us visit stuff in an unfortunate order
where clang-format waste many states in dead ends.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251463 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMinor fix in ToolChainTest.cpp to allow user defined GCC toolchain.
Samuel Antao [Tue, 27 Oct 2015 22:20:26 +0000 (22:20 +0000)]
Minor fix in ToolChainTest.cpp to allow user defined GCC toolchain.

If the user configured clang with a custom GCC toolchain that will take precedence on what the ToolChainTest.cpp expects to evaluate.
This is fixed here by passing --gcc-toolchain= to the driver, in order to override any user defined GCC toolchain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251459 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Assume escape is possible through system functions taking void*
Anna Zaks [Tue, 27 Oct 2015 20:19:45 +0000 (20:19 +0000)]
[analyzer] Assume escape is possible through system functions taking void*
The analyzer assumes that system functions will not free memory or modify the
arguments in other ways, so we assume that arguments do not escape when
those are called. However, this may lead to false positive leak errors. For
example, in code like this where the pointers added to the rb_tree are freed
later on:

struct alarm_event *e = calloc(1, sizeof(*e));
<snip>

rb_tree_insert_node(&alarm_tree, e);

Add a heuristic to assume that calls to system functions taking void*
arguments allow for pointer escape.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251449 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Enhance FAQ with instructions on handing unused variables.
Anna Zaks [Tue, 27 Oct 2015 20:19:38 +0000 (20:19 +0000)]
[analyzer] Enhance FAQ with instructions on handing unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251448 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoTweak how -Wunused-value interacts with macros
Nico Weber [Tue, 27 Oct 2015 19:47:40 +0000 (19:47 +0000)]
Tweak how -Wunused-value interacts with macros

1. Make the warning more strict in C mode. r172696 added code to suppress
   warnings from macro expansions in system headers, which checks
   `SourceMgr.isMacroBodyExpansion(E->IgnoreParens()->getExprLoc())`. Consider
   this snippet:

   #define FOO(x) (x)
   void f(int a) {
     FOO(a);
   }

   In C, the line `FOO(a)` is an `ImplicitCastExpr(ParenExpr(DeclRefExpr))`,
   while it's just a `ParenExpr(DeclRefExpr)` in C++. So in C++,
   `E->IgnoreParens()` returns the `DeclRefExpr` and the check tests the
   SourceLoc of `a`. In C, the `ImplicitCastExpr` has the effect of checking the
   SourceLoc of `FOO`, which is a macro body expansion, which causes the
   diagnostic to be skipped. It looks unintentional that clang does different
   things for C and C++ here, so use `IgnoreParenImpCasts` instead of
   `IgnoreParens` here. This has the effect of the warning firing more often
   than previously in C code – it now fires as often as it fires in C++ code.

2. Suppress the warning if it would warn on `UNREFERENCED_PARAMETER`.
   `UNREFERENCED_PARAMETER` is a commonly used macro on Windows and it happens
   to uselessly trigger -Wunused-value. As discussed in the thread
   "rfc: winnt.h's UNREFERENCED_PARAMETER() vs clang's -Wunused-value" on
   cfe-dev, fix this by special-casing this specific macro. (This costs a string
   comparison and some fast-path lexing per warning, but the warning is emitted
   rarely. It fires once in Windows.h itself, so this code runs at least once
   per TU including Windows.h, but it doesn't run hundreds of times.)

http://reviews.llvm.org/D13969

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251441 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove unused diagnostic. NFC.
Benjamin Kramer [Tue, 27 Oct 2015 18:34:47 +0000 (18:34 +0000)]
Remove unused diagnostic. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251432 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[mips] Separated mips specific -Wa options, so that they are not checked on other...
Daniel Sanders [Tue, 27 Oct 2015 18:04:42 +0000 (18:04 +0000)]
[mips] Separated mips specific -Wa options, so that they are not checked on other platforms.

Summary: This is a follow on to post review comments on revision r248276.

Patch by Scott Egerton.

Reviewers: vkalintiris, dsanders

Subscribers: joerg, rengolin, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251430 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAllow linking multiple bitcode files.
Artem Belevich [Tue, 27 Oct 2015 17:56:59 +0000 (17:56 +0000)]
Allow linking multiple bitcode files.

Linking options for particular file depend on the option that specifies the file.
Currently there are two:

* -mlink-bitcode-file links in complete content of the specified file.
* -mlink-cuda-bitcode links in only the symbols needed by current TU.
   Linked symbols are internalized. This bitcode linking mode is used to
   link device-specific bitcode provided by CUDA.

Files are linked in order they are specified on command line.

-mlink-cuda-bitcode replaces -fcuda-uses-libdevice flag.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251427 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ms-inline-asm] Test case for alignment directive change in LLVM r251418
Reid Kleckner [Tue, 27 Oct 2015 17:34:29 +0000 (17:34 +0000)]
[ms-inline-asm] Test case for alignment directive change in LLVM r251418

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251419 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MSVC] Workaround for ICE in cl.exe when compiling ASTContext.cpp in Release Win32
Will Wilson [Tue, 27 Oct 2015 17:01:10 +0000 (17:01 +0000)]
[MSVC] Workaround for ICE in cl.exe when compiling ASTContext.cpp in Release Win32

Microsoft connect bug: https://connect.microsoft.com/VisualStudio/feedback/details/1741530

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251415 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWiden this enum bitfield by one bit to prevent sign extension in MSVC
Reid Kleckner [Tue, 27 Oct 2015 16:24:03 +0000 (16:24 +0000)]
Widen this enum bitfield by one bit to prevent sign extension in MSVC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251412 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoIndex: expose is_mutable_field
Saleem Abdulrasool [Tue, 27 Oct 2015 15:50:22 +0000 (15:50 +0000)]
Index: expose is_mutable_field

Expose isMutable via libClang and python bindings.

Patch by Jonathan B Coe!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251410 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Fix lambdas that are capturing constants.
Gabor Horvath [Tue, 27 Oct 2015 13:46:39 +0000 (13:46 +0000)]
[analyzer] Fix lambdas that are capturing constants.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251407 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: Undo unwanted format change done in r251405.
Daniel Jasper [Tue, 27 Oct 2015 13:42:08 +0000 (13:42 +0000)]
clang-format: Undo unwanted format change done in r251405.

Specifically, don't wrap between the {} of an empty constructor if the
"}" falls on column 81 and ConstructorInitializerAllOnOneLineOrOnePerLine
is set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251406 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: Add an additional value to AlignAfterOpenBracket: AlwaysBreak.
Daniel Jasper [Tue, 27 Oct 2015 12:38:37 +0000 (12:38 +0000)]
clang-format: Add an additional value to AlignAfterOpenBracket: AlwaysBreak.

Summary:
If this option is set, clang-format will always insert a line wrap, e.g.
before the first parameter of a function call unless all parameters fit
on the same line. This obviates the need to make a decision on the
alignment itself.

Use this style for Google's JavaScript style and add some minor tweaks
to correctly handle nested blocks etc. with it. Don't use this option
for for/while loops.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251405 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Fix another crash when analyzing lambda functions.
Gabor Horvath [Tue, 27 Oct 2015 12:36:26 +0000 (12:36 +0000)]
[analyzer] Fix another crash when analyzing lambda functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251404 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoProperly clear current coroutine promise on FunctionScopeInfo reuse. Should
Richard Smith [Tue, 27 Oct 2015 07:47:45 +0000 (07:47 +0000)]
Properly clear current coroutine promise on FunctionScopeInfo reuse. Should
hopefully make bots happy again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251397 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoAccess the right triple field for IAMCU.
Michael Kuperstein [Tue, 27 Oct 2015 07:46:22 +0000 (07:46 +0000)]
Access the right triple field for IAMCU.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251396 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoWork around incomplete list initialization support in older MSVC.
Richard Smith [Tue, 27 Oct 2015 07:25:29 +0000 (07:25 +0000)]
Work around incomplete list initialization support in older MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251391 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoHandle target builtin options that are all required rather than
Eric Christopher [Tue, 27 Oct 2015 06:11:03 +0000 (06:11 +0000)]
Handle target builtin options that are all required rather than
only one of a group of possibilities.

This changes the syntax in the builtin files to represent:

, as the and operator
| as the or operator

The former syntax matches how the backend tablegen files represent
multiple subtarget features being required.

Updated the builtin and intrinsic headers accordingly for the new
syntax.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251388 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[coroutines] Creation of promise object, lookup of operator co_await, building
Richard Smith [Tue, 27 Oct 2015 06:02:45 +0000 (06:02 +0000)]
[coroutines] Creation of promise object, lookup of operator co_await, building
of await_* calls, and AST representation for same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251387 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoCreate undef reference to profile hook symbol
Xinliang David Li [Tue, 27 Oct 2015 05:15:35 +0000 (05:15 +0000)]
Create undef reference to profile hook symbol

Create undef reference to profile hook symbol when
PGO instrumentation is turned on. This allows
LLVM to omit emission of hook variable use method
for every single module instrumented.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251385 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoBe more conservative about diagnosing "incorrect" uses of __weak:
John McCall [Tue, 27 Oct 2015 04:54:50 +0000 (04:54 +0000)]
Be more conservative about diagnosing "incorrect" uses of __weak:
allow them to be written in certain kinds of user declaration and
diagnose on the use-site instead.

Also, improve and fix some diagnostics relating to __weak and
properties.

rdar://23228631

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251384 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse early exits to reduce indentation.
Eric Christopher [Tue, 27 Oct 2015 00:06:21 +0000 (00:06 +0000)]
Use early exits to reduce indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251371 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoMismatchingNewDeleteDetector uses incorrect field, and finds no initializer
Ismail Pazarbasi [Mon, 26 Oct 2015 19:20:24 +0000 (19:20 +0000)]
MismatchingNewDeleteDetector uses incorrect field, and finds no initializer

Summary:
In `MismatchingNewDeleteDetector::analyzeInClassInitializer`, if
`Field`'s initializer expression is null, lookup the field in
implicit instantiation, and use found field's the initializer.

Reviewers: rsmith, rtrieu

Subscribers: cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251335 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Added a missing test case for r251289.
Gabor Horvath [Mon, 26 Oct 2015 17:42:14 +0000 (17:42 +0000)]
[analyzer] Added a missing test case for r251289.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251313 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] ccc-analyzer: Fix -isystem value passing.
Devin Coughlin [Mon, 26 Oct 2015 17:19:51 +0000 (17:19 +0000)]
[analyzer] ccc-analyzer: Fix -isystem value passing.

The regex for -isystem matching is broken. -[D,I,Usystem] matches "-D", "-,",
"-I", "-U", "-s" "-y", etc. Besides that, "-isystem /foo" gets interpreted as
"-i" with a non-empty value "system" and thus the next "/foo" argument is not
read. This patch corrects the regex.

This fixes PR13237 <https://llvm.org/bugs/show_bug.cgi?id=13237>.

A patch by Peter Wu!

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251312 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] Fixed a rare crash when analyzing lambda functions.
Gabor Horvath [Mon, 26 Oct 2015 13:32:26 +0000 (13:32 +0000)]
[analyzer] Fixed a rare crash when analyzing lambda functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251289 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang-format: Fix false positive in cast detection.
Daniel Jasper [Mon, 26 Oct 2015 12:08:47 +0000 (12:08 +0000)]
clang-format: Fix false positive in cast detection.

Before (with spaces in parentheses):
  void inFunction() { std::function<void( int, int )> fct; }

After:
  void inFunction() { std::function<void( int, int)> fct; }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251284 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[X86] Mark inregs correctly for MCU psABI
Michael Kuperstein [Sun, 25 Oct 2015 08:18:20 +0000 (08:18 +0000)]
[X86] Mark inregs correctly for MCU psABI

The MCU psABI calling convention is somewhat, but not quite, like -mregparm 3.
In particular, the rules involving structs are different.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251224 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[analyzer] scan-build: Teach ccc-analyzer about -Xclang.
Devin Coughlin [Sun, 25 Oct 2015 01:30:18 +0000 (01:30 +0000)]
[analyzer] scan-build: Teach ccc-analyzer about -Xclang.

Update ccc-analyzer to forward both -Xclang and its following argument to the
the compiler driver. Previously we were dropping -Xclang and forwarding the
argument on its own if it matched other forwarding criteria. This caused the
argument to be interpreted as a driver rather than a frontend option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251218 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoSimplify boolean conditional return statements in lib/Basic.
Rafael Espindola [Sat, 24 Oct 2015 23:15:31 +0000 (23:15 +0000)]
Simplify boolean conditional return statements in lib/Basic.

Patch by Richard.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251214 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoclang/module.modulemap: s/Basic/BuiltinsR600.def/Basic/BuiltinsAMDGPU.def/
NAKAMURA Takumi [Sat, 24 Oct 2015 07:16:41 +0000 (07:16 +0000)]
clang/module.modulemap: s/Basic/BuiltinsR600.def/Basic/BuiltinsAMDGPU.def/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251182 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoFixup this testcase after r251120.
Adrian Prantl [Fri, 23 Oct 2015 17:25:17 +0000 (17:25 +0000)]
Fixup this testcase after r251120.
I accidentally tested r251120 with assertions disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251126 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-dev
Artyom Skrobov [Fri, 23 Oct 2015 17:19:02 +0000 (17:19 +0000)]
[ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-dev

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251124 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoModule Debugging: Emit module debug info for types inside of Objective-C
Adrian Prantl [Fri, 23 Oct 2015 17:02:22 +0000 (17:02 +0000)]
Module Debugging: Emit module debug info for types inside of Objective-C
containers.

rdar://problem/23196170

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251120 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoRemove a redundant check. NFC
Adrian Prantl [Fri, 23 Oct 2015 16:51:32 +0000 (16:51 +0000)]
Remove a redundant check. NFC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251116 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[StaticAnalyzer] Use llvm::utostr and not to_string.
Davide Italiano [Fri, 23 Oct 2015 16:43:18 +0000 (16:43 +0000)]
[StaticAnalyzer] Use llvm::utostr and not to_string.

The latter seems unsupported (at least) on MinGW and FreeBSD (where
I hit this failure). We can't have nice things.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251115 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AST] Plug a memory leak when promoting a single ParentMap entry to a vector.
Benjamin Kramer [Fri, 23 Oct 2015 13:24:18 +0000 (13:24 +0000)]
[AST] Plug a memory leak when promoting a single ParentMap entry to a vector.

Found by asan!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251110 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[AST] Re-add TypeLocs and NestedNameSpecifierLocs to the ParentMap.
Benjamin Kramer [Fri, 23 Oct 2015 09:04:55 +0000 (09:04 +0000)]
[AST] Re-add TypeLocs and NestedNameSpecifierLocs to the ParentMap.

This relands r250831 after some fixes to shrink the ParentMap overall
with one addtional tweak: nodes with pointer identity (e.g. Decl* and
friends) can be store more efficiently so I put them in a separate map.
All other nodes (so far only TypeLoc and NNSLoc) go in a different map
keyed on DynTypedNode. This further uglifies the code but significantly
reduces memory overhead.

Overall this change still make ParentMap significantly larger but it's
nowhere as bad as before. I see about 25 MB over baseline (pre-r251008)
on X86ISelLowering.cpp. If this becomes an issue we could consider
splitting the maps further as DynTypedNode is still larger (32 bytes)
than a single TypeLoc (16 bytes) but I didn't want to introduce even
more complexity now.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251101 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUse newly introduced interfaces in LLVM (NFC)
Xinliang David Li [Thu, 22 Oct 2015 22:25:11 +0000 (22:25 +0000)]
Use newly introduced interfaces in LLVM (NFC)

Replaced references to raw strings in instrumentation
and coverage code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251072 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDefine weak and __weak to mean ARC-style weak references, even in MRC.
John McCall [Thu, 22 Oct 2015 18:38:17 +0000 (18:38 +0000)]
Define weak and __weak to mean ARC-style weak references, even in MRC.

Previously, __weak was silently accepted and ignored in MRC mode.
That makes this a potentially source-breaking change that we have to
roll out cautiously.  Accordingly, for the time being, actual support
for __weak references in MRC is experimental, and the compiler will
reject attempts to actually form such references.  The intent is to
eventually enable the feature by default in all non-GC modes.
(It is, of course, incompatible with ObjC GC's interpretation of
__weak.)

If you like, you can enable this feature with
  -Xclang -fobjc-weak
but like any -Xclang option, this option may be removed at any point,
e.g. if/when it is eventually enabled by default.

This patch also enables the use of the ARC __unsafe_unretained qualifier
in MRC.  Unlike __weak, this is being enabled immediately.  Since
variables are essentially __unsafe_unretained by default in MRC,
the only practical uses are (1) communication and (2) changing the
default behavior of by-value block capture.

As an implementation matter, this means that the ObjC ownership
qualifiers may appear in any ObjC language mode, and so this patch
removes a number of checks for getLangOpts().ObjCAutoRefCount
that were guarding the processing of these qualifiers.  I don't
expect this to be a significant drain on performance; it may even
be faster to just check for these qualifiers directly on a type
(since it's probably in a register anyway) than to do N dependent
loads to grab the LangOptions.

rdar://9674298

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251041 91177308-0d34-0410-b5e6-96231b3b80d8

8 years ago[MS ABI] Don't crash when inheriting from base with trailing empty array member
David Majnemer [Thu, 22 Oct 2015 18:04:22 +0000 (18:04 +0000)]
[MS ABI] Don't crash when inheriting from base with trailing empty array member

We got this right for Itanium but not MSVC because CGRecordLayoutBuilder
was checking if the base's size was zero when it should have been
checking the non-virtual size.

This fixes PR21040.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251036 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoUnbreak the shared cmake build. libToolingCore now depends on libAST.
Benjamin Kramer [Thu, 22 Oct 2015 15:45:54 +0000 (15:45 +0000)]
Unbreak the shared cmake build. libToolingCore now depends on libAST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251026 91177308-0d34-0410-b5e6-96231b3b80d8

8 years agoDisable trigraph and escaped newline expansion on all types of raw string literals...
Craig Topper [Thu, 22 Oct 2015 15:35:21 +0000 (15:35 +0000)]
Disable trigraph and escaped newline expansion on all types of raw string literals not just ASCII type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251025 91177308-0d34-0410-b5e6-96231b3b80d8