]> granicus.if.org Git - clang/log
clang
8 years agoAdd support for Android Vector calling convention for AArch64
Nirav Dave [Mon, 22 Feb 2016 16:48:42 +0000 (16:48 +0000)]
Add support for Android Vector calling convention for AArch64

This modification applies the following Android commit when we have an
Android environment. This is the sole non-renderscript in the Android repo

commit 9212d4fb30a3ca2f4ee966dd2748c35573d9682c
Author: Tim Murray <timmurray@google.com>
Date:   Fri Aug 15 16:00:15 2014 -0700

    Update vector calling convention for AArch64.

    bug 16846318

    Change-Id: I3cfd167758b4bd634d8480ee6ba6bb55d61f82a7

Reviewers: srhines, jyknight

Subscribers: mcrosier, aemerson, rengolin, tberghammer, danalbert, srhines

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

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

8 years agoclang-format: [JS] treat forwardDeclare as an import/export statement.
Daniel Jasper [Mon, 22 Feb 2016 15:06:53 +0000 (15:06 +0000)]
clang-format: [JS] treat forwardDeclare as an import/export statement.

Patch by Martin Probst. Thank you.

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

8 years agoUse an anonymous hyperlink reference to eliminate Sphinx warnings.
Aaron Ballman [Mon, 22 Feb 2016 13:09:36 +0000 (13:09 +0000)]
Use an anonymous hyperlink reference to eliminate Sphinx warnings.

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

8 years agoMake Sema::CheckFormatString a static function inside SemaChecking.cpp
Andy Gibbs [Mon, 22 Feb 2016 13:00:43 +0000 (13:00 +0000)]
Make Sema::CheckFormatString a static function inside SemaChecking.cpp

No functionality change.  Change at the request of Richard Trieu, see
http://reviews.llvm.org/D15636#357858.

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding prol{d|q|w}{128|256|512} builtin to clang .
Michael Zuckerman [Mon, 22 Feb 2016 09:42:57 +0000 (09:42 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding prol{d|q|w}{128|256|512} builtin to clang .

Fixing problem with the lib/include/avx512vlintrin.h file.
Adding one more _ to the prefix of _extension__ -> __extension__.

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

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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding prol{d|q|w}{128|256|512} builtin to clang .
Michael Zuckerman [Mon, 22 Feb 2016 09:05:41 +0000 (09:05 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding prol{d|q|w}{128|256|512} builtin to clang .

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

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

8 years agoAddressing review comments for r261163.
Manman Ren [Mon, 22 Feb 2016 04:47:24 +0000 (04:47 +0000)]
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

8 years agoFix PR24473 : Teach clang to remember to substitute into member variable templates...
Faisal Vali [Mon, 22 Feb 2016 02:24:29 +0000 (02:24 +0000)]
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

8 years ago[analyzer][scan-build] Non-existing directory for scan-build output.
Anton Yartsev [Sun, 21 Feb 2016 17:04:26 +0000 (17:04 +0000)]
[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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding pmovzx{b|d|w}{w|d|q}{128|256|512} builtin to clang
Michael Zuckerman [Sun, 21 Feb 2016 14:00:11 +0000 (14:00 +0000)]
[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

8 years agoAdded SKL and CNL processors and features to Clang
Elena Demikhovsky [Sun, 21 Feb 2016 07:41:23 +0000 (07:41 +0000)]
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

8 years agoClass Property: Fix a crash with old ABI when generating metadata in classes.
Manman Ren [Sun, 21 Feb 2016 05:31:05 +0000 (05:31 +0000)]
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

8 years agoLex: Never overflow the file in HeaderMap::lookupFilename()
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 00:14:36 +0000 (00:14 +0000)]
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

8 years agoLex: Change HeaderMapImpl::getString() to return StringRef, NFC
Duncan P. N. Exon Smith [Sat, 20 Feb 2016 23:12:51 +0000 (23:12 +0000)]
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

8 years agoLex: Use dbgs() instead of fprintf() in HeaderMap::dump()
Duncan P. N. Exon Smith [Sat, 20 Feb 2016 23:09:14 +0000 (23:09 +0000)]
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

8 years agoLex: Add a test for HeaderMap::lookupFileName()
Duncan P. N. Exon Smith [Sat, 20 Feb 2016 22:53:22 +0000 (22:53 +0000)]
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

8 years agoLex: Check whether the header map buffer has space for the buckets
Duncan P. N. Exon Smith [Sat, 20 Feb 2016 21:24:31 +0000 (21:24 +0000)]
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

8 years agoLex: Check buckets on header map construction
Duncan P. N. Exon Smith [Sat, 20 Feb 2016 21:00:58 +0000 (21:00 +0000)]
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

8 years agoLex: Add some unit tests for corrupt header maps
Duncan P. N. Exon Smith [Sat, 20 Feb 2016 20:39:51 +0000 (20:39 +0000)]
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

8 years ago[c-index-test] CMake: When installing c-index-test to a different prefix directory...
Argyrios Kyrtzidis [Sat, 20 Feb 2016 20:34:55 +0000 (20:34 +0000)]
[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

8 years agoLex: clang-format HeaderMap.h, NFC
Duncan P. N. Exon Smith [Sat, 20 Feb 2016 18:55:08 +0000 (18:55 +0000)]
Lex: clang-format HeaderMap.h, NFC

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

8 years agoLex: Remove explicitly deleted copy constructor, NFC
Duncan P. N. Exon Smith [Sat, 20 Feb 2016 18:53:45 +0000 (18:53 +0000)]
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

8 years ago[MSVC Compat] Implement -EHc semantics
David Majnemer [Sat, 20 Feb 2016 09:23:47 +0000 (09:23 +0000)]
[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

8 years ago[MSVC Compat] Add support for /GX, /GX-
David Majnemer [Sat, 20 Feb 2016 09:23:44 +0000 (09:23 +0000)]
[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

8 years agoRemove -fnew-ms-eh
David Majnemer [Sat, 20 Feb 2016 09:23:41 +0000 (09:23 +0000)]
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

8 years agoFix handling of vaargs on PPC32 when going from regsave to overflow.
Roman Divacky [Sat, 20 Feb 2016 08:31:24 +0000 (08:31 +0000)]
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

8 years ago[OPENMP 4.5] Initial support for data members in 'lastprivate' clause.
Alexey Bataev [Sat, 20 Feb 2016 04:09:36 +0000 (04:09 +0000)]
[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

8 years agoRemove a duplicate declaration specifier from _ReadBarrier
David Majnemer [Sat, 20 Feb 2016 00:57:00 +0000 (00:57 +0000)]
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

8 years ago[modules] Do less scanning of macro definition chains when computing the set of
Richard Smith [Fri, 19 Feb 2016 22:43:58 +0000 (22:43 +0000)]
[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

8 years ago[modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a single
Richard Smith [Fri, 19 Feb 2016 22:25:36 +0000 (22:25 +0000)]
[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

8 years ago[OpenCL] Generate metadata for opencl_unroll_hint attribute
Anastasia Stulova [Fri, 19 Feb 2016 18:30:11 +0000 (18:30 +0000)]
[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

8 years agoRemoved unused local variable
Serge Pavlov [Fri, 19 Feb 2016 12:06:23 +0000 (12:06 +0000)]
Removed unused local variable

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

8 years agopr26544: Bitfield layout with pragma pack and attributes "packed" and
Alexey Bataev [Fri, 19 Feb 2016 11:23:28 +0000 (11:23 +0000)]
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

8 years ago[OPENMP] Improved layout of CGOpenMPRuntime class, NFC.
Alexey Bataev [Fri, 19 Feb 2016 10:38:26 +0000 (10:38 +0000)]
[OPENMP] Improved layout of CGOpenMPRuntime class, NFC.

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

8 years agoCorrect typos after acting on invalid subscript expressions
David Majnemer [Fri, 19 Feb 2016 07:15:33 +0000 (07:15 +0000)]
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

8 years agoAdd test.
JF Bastien [Fri, 19 Feb 2016 06:54:47 +0000 (06:54 +0000)]
Add test.

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

8 years agoARM: fix VFP asm constraints
JF Bastien [Fri, 19 Feb 2016 06:54:45 +0000 (06:54 +0000)]
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

8 years agoFix SemaTemplate/instantiate-field.cpp after r261297.
Nico Weber [Fri, 19 Feb 2016 02:51:07 +0000 (02:51 +0000)]
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

8 years agoImplement the likely resolution of core issue 253.
Nico Weber [Fri, 19 Feb 2016 01:52:46 +0000 (01:52 +0000)]
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

8 years agoUpdate cxx_dr_status.html with today's cwg_index.html.
Nico Weber [Fri, 19 Feb 2016 01:49:39 +0000 (01:49 +0000)]
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

8 years ago[analyzer] Add checker callback for beginning of function.
Devin Coughlin [Fri, 19 Feb 2016 01:35:10 +0000 (01:35 +0000)]
[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

8 years ago[Sema] PR25181 Fix crash when method declaration with throw spec fails to parse correctly
Reid Kleckner [Fri, 19 Feb 2016 01:15:08 +0000 (01:15 +0000)]
[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

8 years agoAdd call to find_package to load LLVM dependencies
Reid Kleckner [Fri, 19 Feb 2016 00:56:56 +0000 (00:56 +0000)]
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

8 years agoFix my typo from r261278
Richard Trieu [Fri, 19 Feb 2016 00:15:50 +0000 (00:15 +0000)]
Fix my typo from r261278

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

8 years agoAdd -Wcomma warning to Clang.
Richard Trieu [Thu, 18 Feb 2016 23:58:40 +0000 (23:58 +0000)]
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

8 years ago[ASTImporter] Implement missing VisitAccessSpecDecl function in ASTImporter class.
Argyrios Kyrtzidis [Thu, 18 Feb 2016 23:08:36 +0000 (23:08 +0000)]
[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

8 years agoRemove use of builtin comma operator.
Richard Trieu [Thu, 18 Feb 2016 22:34:54 +0000 (22:34 +0000)]
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

8 years ago[Sema] Fix bug in TypeLocBuilder::pushImpl
Akira Hatanaka [Thu, 18 Feb 2016 21:05:09 +0000 (21:05 +0000)]
[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

8 years agoMissed a spot in r261251, also ignore attributes on all pointer parameters
Krzysztof Parzyszek [Thu, 18 Feb 2016 20:30:40 +0000 (20:30 +0000)]
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

8 years agoUse Backend_EmitMCNull for null codegen unit tests.
David L. Jones [Thu, 18 Feb 2016 20:27:16 +0000 (20:27 +0000)]
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

8 years agoMake test less prone to attribute changes
Krzysztof Parzyszek [Thu, 18 Feb 2016 20:02:03 +0000 (20:02 +0000)]
Make test less prone to attribute changes

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

8 years ago[analyzer] Include comment mistakenly left out of r261243. NFC.
Devin Coughlin [Thu, 18 Feb 2016 19:37:39 +0000 (19:37 +0000)]
[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

8 years agoMake deprecation message for -fsanitize-coverage= with numeric argument friendlier.
Nico Weber [Thu, 18 Feb 2016 19:32:54 +0000 (19:32 +0000)]
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

8 years ago[analyzer] Improve modeling of ObjC synthesized property setters.
Devin Coughlin [Thu, 18 Feb 2016 19:13:30 +0000 (19:13 +0000)]
[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

8 years agoFile missed from r261222
Serge Pavlov [Thu, 18 Feb 2016 16:43:24 +0000 (16:43 +0000)]
File missed from r261222

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

8 years agoAvoid double deletion in Clang driver.
Serge Pavlov [Thu, 18 Feb 2016 16:42:09 +0000 (16:42 +0000)]
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

8 years agoAdd an AST matcher for real floating-point types. e.g., float, double, long double...
Aaron Ballman [Thu, 18 Feb 2016 16:36:01 +0000 (16:36 +0000)]
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

8 years ago[analyzer] dump_ast_matchers.py: fix replacement regexps
Yury Gribov [Thu, 18 Feb 2016 15:43:56 +0000 (15:43 +0000)]
[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

8 years ago[Parse] Code complete expressions in bracket declarators.
Benjamin Kramer [Thu, 18 Feb 2016 15:30:24 +0000 (15:30 +0000)]
[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

8 years ago[OPENMP] Fix codegen for lastprivate loop counters.
Alexey Bataev [Thu, 18 Feb 2016 13:48:15 +0000 (13:48 +0000)]
[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

8 years ago[analyzer] Add --force-analyze-debug-code option to scan-build
Yury Gribov [Thu, 18 Feb 2016 11:08:46 +0000 (11:08 +0000)]
[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

8 years ago[CLANG] [AVX512] [BUILTIN] Adding pmovsx{b|d|w}{w|d|q}{128|256|512} builtin to clang
Michael Zuckerman [Thu, 18 Feb 2016 09:09:34 +0000 (09:09 +0000)]
[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

8 years ago[MSVC] Turn C++ EH on my default
David Majnemer [Thu, 18 Feb 2016 08:15:05 +0000 (08:15 +0000)]
[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

8 years agoSema: provide an extension warning for enable_if
Saleem Abdulrasool [Thu, 18 Feb 2016 06:49:31 +0000 (06:49 +0000)]
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

8 years ago[Parse] Make sure we don't forget to diagnose typos in exprs
David Majnemer [Thu, 18 Feb 2016 06:37:44 +0000 (06:37 +0000)]
[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

8 years ago[sanitizer-coverage] allow -fsanitize-coverage=trace-pc w/o any other sanitizer and...
Kostya Serebryany [Thu, 18 Feb 2016 00:49:23 +0000 (00:49 +0000)]
[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

8 years ago[sanitizer-coverage] add a deprecation warning for -fsanitize-coverage=[1234]
Kostya Serebryany [Wed, 17 Feb 2016 23:57:17 +0000 (23:57 +0000)]
[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

8 years agoDon't crash w/ a diagnostic range containing a null byte
David Majnemer [Wed, 17 Feb 2016 22:37:45 +0000 (22:37 +0000)]
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

8 years agoAdd 'nopartial' qualifier for availability attributes.
Manman Ren [Wed, 17 Feb 2016 22:05:48 +0000 (22:05 +0000)]
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

8 years ago[modules] Cache 'acceptable decl' lookups for namespaces. In projects with
Richard Smith [Wed, 17 Feb 2016 21:52:44 +0000 (21:52 +0000)]
[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

8 years ago[sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar to trace...
Kostya Serebryany [Wed, 17 Feb 2016 21:34:43 +0000 (21:34 +0000)]
[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

8 years ago[CodeGen] Fix an assert in CodeGenFunction::EmitFunctionEpilog
Akira Hatanaka [Wed, 17 Feb 2016 21:09:50 +0000 (21:09 +0000)]
[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

8 years agoEnable SafeStack for CloudABI.
Ed Schouten [Wed, 17 Feb 2016 18:56:20 +0000 (18:56 +0000)]
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

8 years agoCorrect more typos in conditional expressions
David Majnemer [Wed, 17 Feb 2016 17:19:00 +0000 (17:19 +0000)]
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

8 years ago[OPENMP] Fix tests incompatibility with ARM buildbots.
Alexey Bataev [Wed, 17 Feb 2016 15:36:39 +0000 (15:36 +0000)]
[OPENMP] Fix tests incompatibility with ARM buildbots.

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

8 years ago[OPENMP 4.5] Codegen support for data members in 'firstprivate' clause.
Alexey Bataev [Wed, 17 Feb 2016 13:19:37 +0000 (13:19 +0000)]
[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

8 years ago[OpenCL] Added half type literal with suffix h.
Anastasia Stulova [Wed, 17 Feb 2016 11:34:37 +0000 (11:34 +0000)]
[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

8 years ago[OPENMP] Fix handling loop-based directives with arrays.
Alexey Bataev [Wed, 17 Feb 2016 10:29:05 +0000 (10:29 +0000)]
[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

8 years ago[cmake] Revert r260742 (and r260744) to improve order file support.
Chandler Carruth [Wed, 17 Feb 2016 02:13:35 +0000 (02:13 +0000)]
[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

8 years ago[AttrDocs.td] Fix up some reST syntax.
Sean Silva [Wed, 17 Feb 2016 02:08:19 +0000 (02:08 +0000)]
[AttrDocs.td] Fix up some reST syntax.

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

8 years agoTest simplification
Xinliang David Li [Wed, 17 Feb 2016 00:59:01 +0000 (00:59 +0000)]
Test simplification

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

8 years agoRestrengthen tests relaxed in r259955
Xinliang David Li [Wed, 17 Feb 2016 00:58:13 +0000 (00:58 +0000)]
Restrengthen tests relaxed in r259955

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

8 years agoTeach clang to use the ThinLTO pipeline
Mehdi Amini [Wed, 17 Feb 2016 00:42:20 +0000 (00:42 +0000)]
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

8 years agoImprove diagnostics for ill-formed literal operator declarations.
Richard Smith [Wed, 17 Feb 2016 00:04:04 +0000 (00:04 +0000)]
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

8 years ago[CUDA] pass debug options to ptxas.
Artem Belevich [Tue, 16 Feb 2016 22:03:20 +0000 (22:03 +0000)]
[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

8 years agoMissing semicolons are kind of important. Who knew?
Aaron Ballman [Tue, 16 Feb 2016 21:06:10 +0000 (21:06 +0000)]
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

8 years agoAdd a nullPointerConstant() AST matcher to handle variations of null pointer constant...
Aaron Ballman [Tue, 16 Feb 2016 21:02:23 +0000 (21:02 +0000)]
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

8 years agoStop using "template" when printing qualtype names
Reid Kleckner [Tue, 16 Feb 2016 20:34:27 +0000 (20:34 +0000)]
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

8 years agoExclude PCH/missing-file.cpp on Windows, it does not pass reliably
Reid Kleckner [Tue, 16 Feb 2016 19:16:28 +0000 (19:16 +0000)]
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

8 years ago[typo-correction] Apply name specifier corrections when forming a NNS
Reid Kleckner [Tue, 16 Feb 2016 19:16:20 +0000 (19:16 +0000)]
[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

8 years agoclang-cl: Expose -isystem.
Nico Weber [Tue, 16 Feb 2016 19:05:50 +0000 (19:05 +0000)]
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

8 years ago[OPENMP] Allow to use compound assignment operators.
Alexey Bataev [Tue, 16 Feb 2016 12:13:49 +0000 (12:13 +0000)]
[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

8 years ago[OPENMP] Improved handling of pseudo-captured expressions in OpenMP.
Alexey Bataev [Tue, 16 Feb 2016 11:18:12 +0000 (11:18 +0000)]
[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

8 years ago[Frontend] Make sure WrapperFrontendAction updates CurrentInput after calling BeginSo...
Argyrios Kyrtzidis [Tue, 16 Feb 2016 05:39:33 +0000 (05:39 +0000)]
[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

8 years agoclang/test/Driver/ps4-linker-win.c: Tweak substitutions if %PATH% ends with '\\'...
NAKAMURA Takumi [Tue, 16 Feb 2016 03:17:13 +0000 (03:17 +0000)]
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

8 years agoSimplify users of StringRef::{l,r}trim (clang) (NFC)
Vedant Kumar [Tue, 16 Feb 2016 02:14:44 +0000 (02:14 +0000)]
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

8 years agoRemove unnecessary regex in the test cases I fixed in r260496.
Akira Hatanaka [Tue, 16 Feb 2016 00:46:03 +0000 (00:46 +0000)]
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

8 years agoDarwin: fix stdlib handling when CLANG_DEFAULT_STDLIB is set
Tim Northover [Mon, 15 Feb 2016 16:38:10 +0000 (16:38 +0000)]
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

8 years agoPR26449: Tests for builtin_classify_type fix
Andrey Bokhanko [Mon, 15 Feb 2016 10:44:27 +0000 (10:44 +0000)]
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

8 years agoPR26449: Fixes for bugs in __builtin_classify_type implementation
Andrey Bokhanko [Mon, 15 Feb 2016 10:39:04 +0000 (10:39 +0000)]
PR26449: Fixes for bugs in __builtin_classify_type implementation

This patch fixes the following bugs in __builtin_classify_type implementation:
1) Support for member functions and fields
2) Same behavior as GCC in C mode (specifically, return integer_type_class for
   enums and pointer_type_class for function pointers and arrays). Behavior in
   C++ mode didn't changed.

Also, it refactors the whole implementation, by replacing a sequence of
if-else-if with a couple of switches.

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

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