Граф коммитов

61609 Коммитов

Автор SHA1 Сообщение Дата
Devin Coughlin 29e6c0aba5 [analyzer] Improve modeling of ObjC synthesized property setters.
When modeling a call to a setter for a property that is synthesized to be
backed by an instance variable, don't invalidate the entire instance
but rather only the storage for the updated instance variable itself.

This still doesn't model the effect of the setter completely. It doesn't
bind the set value to the ivar storage location because doing so would cause
the set value to escape, removing valuable diagnostics about potential
leaks of the value from the retain count checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 19:13:30 +00:00
Serge Pavlov 29be6b71af File missed from r261222
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 16:43:24 +00:00
Serge Pavlov 9998e90e3b Avoid double deletion in Clang driver.
Llvm module object is shared between CodeGenerator and BackendConsumer,
in both classes it is stored as std::unique_ptr, which is not a good
design solution and can cause double deletion error. Usually it does
not occur because in BackendConsumer::HandleTranslationUnit the
ownership of CodeGenerator over the module is taken away. If however
this method is not called, the module is deleted twice and compiler crashes.

As the module owned by BackendConsumer is always the same as CodeGenerator
has, pointer to llvm module can be removed from BackendGenerator.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 16:42:09 +00:00
Aaron Ballman 005df9362e Add an AST matcher for real floating-point types. e.g., float, double, long double, but not complex.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261221 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 16:36:01 +00:00
Yury Gribov 98c4d57826 [analyzer] dump_ast_matchers.py: fix replacement regexps
Patch by Alex Sidorin!

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261219 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 15:43:56 +00:00
Benjamin Kramer 059e6e9ac2 [Parse] Code complete expressions in bracket declarators.
Currently we return no results when completing inside of the brackets in
a 'char foo[]' declaration. Let the generic expression completion code
handle it instead. We could get fancier here (e.g. filter non-constant
expressions in contexts where VLAs are not allowed), but it's a strict
improvement over the existing version.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 15:30:24 +00:00
dotnet-bot 455bf03edf Merge commit '94cb8b886f3571d53ff0b26f1d8cb419d905c8c2' into HEAD 2016-02-18 06:09:02 -08:00
Alexey Bataev 9ac4380629 [OPENMP] Fix codegen for lastprivate loop counters.
Patch fixes bug with codegen for lastprivate loop counters. Also it may
improve performance for lastprivates calculations in some cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 13:48:15 +00:00
Yury Gribov 19b977bcdf [analyzer] Add --force-analyze-debug-code option to scan-build
to force debug build and hopefully enable more precise warnings.

Static Analyzer is much more efficient when built in debug mode
(-UNDEBUG) so we advice users to enable it manually. This may be
inconvenient in case of large complex projects (think about Linux
distros e.g. Android or Tizen). This patch adds a flag to scan-build
which inserts -UNDEBUG automatically.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 11:08:46 +00:00
Michael Zuckerman dcd61b3089 [CLANG] [AVX512] [BUILTIN] Adding pmovsx{b|d|w}{w|d|q}{128|256|512} builtin to clang
Differential Revision: http://reviews.llvm.org/D16955



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 09:09:34 +00:00
David Majnemer 94cb8b886f [MSVC] Turn C++ EH on my default
Our support for C++ EH is sufficiently good that it makes sense to
enable support for it out of the box.

While we are here, update the MSVCCompatibility doc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 08:15:05 +00:00
Saleem Abdulrasool 1d51805adb Sema: provide an extension warning for enable_if
Clang implements an enable_if attribute as an extension.  Hook up `-Wpedantic`
to issue an extension usage warning when __enable_if__ is used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 06:49:31 +00:00
David Majnemer ad0288b56d [Parse] Make sure we don't forget to diagnose typos in exprs
If ActOn*Op fails, we will forget to diagnose typos in the LHS of
expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 06:37:44 +00:00
Kostya Serebryany c6c456a271 [sanitizer-coverage] allow -fsanitize-coverage=trace-pc w/o any other sanitizer and w/o ...=[func,bb,edge]. This makes this syntax a superset of the GCC's syntax
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 00:49:23 +00:00
Kostya Serebryany 8dd75f2804 [sanitizer-coverage] add a deprecation warning for -fsanitize-coverage=[1234]
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261178 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 23:57:17 +00:00
David Majnemer 1844181ab7 Don't crash w/ a diagnostic range containing a null byte
We prematurely ended the line at the null byte which caused us to crash
down stream because we tried to reason about columns beyond the end of
the line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261171 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 22:37:45 +00:00
Manman Ren 83a9e40e5f Add 'nopartial' qualifier for availability attributes.
An optional nopartial can be placed after the platform name.
int bar() __attribute__((availability(macosx,nopartial,introduced=10.12))

When deploying back to a platform version prior to when the declaration was
introduced, with 'nopartial', Clang emits an error specifying that the function
is not introduced yet; without 'nopartial', the behavior stays the same: the
declaration is `weakly linked`.

A member is added to the end of AttributeList to save the location of the
'nopartial' keyword. A bool member is added to AvailabilityAttr.

The diagnostics for 'nopartial' not-yet-introduced is handled in the same way as
we handle unavailable cases.

Reviewed by Doug Gregor and Jordan Rose.

rdar://23791325


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261163 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 22:05:48 +00:00
Richard Smith aebd76a8c8 [modules] Cache 'acceptable decl' lookups for namespaces. In projects with
thousands of modules, each of which declares the same namespace, linearly
scanning the redecl chain looking for a visible declaration (once for each leaf
module, for each use) performs very poorly. Namespace visibility can only
decrease when we leave a module during a module build step, and we never care
*which* visible declaration of a namespace we find, so we can cache this very
effectively.

This results in a 35x speedup on one of our internal build steps (2m -> 3.5s),
but is hard to unit test because it requires a very large number of modules.
Ideas for a test appreciated! No functionality change intended other than the
speedup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261161 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 21:52:44 +00:00
Kostya Serebryany c545cca149 [sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261159 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 21:34:43 +00:00
Akira Hatanaka 0add6aa837 [CodeGen] Fix an assert in CodeGenFunction::EmitFunctionEpilog
The assert is triggered because isObjCRetainableType() is called on the
canonicalized return type that has been stripped of the typedefs and
attributes attached to it. To fix this assert, this commit gets the
original return type from CurCodeDecl or BlockInfo and uses it instead
of the canoicalized type.

rdar://problem/24470031

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 21:09:50 +00:00
Ed Schouten dabe08aac0 Enable SafeStack for CloudABI.
Summary:
I've got a patchset in my home directory to integrate support for
SafeStack into CloudABI's C library. All of the CloudABI unit tests
still seem to pass. Pretty sweet!

This change adds the necessary changes to Clang to make
-fsanitize=safe-stack work on CloudABI. Without it, passing this command
line flag throws an error.

Reviewers: eugenis, samsonov

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261135 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 18:56:20 +00:00
David Majnemer de18bd8785 Correct more typos in conditional expressions
We didn't correctly handle some edge cases, causing us to bail out
before correcting all the typos.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 17:19:00 +00:00
Alexey Bataev adf405e2a8 [OPENMP] Fix tests incompatibility with ARM buildbots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261098 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 15:36:39 +00:00
dotnet-bot 2381c1ccfc Merge commit 'a11816e2582b793e0d1fc926efba7e432fb2ba7f' into HEAD 2016-02-17 05:53:27 -08:00
Alexey Bataev 0b191b8861 [OPENMP 4.5] Codegen support for data members in 'firstprivate' clause.
Added codegen for captured data members in non-static member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261089 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 13:19:37 +00:00
Anastasia Stulova 2a90a32756 [OpenCL] Added half type literal with suffix h.
OpenCL Extension v1.2 s9.5 allows half precision floating point
type literals with suffices h or H when cl_khr_fp16 is enabled.

Example:  half x = 1.0h;

Patch by Liu Yaxun (Sam)!

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261084 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 11:34:37 +00:00
Alexey Bataev d647fbfe82 [OPENMP] Fix handling loop-based directives with arrays.
Patch fixes possible problems with correct handling arrays as
expressions in initialization, conditions etc in loop-based constructs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261080 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 10:29:05 +00:00
Chandler Carruth a11816e258 [cmake] Revert r260742 (and r260744) to improve order file support.
This appears to be passing '-Wl,-order_file' to Linux link commands,
which then causes the linker to silently, behind the scenes, write the
output to 'rder_file' instead of somewhere else. Will work with Chris to
figure out the proper support for this, but so far there are numerous
people who can't get Clang to update when they build because of this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261054 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 02:13:35 +00:00
Sean Silva 6ac287f135 [AttrDocs.td] Fix up some reST syntax.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261053 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 02:08:19 +00:00
Xinliang David Li 7b77e335d1 Test simplification
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261047 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 00:59:01 +00:00
Xinliang David Li 2ca445b9e4 Restrengthen tests relaxed in r259955
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261046 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 00:58:13 +00:00
Mehdi Amini 921cbd3691 Teach clang to use the ThinLTO pipeline
Summary: Use the new pipeline implemented in D17115

Reviewers: tejohnson

Subscribers: joker.eph, cfe-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261045 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 00:42:20 +00:00
Richard Smith 67ebdeb467 Improve diagnostics for ill-formed literal operator declarations.
Patch by Erik Pilkington!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261034 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-17 00:04:04 +00:00
Artem Belevich e88720a628 [CUDA] pass debug options to ptxas.
ptxas optimizations are disabled if we need to generate debug info
as ptxas does not accept '-g' otherwise.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261018 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 22:03:20 +00:00
Aaron Ballman d065b6d262 Missing semicolons are kind of important. Who knew?
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261009 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 21:06:10 +00:00
Aaron Ballman 3f8756990c Add a nullPointerConstant() AST matcher to handle variations of null pointer constants in one matcher.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261008 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 21:02:23 +00:00
Reid Kleckner 7200698a63 Stop using "template" when printing qualtype names
Summary:
The keyword "template" isn't necessary when
printing a fully-qualified qualtype name, and, in fact,
results in a syntax error if one tries to use it. So stop
printing it.

Reviewers: rsmith, rnk

Subscribers: rnk, klimek, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261005 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 20:34:27 +00:00
Reid Kleckner e81797369b Exclude PCH/missing-file.cpp on Windows, it does not pass reliably
Tag the test with "REQUIRES: can-remove-opened-file", which is what we
use for the similar test Modules/explicit-build-missing-file.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260994 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 19:16:28 +00:00
Reid Kleckner eb267f6ce6 [typo-correction] Apply name specifier corrections when forming a NNS
Previously we would leave behind the old name specifier prefix, which
creates an invalid AST.  Other callers of CorrectTypo update their
CXXScopeSpec objects with the correction specifier if one is present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260993 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 19:16:20 +00:00
Nico Weber e9d15f0df2 clang-cl: Expose -isystem.
Like cl.exe, clang-cl allows adding system include directories via the
INCLUDE env var.  Having a driver flag for this functionality is useful,
so add this too.

(In the future, we probably also want to have a flag alternative to
VCINSTALLDIR as used in MSVCToolChain::getVisualStudioBinaries(), and
a way to override the registry accesses in MSVCToolChain::getWindowsSDKDir()
-- maybe -ivcroot= and -iwinsdkroot=?).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260990 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 19:05:50 +00:00
dotnet-bot 2d5ab8398c Merge commit '1db40ee0042d3ff4ca47ec282fadf5870268e397' into HEAD 2016-02-16 05:45:12 -08:00
Alexey Bataev 4bffc24d2f [OPENMP] Allow to use compound assignment operators.
Loop-based directives allow to use iterators as loop counters. Iterators are allowed to define their own operators. This patch allows to use compound assignment operators for iterators.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260957 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 12:13:49 +00:00
Alexey Bataev 34addf9dba [OPENMP] Improved handling of pseudo-captured expressions in OpenMP.
Expressions inside 'schedule'|'dist_schedule' clause must be captured in
combined directives to avoid possible crash during codegen. Patch
improves handling of such constructs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260954 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 11:18:12 +00:00
Argyrios Kyrtzidis 1db40ee004 [Frontend] Make sure WrapperFrontendAction updates CurrentInput after calling BeginSourceFileAction.
I don't have a test case to add unfortunately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260937 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 05:39:33 +00:00
NAKAMURA Takumi 4b78517d24 clang/test/Driver/ps4-linker-win.c: Tweak substitutions if %PATH% ends with '\\', or lit complains with "parser error".
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260929 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 03:17:13 +00:00
Vedant Kumar ce4ded5b58 Simplify users of StringRef::{l,r}trim (clang) (NFC)
r260925 introduced a version of the *trim methods which is preferable
when trimming a single kind of character. Update all users in clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260927 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 02:14:44 +00:00
Akira Hatanaka 8e28be4007 Remove unnecessary regex in the test cases I fixed in r260496.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-16 00:46:03 +00:00
Tim Northover cb4f0f8444 Darwin: fix stdlib handling when CLANG_DEFAULT_STDLIB is set
I'd accidentally skipped the CMake check in a premature optimisation. I'd also
put the original test in completely the wrong place.

Thanks Jonas Hahnfeld!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260898 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 16:38:10 +00:00
dotnet-bot 11db0fc320 Merge commit '60ea58923cedab42181297ba150cab731449fc67' into HEAD 2016-02-15 05:54:30 -08:00
Andrey Bokhanko 93de2a0297 PR26449: Tests for builtin_classify_type fix
In my previous commit (rL260881) I forget to svn add tests. This commit adds
them.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-15 10:44:27 +00:00