]> granicus.if.org Git - clang/log
clang
8 years agoAdd TreatUnavailableAsInvalid for the verification-only mode in InitListChecker.
Manman Ren [Thu, 10 Mar 2016 18:53:19 +0000 (18:53 +0000)]
Add TreatUnavailableAsInvalid for the verification-only mode in InitListChecker.

Given the following test case:
typedef struct {
  const char *name;
  id field;
} Test9;
extern void doSomething(Test9 arg);
void test9() {
  Test9 foo2 = {0, 0};
  doSomething(foo2);
}
With a release compiler, we don't emit any message and silently ignore the
variable "foo2". With an assert compiler, we get an assertion failure.

The root cause —————————————
Back in r140457 we gave InitListChecker a verification-only mode, and will use
CanUseDecl instead of DiagnoseUseOfDecl for verification-only mode.

These two functions handle unavailable issues differently:
In Sema::CanUseDecl, we say the decl is invalid when the Decl is unavailable and
the current context is available.

In Sema::DiagnoseUseOfDecl, we say the decl is usable by ignoring the return
code of DiagnoseAvailabilityOfDecl

So with an assert build, we will hit an assertion in diagnoseListInit
assert(DiagnoseInitList.HadError() &&
       "Inconsistent init list check result.");

The fix -------------------
If we follow what is implemented in CanUseDecl and treat Decls with
unavailable issues as invalid, the variable decl of “foo2” will be marked as
invalid. Since unavailable checking is processed in delayed diagnostics
(r197627), we will silently ignore the diagnostics when we find out that
the variable decl is invalid.

We add a flag "TreatUnavailableAsInvalid" for the verification-only mode.
For overload resolution, we want to say decls with unavailable issues are
invalid; but for everything else, we should say they are valid and
emit diagnostics. Depending on the value of the flag, CanUseDecl
can return different values for unavailable issues.

rdar://23557300
Differential Revision: http://reviews.llvm.org/D15314

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

8 years agoMake remaining ImplicitFallthrough warning DefaultIgnore.
Nico Weber [Thu, 10 Mar 2016 18:42:37 +0000 (18:42 +0000)]
Make remaining ImplicitFallthrough warning DefaultIgnore.

Follow-up to r262881, which caused this to fire more often.

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

8 years agoUpdated SSE3 builtin tests to more closely match the llvm fast-isel equivalent tests
Simon Pilgrim [Thu, 10 Mar 2016 14:46:49 +0000 (14:46 +0000)]
Updated SSE3 builtin tests to more closely match the llvm fast-isel equivalent tests

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

8 years agoAdded note to SSE4a builtins about keeping in sync with llvm tests
Simon Pilgrim [Thu, 10 Mar 2016 14:44:32 +0000 (14:44 +0000)]
Added note to SSE4a builtins about keeping in sync with llvm tests

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

8 years agoUpdated SSSE3 builtin tests to more closely match the llvm fast-isel equivalent tests
Simon Pilgrim [Thu, 10 Mar 2016 14:42:17 +0000 (14:42 +0000)]
Updated SSSE3 builtin tests to more closely match the llvm fast-isel equivalent tests

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

8 years agoMinor Wdocumentation fix. NFCI.
Simon Pilgrim [Thu, 10 Mar 2016 14:16:36 +0000 (14:16 +0000)]
Minor Wdocumentation fix. NFCI.

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

8 years agoCorrecting an attribute documentation generation error by giving the abi_tag attribut...
Aaron Ballman [Thu, 10 Mar 2016 13:08:22 +0000 (13:08 +0000)]
Correcting an attribute documentation generation error by giving the abi_tag attribute a documentation category.

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

8 years agoAdd doxygen comments to xmmintrin.h's intrinsics.
Ekaterina Romanova [Thu, 10 Mar 2016 09:37:04 +0000 (09:37 +0000)]
Add doxygen comments to xmmintrin.h's intrinsics.
Only half of the intrinsics in this file is documented here. The patch for the other half will be sent out later.

The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream.

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

8 years agoARM: fix arm_neon_intrinsics.c and re-enable.
Tim Northover [Thu, 10 Mar 2016 04:39:45 +0000 (04:39 +0000)]
ARM: fix arm_neon_intrinsics.c and re-enable.

It turns out I'd never actually tested my recent change because it was
gated on long-tests. Failure ensued.

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

8 years agoDisable failing test and fix RUN line.
Richard Trieu [Thu, 10 Mar 2016 04:04:12 +0000 (04:04 +0000)]
Disable failing test and fix RUN line.

See https://llvm.org/bugs/show_bug.cgi?id=26894 for details.  This change
fixes the incorrect flags to Clang and the piping issue.  It also disables
the FileCheck portion of the test, which is currently failing.

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

8 years agoFix false positives for for-loop-analysis warning
Steven Wu [Thu, 10 Mar 2016 02:02:48 +0000 (02:02 +0000)]
Fix false positives for for-loop-analysis warning

Summary:
For PseudoObjectExpr, the DeclMatcher need to search only all the semantics
but also need to search pass OpaqueValueExpr for all potential uses for the
Decl.

Reviewers: thakis, rtrieu, rjmccall, doug.gregor

Subscribers: xazax.hun, rjmccall, doug.gregor, cfe-commits

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

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

8 years agoEmitCXXStructorCall -> EmitCXXDestructorCall. NFC.
Alexey Samsonov [Thu, 10 Mar 2016 00:20:37 +0000 (00:20 +0000)]
EmitCXXStructorCall -> EmitCXXDestructorCall. NFC.

This function is only used in Microsoft ABI and only to emit
destructors. Rename/simplify it accordingly.

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

8 years agoRemove unused function arguments. NFC.
Alexey Samsonov [Thu, 10 Mar 2016 00:20:33 +0000 (00:20 +0000)]
Remove unused function arguments. NFC.

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

8 years ago[Modules] Add stdatomic to the list of builtin headers
Ben Langmuir [Wed, 9 Mar 2016 23:31:34 +0000 (23:31 +0000)]
[Modules] Add stdatomic to the list of builtin headers

Since it's provided by the compiler. This allows a system module map
file to declare a module for it.

No test change for cstd.m, since stdatomic.h doesn't function without a
relatively complete stdint.h and stddef.h, which tests using this module
don't provide.

rdar://problem/24931246

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

8 years ago[modules] Simplify code logic. NFC.
Davide Italiano [Wed, 9 Mar 2016 21:09:51 +0000 (21:09 +0000)]
[modules] Simplify code logic. NFC.

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

8 years agoARM & AArch64: fix IR-converted tests.
Tim Northover [Wed, 9 Mar 2016 20:06:10 +0000 (20:06 +0000)]
ARM & AArch64: fix IR-converted tests.

My script was converting %a0 to [[A]]0 if it had seen %a defined before %a0.
Oops.

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

8 years agoNFC fix documentation build by rL263015
Dmitry Polukhin [Wed, 9 Mar 2016 19:39:16 +0000 (19:39 +0000)]
NFC fix documentation build by rL263015

This time I hope it will fix the build for real.

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

8 years ago[PPC] FE support for generating VSX [negated] absolute value instructions
Kit Barton [Wed, 9 Mar 2016 19:28:31 +0000 (19:28 +0000)]
[PPC] FE support for generating VSX [negated] absolute value instructions

Includes new built-in, conversion of built-in to target-independent intrinsic
and update in the header file. Tests are also updated. There is a second part in
the backend for which I will post a separate code-review. BACKEND PART SHOULD BE
COMMITTED FIRST.

Phabricator: http://reviews.llvm.org/D17816

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

8 years agoARM & AArch64: convert asm tests to LLVM IR and restrict optimizations.
Tim Northover [Wed, 9 Mar 2016 18:54:42 +0000 (18:54 +0000)]
ARM & AArch64: convert asm tests to LLVM IR and restrict optimizations.

This is mostly a one-time autoconversion of tests that checked assembly after
"-Owhatever" compiles to only run "opt -mem2reg" and check the assembly. This
should make them much more stable to changes in LLVM so they won't break on
unrelated changes.

"opt -mem2reg" is a compromise designed to increase the readability of tests
that check dataflow, while minimizing dependency on LLVM. Hopefully mem2reg is
stable enough that no surpises will come along.

Should address http://llvm.org/PR26815.

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

8 years agoUse an explicit instantiation to work around delayed template parsing for MSVC-built...
Aaron Ballman [Wed, 9 Mar 2016 18:07:17 +0000 (18:07 +0000)]
Use an explicit instantiation to work around delayed template parsing for MSVC-built bots.

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

8 years agoAArch64: remove a couple more tests already covered elsewhere.
Tim Northover [Wed, 9 Mar 2016 18:00:06 +0000 (18:00 +0000)]
AArch64: remove a couple more tests already covered elsewhere.

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

8 years agoSpeculative fix for this test case (the test doesn't run on my typical build environm...
Aaron Ballman [Wed, 9 Mar 2016 17:34:16 +0000 (17:34 +0000)]
Speculative fix for this test case (the test doesn't run on my typical build environment).

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

8 years agoReleaseNotes: update 'you may prefer' link to 3.8
Hans Wennborg [Wed, 9 Mar 2016 17:26:46 +0000 (17:26 +0000)]
ReleaseNotes: update 'you may prefer' link to 3.8

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

8 years agoAdding new AST matchers for: addrLabelExpr, atomicExpr, binaryConditionalOperator...
Aaron Ballman [Wed, 9 Mar 2016 17:11:51 +0000 (17:11 +0000)]
Adding new AST matchers for: addrLabelExpr, atomicExpr, binaryConditionalOperator, designatedInitExpr, designatorCountIs, hasSyntacticForm, implicitValueInitExpr, labelDecl, opaqueValueExpr, parenListExpr, predefinedExpr, requiresZeroInitialization, and stmtExpr.

Patch by Aleksei Sidorin.

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

8 years agoImplement support for [[maybe_unused]] in C++1z that is based off existing support...
Aaron Ballman [Wed, 9 Mar 2016 16:48:08 +0000 (16:48 +0000)]
Implement support for [[maybe_unused]] in C++1z that is based off existing support for unused, and treat it as an extension pre-C++1z. This also means extending the existing unused attribute so that it can be placed on an enum and enumerator, in addition to the other subjects.

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

8 years agoNFC fix documentation build by rL263015
Dmitry Polukhin [Wed, 9 Mar 2016 16:19:04 +0000 (16:19 +0000)]
NFC fix documentation build by rL263015

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

8 years ago[OpenMP] Add support for multidimensional array sections in map clause SEMA.
Samuel Antao [Wed, 9 Mar 2016 15:46:05 +0000 (15:46 +0000)]
[OpenMP] Add support for multidimensional array sections in map clause SEMA.

Summary: In some cases it can be proved statically that multidimensional array section refer to contiguous storage and can therefore be allowed in a map clause. This patch adds support for those cases in SEMA.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

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

8 years ago[GCC] PR23529 Sema part of attrbute abi_tag support
Dmitry Polukhin [Wed, 9 Mar 2016 15:30:53 +0000 (15:30 +0000)]
[GCC] PR23529 Sema part of attrbute abi_tag support

Original patch by Stefan Bühler http://reviews.llvm.org/D12834

Difference between original and this one:
- fixed all comments in original code review
- added more tests, all new diagnostics now covered by tests
- moved abi_tag on re-declaration checks to Sema::mergeDeclAttributes
  where they actually may work as designed
- clang-format + other stylistic changes

Mangle part will be sent for review as a separate patch.

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

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

8 years agoFixing wrong header title name.
Michael Zuckerman [Wed, 9 Mar 2016 11:26:45 +0000 (11:26 +0000)]
Fixing wrong header title name.

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

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

8 years agoPacify gcc's parenthesis warning, which doesn't realize that parens don't matter...
Manuel Klimek [Wed, 9 Mar 2016 10:06:45 +0000 (10:06 +0000)]
Pacify gcc's parenthesis warning, which doesn't realize that parens don't matter here.

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

8 years ago[OPENMP 4.5] Codegen for data members in 'linear' clause
Alexey Bataev [Wed, 9 Mar 2016 09:49:09 +0000 (09:49 +0000)]
[OPENMP 4.5] Codegen for data members in 'linear' clause

OpenMP 4.5 allows privatization of non-static data members in OpenMP
constructs. Patch adds proper codegen support for data members in
'linear' clause

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

8 years ago[OPENMP 4.5] Codegen for data members in 'linear' clause.
Alexey Bataev [Wed, 9 Mar 2016 09:49:00 +0000 (09:49 +0000)]
[OPENMP 4.5] Codegen for data members in 'linear' clause.

OpenMP 4.5 allows to use data members in private clauses. Patch adds
codegen support for 'linear' clause.

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

8 years agoAccept absolute paths in the -fuse-ld option.
Peter Zotov [Wed, 9 Mar 2016 05:18:16 +0000 (05:18 +0000)]
Accept absolute paths in the -fuse-ld option.

This patch extends the -fuse-ld option to accept a full path to an executable
and use it verbatim to invoke the linker. There are generally two reasons
to desire this.

The first reason relates to the sad truth is that Clang is retargetable,
Binutils are not.

While any Clang from a binary distribution is sufficient to compile code
for a wide range of architectures and prefixed BFD linkers (e.g.
installed as /usr/bin/arm-none-linux-gnueabi-ld) as well as cross-compiled
libc's (for non-bare-metal targets) are widely available, including on all
Debian derivatives, it is impossible to use them together because
the -fuse-ld= option allows to specify neither a linker prefix nor
a full path to one.

The second reason is linker development, both when porting existing linkers
to new architectures and when working on a new linker such as LLD.

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

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

8 years ago[index] Add a message for the assertion, NFC.
Argyrios Kyrtzidis [Wed, 9 Mar 2016 02:53:12 +0000 (02:53 +0000)]
[index] Add a message for the assertion, NFC.

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

8 years ago[index] libclang: Make sure to treat forward ObjC protocols as ObjCProtocolRef declar...
Argyrios Kyrtzidis [Wed, 9 Mar 2016 02:12:46 +0000 (02:12 +0000)]
[index] libclang: Make sure to treat forward ObjC protocols as ObjCProtocolRef declarations, and fix related crash.

rdar://25035376

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

8 years ago[index] Fix assertion hit when indexing re-declarations of built-in functions.
Argyrios Kyrtzidis [Wed, 9 Mar 2016 02:12:40 +0000 (02:12 +0000)]
[index] Fix assertion hit when indexing re-declarations of built-in functions.

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

8 years agoReadd testcase accidentally removed in r262888.
Richard Smith [Wed, 9 Mar 2016 00:12:38 +0000 (00:12 +0000)]
Readd testcase accidentally removed in r262888.

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

8 years ago[Modules] Modernize, use range-based loops.
Davide Italiano [Tue, 8 Mar 2016 23:58:08 +0000 (23:58 +0000)]
[Modules] Modernize, use range-based loops.

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

8 years agoFix crash in access check for aggregate initialization of base classes. It's
Richard Smith [Tue, 8 Mar 2016 23:17:35 +0000 (23:17 +0000)]
Fix crash in access check for aggregate initialization of base classes. It's
not obvious how to access-check these, so pick a conservative rule until we get
feedback from CWG.

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

8 years agoFix -Werror build.
Richard Smith [Tue, 8 Mar 2016 23:16:16 +0000 (23:16 +0000)]
Fix -Werror build.

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

8 years agoAArch64: remove tests of intrinsics completely duplicated elsewhere.
Tim Northover [Tue, 8 Mar 2016 23:10:58 +0000 (23:10 +0000)]
AArch64: remove tests of intrinsics completely duplicated elsewhere.

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

8 years agoP0017R1: In C++1z, an aggregate class can have (public non-virtual) base classes...
Richard Smith [Tue, 8 Mar 2016 22:17:41 +0000 (22:17 +0000)]
P0017R1: In C++1z, an aggregate class can have (public non-virtual) base classes; these are initialized as if they were data members.

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

8 years agoSilence duplicate diagnostics because parsing of a standards-based attribute triggers...
Aaron Ballman [Tue, 8 Mar 2016 21:31:32 +0000 (21:31 +0000)]
Silence duplicate diagnostics because parsing of a standards-based attribute triggers parsing diagnostics that may also be picked up during semantic analysis.

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

8 years agoTurning on the /bigobj flag for two more files that will not link with MSVC 2015...
Aaron Ballman [Tue, 8 Mar 2016 16:34:37 +0000 (16:34 +0000)]
Turning on the /bigobj flag for two more files that will not link with MSVC 2015 Win64 Debug due to the section limit.

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

8 years agoAdd Visual Studio native visualizers for several Clang types
Mike Spertus [Tue, 8 Mar 2016 16:14:23 +0000 (16:14 +0000)]
Add Visual Studio native visualizers for several Clang types

This is one of a series of changes to improve the MSVC visualization of Clang types.
This one focuses on Record and SubstTemplateTypeParmType meaning that, for example,
a TemplateArgumentLoc no longer displays incomprehensibly in the locals window as

  {Argument={DeclArg={Kind=1 QT=0x033acb00 D=0xcccccccc {DeclType=???}}...

but instead much more usefully as

  Type template parameter: SubstTemplateTypeParm: {Identifier (("T"))} => Record, {Identifier (("A"))}

Additional types and improvements will be made in subsequent commits

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

8 years agoBump libclang API version after r262318
Kevin Funk [Tue, 8 Mar 2016 10:34:23 +0000 (10:34 +0000)]
Bump libclang API version after r262318

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

8 years agoSema: Methods in unavailable classes are unavailable
Duncan P. N. Exon Smith [Tue, 8 Mar 2016 10:28:52 +0000 (10:28 +0000)]
Sema: Methods in unavailable classes are unavailable

Similar to the template cases in r262050, when a C++ method in an
unavailable struct/class calls unavailable API, don't diagnose an error.
I.e., this case was failing:

    void foo() __attribute__((unavailable));
    struct __attribute__((unavailable)) A {
      void bar() { foo(); }
    };

Since A is unavailable, A::bar is allowed to call foo.  However, we were
emitting a diagnostic here.  This commit checks up the context chain
from A::bar, in a manner inspired by SemaDeclAttr.cpp:isDeclUnavailable.

I expected to find other related issues but failed to trigger them:

- I wondered if DeclBase::getAvailability should check for
  `TemplateDecl` instead of `FunctionTemplateDecl`, but I couldn't find
  a way to trigger this.  I left behind a few extra tests to make sure
  we don't regress.

- I wondered if Sema::isFunctionConsideredUnavailable should be
  symmetric, checking up the context chain of the callee (this commit
  only checks up the context chain of the caller).  However, I couldn't
  think of a testcase that didn't require first referencing the
  unavailable type; this, we already diagnose.

rdar://problem/25030656

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

8 years agoSema: Treat 'strict' availability flag like unavailable
Duncan P. N. Exon Smith [Tue, 8 Mar 2016 06:12:54 +0000 (06:12 +0000)]
Sema: Treat 'strict' availability flag like unavailable

This is a follow-up to r261512, which made the 'strict' availability
attribute flag behave like 'unavailable'.  However, that fix was
insufficient.  The following case would (erroneously) error when the
deployment target was older than 10.9:

    struct __attribute__((availability(macosx,strict,introduced=10.9))) A;
    __attribute__((availability(macosx,strict,introduced=10.9))) void f(A*);

The use of A* in the argument list for f is valid here, since f and A
have the same availability.

The fix is to return AR_Unavailable from DeclBase::getAvailability
instead of AR_NotYetIntroduced.  This also reverts the special handling
added in r261163, instead relying on the well-tested logic for
AR_Unavailable.

rdar://problem/23791325

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

8 years agoAdd doxygen comments to bmiintrin.h's intrinsics.
Ekaterina Romanova [Tue, 8 Mar 2016 01:36:59 +0000 (01:36 +0000)]
Add doxygen comments to bmiintrin.h's intrinsics.
The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream.

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

8 years ago[analyzer] Fix missed leak from MSVC specific allocation functions
Anna Zaks [Tue, 8 Mar 2016 01:21:51 +0000 (01:21 +0000)]
[analyzer] Fix missed leak from MSVC specific allocation functions

Add the wide character strdup variants (wcsdup, _wcsdup) and the MSVC
version of alloca (_alloca) and other differently named function used
by the Malloc checker.

A patch by Alexander Riccio!

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

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

8 years agoUse class="svn" for features with SVN status.
Richard Smith [Tue, 8 Mar 2016 00:45:37 +0000 (00:45 +0000)]
Use class="svn" for features with SVN status.

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

8 years agoMove [[nodiscard]] tests into test/CXX tree.
Richard Smith [Tue, 8 Mar 2016 00:44:49 +0000 (00:44 +0000)]
Move [[nodiscard]] tests into test/CXX tree.

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

8 years agoDefine __has_cpp_attribute(fallthrough) to a more reasonable value. (What year is...
Richard Smith [Tue, 8 Mar 2016 00:40:32 +0000 (00:40 +0000)]
Define __has_cpp_attribute(fallthrough) to a more reasonable value. (What year is it?!)

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

8 years agoAdd accidentally forgotten testcase from r262881.
Richard Smith [Tue, 8 Mar 2016 00:34:49 +0000 (00:34 +0000)]
Add accidentally forgotten testcase from r262881.

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

8 years agoP0188R1: add support for standard [[fallthrough]] attribute. This is almost
Richard Smith [Tue, 8 Mar 2016 00:32:55 +0000 (00:32 +0000)]
P0188R1: add support for standard [[fallthrough]] attribute. This is almost
exactly the same as clang's existing [[clang::fallthrough]] attribute, which
has been updated to have the same semantics. The one significant difference
is that [[fallthrough]] is ill-formed if it's not used immediately before a
switch label (even when -Wimplicit-fallthrough is disabled). To support that,
we now build a CFG of any function that uses a '[[fallthrough]];' statement
to check.

In passing, fix some bugs with our support for statement attributes -- in
particular, diagnose their use on declarations, rather than asserting.

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

8 years agoImplement support for [[nodiscard]] in C++1z that is based off existing support for...
Aaron Ballman [Mon, 7 Mar 2016 22:44:55 +0000 (22:44 +0000)]
Implement support for [[nodiscard]] in C++1z that is based off existing support for warn_unused_result, and treat it as an extension pre-C++1z. This also means extending the existing warn_unused_result attribute so that it can be placed on an enum as well as a class.

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

8 years agoModule Debugging: Fix a crash when emitting debug info for nested tag types
Adrian Prantl [Mon, 7 Mar 2016 20:58:52 +0000 (20:58 +0000)]
Module Debugging: Fix a crash when emitting debug info for nested tag types
whose DeclContext is not yet complete by deferring their emission.

rdar://problem/24918680

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

8 years ago[CLANG][AVX512][BUILTIN] Add builtin vcomi{ss|sd}
Michael Zuckerman [Mon, 7 Mar 2016 19:15:00 +0000 (19:15 +0000)]
[CLANG][AVX512][BUILTIN] Add builtin vcomi{ss|sd}

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

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

8 years agopython binding: expose compile command filename
Guillaume Papin [Mon, 7 Mar 2016 18:44:42 +0000 (18:44 +0000)]
python binding: expose compile command filename

Reviewers: compnerd, skalinichev

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

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

8 years ago[ms-inline-asm][AVX512] Add ability to use k registers in MS inline asm + fix bag...
Marina Yatsina [Mon, 7 Mar 2016 18:10:25 +0000 (18:10 +0000)]
[ms-inline-asm][AVX512] Add ability to use k registers in MS inline asm + fix bag with curly braces

Until now curly braces could only be used in MS inline assembly to mark block start/end.
All curly braces were removed completely at a very early stage.
This approach caused bugs like:
"m{o}v eax, ebx" turned into "mov eax, ebx" without any error.

In addition, AVX-512 added special operands (e.g., k registers), which are also surrounded by curly braces that mark them as such.
Now, we need to keep the curly braces and identify at a later stage if they are marking block start/end (if so, ignore them), or surrounding special AVX-512 operands (if so, parse them as such).

This patch fixes the bug described above and enables the use of AVX-512 special operands.

This commit is the the clang part of the patch.
The clang part of the review is: http://reviews.llvm.org/D17766
The llvm part of the review is: http://reviews.llvm.org/D17767

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

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

8 years agoImplement __builtin_eh_return_data_regno for SPARC and SPARC64.
Joerg Sonnenberger [Mon, 7 Mar 2016 17:19:15 +0000 (17:19 +0000)]
Implement __builtin_eh_return_data_regno for SPARC and SPARC64.

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

8 years agoDescribe the magic numbers returned by getEHDataRegisterNumber.
Joerg Sonnenberger [Mon, 7 Mar 2016 17:18:41 +0000 (17:18 +0000)]
Describe the magic numbers returned by getEHDataRegisterNumber.

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

8 years ago[CLANG][AVX512][BUILTIN] Adding new feature flag headed files and new BUILTIN vpermi2...
Michael Zuckerman [Mon, 7 Mar 2016 17:04:11 +0000 (17:04 +0000)]
[CLANG][AVX512][BUILTIN] Adding new feature flag headed files and new BUILTIN vpermi2varq{i|t}{128|256|512}{mask|maskz}

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

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

8 years ago[OPENMP] Codegen for distribute directive: fix bug in ordering of parameters.
Carlo Bertolli [Mon, 7 Mar 2016 16:19:13 +0000 (16:19 +0000)]
[OPENMP] Codegen for distribute directive: fix bug in ordering of parameters.

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

8 years agoReapply r262741 [OPENMP] Codegen for distribute directive
Carlo Bertolli [Mon, 7 Mar 2016 16:04:49 +0000 (16:04 +0000)]
Reapply r262741 [OPENMP] Codegen for distribute directive

This patch provide basic implementation of codegen for teams directive, excluding all clauses except dist_schedule. It also fixes parts of AST reader/writer to enable correct pre-compiled header handling.

http://reviews.llvm.org/D17170

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

8 years agoResolved Bug 26414.
Amjad Aboud [Mon, 7 Mar 2016 14:22:46 +0000 (14:22 +0000)]
Resolved Bug 26414.
https://llvm.org/bugs/show_bug.cgi?id=26414
Since interrupt handler must be returned with iret, tail call can't be used.

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

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

8 years ago[CLANG][AVX512][BUILTIN] Adding new feature flag header file and new builtin vpmadd52...
Michael Zuckerman [Mon, 7 Mar 2016 09:55:55 +0000 (09:55 +0000)]
[CLANG][AVX512][BUILTIN] Adding new feature flag header file and new builtin vpmadd52{h|l}uq{128|256|512}{mask|maskz}

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

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

8 years ago[MS ABI] Mangle symbols names longer than 4096 characters correctly
David Majnemer [Mon, 7 Mar 2016 08:51:17 +0000 (08:51 +0000)]
[MS ABI] Mangle symbols names longer than 4096 characters correctly

Really long symbols are hashed using MD5 and prefixed/suffixed with the
usual sigils.  There is an additional reason beyond the usual
compatibility with MSVC, it is important to keep COFF symbols shorter
than 0xFFFF because the CodeView debugging format has a maximum
symbol/record size of 0xFFFF.

There are some quirks worth noting:
- Some mangled names reference other entities which are mangled
separately.  A quick example:

int I;
template <int *> struct S {};
S<I> s;

In this case, the mangling for 's' doesn't depend directly on the
mangling for 'I'.  While 's' would need an MD5 hash if 'I' also needed
one, the hash for 's' applied to the fully realized mangled name.  In
other words, the mangled name for 's' will not depend on the MD5 of the
mangled name for 'I'.

- Some mangled names, like the venerable CatchableType, embed the MD5
verbatim.

- Finally, the complete object locator is handled as a special case.
A complete object locators are mangled exactly like a VFTable except for
a small deviation in the prefix sigils.  However, complete object
locators for hashed vftables result in a complete object locator whose
name is identical to the vftable except for an additional suffix.

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

8 years ago[CLANG][AVX512][BUILTIN] Adding vpmultishiftqb{128|256|512}
Michael Zuckerman [Mon, 7 Mar 2016 08:29:10 +0000 (08:29 +0000)]
[CLANG][AVX512][BUILTIN] Adding vpmultishiftqb{128|256|512}

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

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

8 years ago[ASTMatchers] Document that isAnyPointer() matcher also matches Objective-C object...
Felix Berger [Sun, 6 Mar 2016 15:27:59 +0000 (15:27 +0000)]
[ASTMatchers] Document that isAnyPointer() matcher also matches Objective-C object pointers.

Summary: Add test for Objective-C object pointer matching.

Reviewers: aaron.ballman

Subscribers: klimek

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

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

8 years ago[Modules] Don't swallow errors when parsing optional attributes.
Davide Italiano [Sun, 6 Mar 2016 04:20:05 +0000 (04:20 +0000)]
[Modules] Don't swallow errors when parsing optional attributes.

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

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

8 years agoFixed -Wdocumentation warning - typo in a parameter name
Simon Pilgrim [Sat, 5 Mar 2016 22:35:55 +0000 (22:35 +0000)]
Fixed -Wdocumentation warning - typo in a parameter name

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

8 years agoMisc: add a test for TargetParser usage
Saleem Abdulrasool [Sat, 5 Mar 2016 21:12:33 +0000 (21:12 +0000)]
Misc: add a test for TargetParser usage

Ensure that an invalid value passed to target parser does not cause an assertion
in +Asserts builds.

Supporting test for PR26839.

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

8 years agoclang-format: [JS] Support destructuring assignments in for loops.
Daniel Jasper [Sat, 5 Mar 2016 18:34:26 +0000 (18:34 +0000)]
clang-format: [JS] Support destructuring assignments in for loops.

Before:
  for (let { a, b } of x) {
  }

After:
  for (let {a, b} of x) {
  }

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

8 years ago[X86] AMD Bobcat CPU (btver1) doesn't support XSAVE
Simon Pilgrim [Sat, 5 Mar 2016 14:35:44 +0000 (14:35 +0000)]
[X86] AMD Bobcat CPU (btver1) doesn't support XSAVE

btver1 is a SSSE3/SSE4a only CPU - it doesn't have AVX and doesn't support XSAVE.

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

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

8 years agoAdd null check to diagnostic path for lambda captures.
Richard Trieu [Sat, 5 Mar 2016 04:04:57 +0000 (04:04 +0000)]
Add null check to diagnostic path for lambda captures.

Previously, the failed capture of a variable in nested lambdas may crash when
the lambda pointer is null.  Only give the note if a location can be retreived
from the lambda pointer.

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

8 years agoTest commit: Fix run-on sentence in comment
Mike Spertus [Sat, 5 Mar 2016 01:56:07 +0000 (01:56 +0000)]
Test commit: Fix run-on sentence in comment

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

8 years ago[analyzer] Nullability: add option to not report on calls to system headers.
Devin Coughlin [Sat, 5 Mar 2016 01:32:43 +0000 (01:32 +0000)]
[analyzer] Nullability: add option to not report on calls to system headers.

Add an -analyzer-config 'nullability:NoDiagnoseCallsToSystemHeaders' option to
the nullability checker. When enabled, this option causes the analyzer to not
report about passing null/nullable values to functions and methods declared
in system headers.

This option is motivated by the observation that large projects may have many
nullability warnings. These projects may find warnings about nullability
annotations that they have explicitly added themselves higher priority to fix
than warnings on calls to system libraries.

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

8 years agoUpdate diagnostics now that hexadecimal literals look likely to be part of C++17.
Richard Smith [Fri, 4 Mar 2016 22:32:06 +0000 (22:32 +0000)]
Update diagnostics now that hexadecimal literals look likely to be part of C++17.

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

8 years agoPR5941 - improve diagnostic for * vs & confusion when choosing overload candidate...
David Blaikie [Fri, 4 Mar 2016 22:29:11 +0000 (22:29 +0000)]
PR5941 - improve diagnostic for * vs & confusion when choosing overload candidate with a parameter of incomplete (ref or pointer) type

Reviewers: dblaikie

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

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

8 years agoclang-cl: Enable PCH flags by default.
Nico Weber [Fri, 4 Mar 2016 21:59:42 +0000 (21:59 +0000)]
clang-cl: Enable PCH flags by default.

Now that pragma comment and pragma detect_mismatch are implemented, this might
just work.

Some pragmas aren't serialized yet (from the top of my head: code_seg, bss_seg,
data_seg, const_seg, init_seg, section, vtordisp), but these are as far as I
know usually pushed and popped within the header and usually don't leak out.
If it turns out the current PCH support isn't good enough yet, we can turn it
off again.

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

8 years agoImplement P0036R0: remove support for empty unary folds of +, *, |, &.
Richard Smith [Fri, 4 Mar 2016 21:27:21 +0000 (21:27 +0000)]
Implement P0036R0: remove support for empty unary folds of +, *, |, &.

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

8 years agoRevert r262741 - [OPENMP] Codegen for distribute directive
Samuel Antao [Fri, 4 Mar 2016 21:02:14 +0000 (21:02 +0000)]
Revert r262741 - [OPENMP] Codegen for distribute directive

Was causing a failure in one of the buildbot slaves.

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

8 years agoUpdate cxx_status with likely new features from Jacksonville WG21 meeting.
Richard Smith [Fri, 4 Mar 2016 21:01:14 +0000 (21:01 +0000)]
Update cxx_status with likely new features from Jacksonville WG21 meeting.

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

8 years agoSwitch krait to use -mcpu=cortex-a15 for assembler tool invocations.
Stephen Hines [Fri, 4 Mar 2016 20:57:22 +0000 (20:57 +0000)]
Switch krait to use -mcpu=cortex-a15 for assembler tool invocations.

Summary:
Using -no-integrated-as causes -mcpu=krait to be transformed into
-march=armv7-a today. This precludes the assembler from using
instructions like sdiv, which are present for krait. Cortex-a15 is the
closest subset of functionality for krait, so we should switch the
assembler to use that instead.

Reviewers: cfe-commits, apazos, weimingz

Subscribers: aemerson

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

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

8 years ago[OPENMP] Codegen for distribute directive
Carlo Bertolli [Fri, 4 Mar 2016 20:24:58 +0000 (20:24 +0000)]
[OPENMP] Codegen for distribute directive

This patch provide basic implementation of codegen for teams directive, excluding all clauses except dist_schedule. It also fixes parts of AST reader/writer to enable correct pre-compiled header handling.

http://reviews.llvm.org/D17170

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

8 years agoMake TargetInfo store an actual DataLayout instead of a string.
James Y Knight [Fri, 4 Mar 2016 19:00:41 +0000 (19:00 +0000)]
Make TargetInfo store an actual DataLayout instead of a string.

Use it to calculate UserLabelPrefix, instead of specifying it (often
incorrectly).

Note that the *actual* user label prefix has always come from the
DataLayout, and is handled within LLVM. The main thing clang's
TargetInfo::UserLabelPrefix did was to set the #define value. Having
these be different from each-other is just silly.

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

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

8 years ago[analyzer] Add diagnostic in ObjCDeallocChecker for use of -dealloc instead of -release.
Devin Coughlin [Fri, 4 Mar 2016 18:09:58 +0000 (18:09 +0000)]
[analyzer] Add diagnostic in ObjCDeallocChecker for use of -dealloc instead of -release.

In dealloc methods, the analyzer now warns when -dealloc is called directly on
a synthesized retain/copy ivar instead of -release. This is intended to find mistakes of
the form:

- (void)dealloc {
  [_ivar dealloc]; // Mistaken call to -dealloc instead of -release

  [super dealloc];
}

rdar://problem/16227989

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

8 years agoMove class into anonymous namespace. NFC.
Benjamin Kramer [Fri, 4 Mar 2016 14:18:52 +0000 (14:18 +0000)]
Move class into anonymous namespace. NFC.

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

8 years ago[SemaExprCXX] Avoid calling isInSystemHeader for invalid source locations
Pavel Labath [Fri, 4 Mar 2016 10:00:08 +0000 (10:00 +0000)]
[SemaExprCXX] Avoid calling isInSystemHeader for invalid source locations

Summary:
While diagnosing a CXXNewExpr warning, we were calling isInSystemHeader(), which expect to be
called with a valid source location. This causes an assertion failure if the location is unknown.
A quick grep shows it's not without precedent to guard calls to the function with a
"Loc.isValid()".

This fixes a test failure in LLDB, which always creates object with invalid source locations as it
does not (always) have access to the source.

Reviewers: nlewycky

Subscribers: lldb-commits, cfe-commits

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

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

8 years ago[OPENMP 4.0] Codegen for 'declare reduction' construct.
Alexey Bataev [Fri, 4 Mar 2016 09:22:22 +0000 (09:22 +0000)]
[OPENMP 4.0] Codegen for 'declare reduction' construct.

Emit function for 'combiner' part of 'declare reduction' construct and
'initialilzer' part, if any.

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

8 years ago[Coverage] Fix the start/end locations of switch statements
Vedant Kumar [Fri, 4 Mar 2016 08:07:15 +0000 (08:07 +0000)]
[Coverage] Fix the start/end locations of switch statements

While pushing switch statements onto the region stack we neglected to
specify their start/end locations. This results in a crash (PR26825) if
we end up in nested macro expansions without enough information to
handle the relevant file exits.

I added a test in switchmacro.c and fixed up a bunch of incorrect CHECK
lines that specify strange end locations for switches.

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

8 years ago[OPENMP] Simplify handling of clauses with postupdates, NFC.
Alexey Bataev [Fri, 4 Mar 2016 07:21:16 +0000 (07:21 +0000)]
[OPENMP] Simplify handling of clauses with postupdates, NFC.

Clauses with post-update expressions always have pre-init statement. So
OMPClauseWithPreInit now is the base for OMPClauseWithPostUpdate.

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

8 years ago[index] Distinguish USRs of anonymous enums by using their first enumerator.
Argyrios Kyrtzidis [Fri, 4 Mar 2016 07:17:53 +0000 (07:17 +0000)]
[index] Distinguish USRs of anonymous enums by using their first enumerator.

rdar://24609949.

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

8 years ago[index] Include parameter types in the USRs for C functions marked with 'overloadable...
Argyrios Kyrtzidis [Fri, 4 Mar 2016 07:17:48 +0000 (07:17 +0000)]
[index] Include parameter types in the USRs for C functions marked with 'overloadable' attribute.

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

8 years ago[index] In ObjC++ handle objc type parameters for function USRs.
Argyrios Kyrtzidis [Fri, 4 Mar 2016 07:17:43 +0000 (07:17 +0000)]
[index] In ObjC++ handle objc type parameters for function USRs.

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

8 years ago[OpenCL] Refine pipe builtin support
Xiuli Pan [Fri, 4 Mar 2016 07:11:16 +0000 (07:11 +0000)]
[OpenCL] Refine pipe builtin support

Summary:
Refine the type builtin support as the request with
http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160201/148637.html

Reviewers: pekka.jaaskelainen, Anastasia, yaxunl

Subscribers: rsmith, cfe-commits

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

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

8 years ago[MIPS] initFeatureMap() to handle empty string argument
Bhushan D. Attarde [Fri, 4 Mar 2016 06:56:29 +0000 (06:56 +0000)]
[MIPS] initFeatureMap() to handle empty string argument

    SUMMARY:
    This patch sets CPU string to its default value when it is not supplied by caller.

    Reviewers: vkalintiris, dsanders
    Subscribers: mohit.bhakkad, sagar, jaydeep, cfe-commits
    Differential Revision: http://reviews.llvm.org/D16139

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

8 years ago[X86] Pass __m64 types via SSE registers for GCC compatibility
David Majnemer [Fri, 4 Mar 2016 05:26:16 +0000 (05:26 +0000)]
[X86] Pass __m64 types via SSE registers for GCC compatibility

For compatibility with GCC, classify __m64 as SSE.
However, clang is a platform compiler for certain targets; retain our
old behavior on those targets: classify __m64 as integer.

This fixes PR26832.

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

8 years ago[VFS] Switch from close to SafelyCloseFileDescriptor
David Majnemer [Fri, 4 Mar 2016 05:26:14 +0000 (05:26 +0000)]
[VFS] Switch from close to SafelyCloseFileDescriptor

The SafelyCloseFileDescriptor machinery does the right thing in the face
of signals while close will do something platform specific which results
in the FD potentially getting leaked.

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