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

61609 Коммитов

Автор SHA1 Сообщение Дата
dotnet-bot af5b7b65ac Merge commit '7391f7f03cb48c406dcd855627888b9895263be7' into HEAD 2016-02-22 06:07:00 -08:00
Manman Ren 7391f7f03c Addressing review comments for r261163.
Use "strict" instead of "nopartial". Also make strictly not-introduced
share the same diagnostics as Obsolete and Unavailable.

rdar://23791325


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261512 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 04:47:24 +00:00
Faisal Vali fa10bdb358 Fix PR24473 : Teach clang to remember to substitute into member variable templates referred to within dependent qualified ids.
In passing also fix a semi-related bug that allows access to variable templates through member access notation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261506 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-22 02:24:29 +00:00
Anton Yartsev 8f351cf9bd [analyzer][scan-build] Non-existing directory for scan-build output.
Makes scan-build successfully accept non-existing output directories provided via "-o" option. The directory is created in this case. This behavior is conforming to the old perl scan-build implementation.
(http://reviews.llvm.org/D17091)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 17:04:26 +00:00
dotnet-bot f5fdd7c3d0 Merge commit '4ac9f2c9a40dae984066de241429c5a7a3472346' into HEAD 2016-02-21 06:01:15 -08:00
Michael Zuckerman b9019e85ee [CLANG] [AVX512] [BUILTIN] Adding pmovzx{b|d|w}{w|d|q}{128|256|512} builtin to clang
Differential Revision: http://reviews.llvm.org/D16961


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261471 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 14:00:11 +00:00
Elena Demikhovsky 4ac9f2c9a4 Added SKL and CNL processors and features to Clang
Differential Revision: http://reviews.llvm.org/D16756



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261467 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 07:41:23 +00:00
Manman Ren c0dfefdf0b Class Property: Fix a crash with old ABI when generating metadata in classes.
rdar://23891898


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261466 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 05:31:05 +00:00
Duncan P. N. Exon Smith 839cd13b65 Lex: Never overflow the file in HeaderMap::lookupFilename()
If a header map file is corrupt, the strings in the string table may not
be null-terminated.  The logic here previously relied on `MemoryBuffer`
always being null-terminated, but this isn't actually guaranteed by the
class AFAICT.  Moreover, we're seeing a lot of crash traces at calls to
`strlen()` inside of `lookupFilename()`, so something is going wrong
there.

Instead, use `strnlen()` to get the length, and check for corruption.

Also remove code paths that could call `StringRef(nullptr)`.  r261459
made these rather obvious (although they'd been there all along).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261461 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-21 00:14:36 +00:00
Duncan P. N. Exon Smith 4e8d52ad03 Lex: Change HeaderMapImpl::getString() to return StringRef, NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261459 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 23:12:51 +00:00
Duncan P. N. Exon Smith c41b90a59c Lex: Use dbgs() instead of fprintf() in HeaderMap::dump()
This way it's easy to change HeaderMapImpl::getString() to return a
StringRef.

There's a slight change here, because I used `errs()` instead of
`dbgs()`.  But `dbgs()` is more appropriate for a dump method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 23:09:14 +00:00
Duncan P. N. Exon Smith 5900ac9ac6 Lex: Add a test for HeaderMap::lookupFileName()
Add a simple test for `HeaderMap::lookupFileName()`.  I'm planning to
add better error checking in a moment, and I'll add more tests like this
then.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 22:53:22 +00:00
Duncan P. N. Exon Smith 39c202cadc Lex: Check whether the header map buffer has space for the buckets
Check up front whether the header map buffer has space for all of its
declared buckets.

There was already a check in `getBucket()`, but it had UB (comparing
pointers that were outside of objects in the error path) and was
insufficient (only checking for a single byte of the relevant bucket).
I fixed the check, moved it to `checkHeader()`, and left a fixed version
behind as an assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261449 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 21:24:31 +00:00
Duncan P. N. Exon Smith 4a8b8ff576 Lex: Check buckets on header map construction
If the number of buckets is not a power of two, immediately recognize
the header map as corrupt, rather than waiting for the first lookup.  I
converted the later check to an assert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261448 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 21:00:58 +00:00
Duncan P. N. Exon Smith 7dca0f623a Lex: Add some unit tests for corrupt header maps
Split the implementation of `HeaderMap` into `HeaderMapImpl` so that we
can write unit tests that don't depend on the `FileManager`, and then
write a few tests that cover the types of corrupt header maps already
detected.

This also moves type and constant definitions from HeaderMap.cpp to
HeaderMapTypes.h so that the test can access them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 20:39:51 +00:00
Argyrios Kyrtzidis c34c0ec7b6 [c-index-test] CMake: When installing c-index-test to a different prefix directory, add an rpath so that
it can find libclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 20:34:55 +00:00
Duncan P. N. Exon Smith d9d154cc11 Lex: clang-format HeaderMap.h, NFC
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 18:55:08 +00:00
Duncan P. N. Exon Smith a98ffff45b Lex: Remove explicitly deleted copy constructor, NFC
`std::unique_ptr<MemoryBuffer>` already deletes these, so there's no
reason for the boiler-plate in HeaderMap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261442 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 18:53:45 +00:00
dotnet-bot b10d523a89 Merge commit 'f27515a292bc656b1aacc4ca8e81980091a309ab' into HEAD 2016-02-20 06:01:01 -08:00
David Majnemer 73b50332f5 [MSVC Compat] Implement -EHc semantics
The -EHc flag implicitly adds a nothrow attribute to any extern "C"
function when exceptions are enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 09:23:47 +00:00
David Majnemer bc29610042 [MSVC Compat] Add support for /GX, /GX-
These are legacy flags which map to /EHsc and /EHs-c- respectively.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261424 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 09:23:44 +00:00
David Majnemer aed82c0255 Remove -fnew-ms-eh
This flag no longer controls any behavior inside of clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@261423 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-20 09:23:41 +00:00
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