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

61275 Коммитов

Автор SHA1 Сообщение Дата
Roman Divacky 55d3b14e18 Fix handling of vaargs on PPC32 when going from regsave to overflow.
It can happen that when we only have 1 more register left in the regsave
area we need to store a value bigger than 1 register and therefore we
go to the overflow area. In this case we have to leave the last slot
in the regsave area unused and keep using overflow area. Do this
by storing a limit value to the used register counter in the overflow block.

Issue diagnosed by and solution tested by Mark Millard!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261422 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 08:31:24 +00:00
Alexey Bataev f27515a292 [OPENMP 4.5] Initial support for data members in 'lastprivate' clause.
OpenMP 4.5 allows to privatize non-static data members of current class
in non-static member functions. Patch adds initial support for data
members.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261412 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 04:09:36 +00:00
David Majnemer a183320955 Remove a duplicate declaration specifier from _ReadBarrier
This fixes PR26675.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261388 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 00:57:00 +00:00
Richard Smith eb2307ce16 [modules] Do less scanning of macro definition chains when computing the set of
exported module macros outside local submodule visibility mode. Related to
PR24667.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261373 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 22:43:58 +00:00
Richard Smith 378d67ec54 [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a single
option. Previously these options could both be used to specify that you were
compiling the implementation file of a module, with a different set of minor
bugs in each case.

This change removes -fmodule-implementation-of, and instead tracks a flag to
determine whether we're currently building a module. -fmodule-name now behaves
the same way that -fmodule-implementation-of previously did.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261372 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 22:25:36 +00:00
Anastasia Stulova da91cb3158 [OpenCL] Generate metadata for opencl_unroll_hint attribute
Add support for opencl_unroll_hint attribute from OpenCL v2.0 s6.11.5.

Reusing most of metadata generation from CGLoopInfo helper class.

The code is based on Khronos OpenCL compiler:
https://github.com/KhronosGroup/SPIR/tree/spirv-1.0

Patch by Liu Yaxun (Sam)!

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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 18:30:11 +00:00
Serge Pavlov 83bed93ff4 Removed unused local variable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 12:06:23 +00:00
Alexey Bataev 3e7a382f0e pr26544: Bitfield layout with pragma pack and attributes "packed" and
"aligned", by Vladimir Yakovlev

Fix clang/gcc incompatibility of bitfields layout in the presence of
pragma packed and attributes aligned and packed.
Differential Revision: http://reviews.llvm.org/D17023

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 11:23:28 +00:00
Alexey Bataev 94f72199f9 [OPENMP] Improved layout of CGOpenMPRuntime class, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 10:38:26 +00:00
David Majnemer c3c8f3aee4 Correct typos after acting on invalid subscript expressions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 07:15:33 +00:00
JF Bastien 31bdac353b Add test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261310 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 06:54:47 +00:00
JF Bastien b4663aa977 ARM: fix VFP asm constraints
Summary:
Rich Felker was sad that clang used 'w' and 'P' for VFP constraints when GCC documents them as 't' and 'w':
  https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html

This was added way back in 2008:
  http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20080421/005393.html

Subscribers: aemerson, rengolin, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261309 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 06:54:45 +00:00
Nico Weber b26af68557 Fix SemaTemplate/instantiate-field.cpp after r261297.
For templates, fields can have incomplete types:

  template <class T>
  struct A2 {
    struct B;
    B b;
  };

Don't try to touch the DefinitionData of those fields.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 02:51:07 +00:00
Nico Weber 309e7e9be3 Implement the likely resolution of core issue 253.
C++11 requires const objects to have a user-provided constructor, even for
classes without any fields. DR 253 relaxes this to say "If the implicit default
constructor initializes all subobjects, no initializer should be required."

clang is currently the only compiler that implements this C++11 rule, and e.g.
libstdc++ relies on something like DR 253 to compile in newer versions.  This
change  makes it possible to build code that says `const vector<int> v;' again
when using libstdc++5.2 and _GLIBCXX_DEBUG
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60284).

Fixes PR23381.

http://reviews.llvm.org/D16552


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 01:52:46 +00:00
Nico Weber 2acb3424b3 Update cxx_dr_status.html with today's cwg_index.html.
Created by:
cd www
curl -O http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_index.html
./make_cxx_dr_status


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261295 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 01:49:39 +00:00
Devin Coughlin 674d89e44b [analyzer] Add checker callback for beginning of function.
Add a checker callback that is called when the analyzer starts analyzing a
function either at the top level or when inlined. This will be used by a
follow-on patch making the DeallocChecker path sensitive.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 01:35:10 +00:00
Reid Kleckner b3cafc6313 [Sema] PR25181 Fix crash when method declaration with throw spec fails to parse correctly
Fixes crash referenced in PR25181 where dyn_cast is called on a null
instance of LM.Method.

Reviewers: majnemer, rnk

Patch by Don Hinton

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 01:15:08 +00:00
Reid Kleckner 31cb91e5a8 Add call to find_package to load LLVM dependencies
ClangConfig requires LLVMConfig, so add find_package call in
ClangConfig so find_package(clang REQUIRED CONFIG) will just work.  This
makes it easier for cmake based projects to use clang, e.g., tools using
ClangTooling.

Patch by Don Hinton

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 00:56:56 +00:00
Richard Trieu 00a50daf94 Fix my typo from r261278
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-19 00:15:50 +00:00
Richard Trieu ba3bb7db1d Add -Wcomma warning to Clang.
-Wcomma will detect and warn on most uses of the builtin comma operator.  It
currently whitelists the first and third statements of the for-loop.  For other
cases, the warning can be silenced by casting the first operand of the comma
operator to void.

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 23:58:40 +00:00
Argyrios Kyrtzidis d4539e33f0 [ASTImporter] Implement missing VisitAccessSpecDecl function in ASTImporter class.
Patch by Elisavet Sakellari!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 23:08:36 +00:00
Richard Trieu 3fae4abaf2 Remove use of builtin comma operator.
Cleanup for upcoming Clang warning -Wcomma.  No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261271 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 22:34:54 +00:00
Akira Hatanaka b85dafb9b7 [Sema] Fix bug in TypeLocBuilder::pushImpl
The code in TypeLocBuilder::pushImpl wasn't correctly handling the case
where an element that has an 8-byte alignment was being pushed.

I plan to follow up with a patch to remove redundancies and simplify the
function.

rdar://problem/23838912

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


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261260 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 21:05:09 +00:00
Krzysztof Parzyszek f6d27b56ca Missed a spot in r261251, also ignore attributes on all pointer parameters
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261253 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 20:30:40 +00:00
David L. Jones ff3db8fcd6 Use Backend_EmitMCNull for null codegen unit tests.
Using Backend_EmitLL attemps to create a file with an empty filename.
This is problematic in certain environments: an empty filename may be
illegal, or the default output path may not be writable (in the case
where an empty filename would otherwise have some non-failing
semantics). This patch switches to use Backend_EmitMCNull, which
allows CodeGen to run, but does not attempt to create or write an
output file.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 20:27:16 +00:00
Krzysztof Parzyszek 588c120184 Make test less prone to attribute changes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 20:02:03 +00:00
Devin Coughlin ee12854679 [analyzer] Include comment mistakenly left out of r261243. NFC.
It explains why we can't just synthesize bodies of setters in BodyFarm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 19:37:39 +00:00
Nico Weber 9bf05a90cd Make deprecation message for -fsanitize-coverage= with numeric argument friendlier.
http://reviews.llvm.org/D17397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261247 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-18 19:32:54 +00:00
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
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