]> granicus.if.org Git - clang/log
clang
7 years agoRemove uses of std::binary_function, removed in C++17.
Richard Smith [Thu, 23 Mar 2017 23:32:03 +0000 (23:32 +0000)]
Remove uses of std::binary_function, removed in C++17.

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

7 years agoRemove all uses of std::mem_fun and std::bind1st removed in C++17.
Richard Smith [Thu, 23 Mar 2017 23:17:58 +0000 (23:17 +0000)]
Remove all uses of std::mem_fun and std::bind1st removed in C++17.

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

7 years agoUpdate the SamplePGO test to verify that unroll/icp is not invoked in thinlto compile...
Dehao Chen [Thu, 23 Mar 2017 21:20:17 +0000 (21:20 +0000)]
Update the SamplePGO test to verify that unroll/icp is not invoked in thinlto compile phase.

Summary: This is the test added for https://reviews.llvm.org/D31217

Reviewers: tejohnson, mehdi_amini

Reviewed By: tejohnson

Subscribers: cfe-commits, Prazek

Differential Revision: https://reviews.llvm.org/D31219

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

7 years ago[ThinLTO] Clang support for emitting minimized bitcode for thin link
Teresa Johnson [Thu, 23 Mar 2017 19:47:49 +0000 (19:47 +0000)]
[ThinLTO] Clang support for emitting minimized bitcode for thin link

Summary:
Clang companion patch to LLVM patch D31027, which adds support
for emitting minimized bitcode file for use in the thin link step.
Add a cc1 option -fthin-link-bitcode=<file> to trigger this behavior.

Depends on D31027.

Reviewers: mehdi_amini, pcc

Subscribers: cfe-commits, Prazek

Differential Revision: https://reviews.llvm.org/D31050

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

7 years agoCorrect class-template deprecation behavior-REDUX
Erich Keane [Thu, 23 Mar 2017 18:51:54 +0000 (18:51 +0000)]
Correct class-template deprecation behavior-REDUX

Correct class-template deprecation behavior

Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;

This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.

Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.

Previous DiffRev: https://reviews.llvm.org/D27486, was reverted.
This patch fixes the issues brought up here by the reverter: https://reviews.llvm.org/rL298410

Differential Revision: https://reviews.llvm.org/D31245

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

7 years ago[index] When indexing system headers make sure to report important reference relations
Argyrios Kyrtzidis [Thu, 23 Mar 2017 16:34:47 +0000 (16:34 +0000)]
[index] When indexing system headers make sure to report important reference relations

Even if we exclude plain reference occurrences, we should include relation-based references, like the 'base' one.

rdar://31010737

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

7 years agoPublish RAIIObjectsForParser.h for external usage.
Vassil Vassilev [Thu, 23 Mar 2017 15:11:07 +0000 (15:11 +0000)]
Publish RAIIObjectsForParser.h for external usage.

Some clients (eg the cling interpreter) need to recover their parser from
errors.

Patch by Axel Naumann (D31190)!

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

7 years agoSupport attributes for Objective-C categories
Alex Lorenz [Thu, 23 Mar 2017 11:44:25 +0000 (11:44 +0000)]
Support attributes for Objective-C categories

rdar://31095315

Differential Revision: https://reviews.llvm.org/D31179

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

7 years ago[CodeGen] Emit a CoreFoundation link guard when @available is used
Alex Lorenz [Thu, 23 Mar 2017 11:14:27 +0000 (11:14 +0000)]
[CodeGen] Emit a CoreFoundation link guard when @available is used

After r297760, __isOSVersionAtLeast in compiler-rt loads the CoreFoundation
symbols at runtime. This means that `@available` will always fail when used in a
binary without a linked CoreFoundation.

This commit forces Clang to emit a reference to a CoreFoundation symbol when
`@available` is used to ensure that linking will fail when CoreFoundation isn't
linked with the build product.

rdar://31039592

Differential Revision: https://reviews.llvm.org/D30977

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

7 years ago[ObjC][ARC] Avoid -Warc-performSelector-leaks for performSelector variations
Alex Lorenz [Thu, 23 Mar 2017 10:46:05 +0000 (10:46 +0000)]
[ObjC][ARC] Avoid -Warc-performSelector-leaks for performSelector variations
that became supported after r297019

The commit r297019 expanded the performSelector ObjC method family heuristic
to ensure that -Wobjc-unsafe-perform-selector covers all performSelector
variations. However, this made the -Warc-performSelector-leaks too noisy, as
that warning produces mostly false positives since the selector is unknown.
This commit reverts the ObjC method family heuristics introduced in r297019.
This ensures that -Warc-performSelector-leaks isn't too noisy. The commit still
preserves the coverage of -Wobjc-unsafe-perform-selector.

rdar://31124629

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

7 years agoFix issues in clang-format's AlignConsecutive modes.
Nikola Smiljanic [Thu, 23 Mar 2017 02:51:25 +0000 (02:51 +0000)]
Fix issues in clang-format's AlignConsecutive modes.

Patch by Ben Harper.

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

7 years ago[coroutines] Implement unhandled_exception changes.
Eric Fiselier [Thu, 23 Mar 2017 00:33:33 +0000 (00:33 +0000)]
[coroutines] Implement unhandled_exception changes.

Summary:
This patch adopts the recent changes that renamed `set_exception(exception_pointer)` to `unhandled_exception()`.

Additionally `unhandled_exception()` is now required, and so an error is emitted when exceptions are enabled but the promise type does not provide the member.
When exceptions are disabled a warning is emitted instead of an error, The warning notes that the `unhandled_exception()` function is required when exceptions are enabled.

Reviewers: rsmith, GorNishanov, aaron.ballman, majnemer

Reviewed By: GorNishanov

Subscribers: mehdi_amini, cfe-commits

Differential Revision: https://reviews.llvm.org/D30859

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

7 years agoActually install scan-build / ccc-analyzer / c++-analyzer on windows
Jonathan Roelofs [Wed, 22 Mar 2017 21:13:49 +0000 (21:13 +0000)]
Actually install scan-build / ccc-analyzer / c++-analyzer on windows

Before, we were only installing the wrappers... oops.

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

7 years ago[X86] Implement __readgsqword (and the rest) as builtins (PR32373)
Hans Wennborg [Wed, 22 Mar 2017 19:13:13 +0000 (19:13 +0000)]
[X86] Implement __readgsqword (and the rest) as builtins (PR32373)

It seems MS headers have started using __readgsqword, and since it's
used in a header that doesn't include intrin.h, we can't implement it as
an inline function anymore.

That was already the case for __readfsdword, which Saleem added support
for in r220859. This patch reuses that codegen to implement all of
__read[fg]s{byte,word,dword,qword}.

Differential Revision: https://reviews.llvm.org/D31248

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

7 years ago[X86][MMX] Add tests for _mm_set*_* intrinsics
Simon Pilgrim [Wed, 22 Mar 2017 14:55:43 +0000 (14:55 +0000)]
[X86][MMX] Add tests for _mm_set*_* intrinsics

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

7 years agoRevert "Correct class-template deprecation behavior"
Martin Bohme [Wed, 22 Mar 2017 13:34:37 +0000 (13:34 +0000)]
Revert "Correct class-template deprecation behavior"

This reverts commit r298410 (which produces incorrect warnings, see
comments on https://reviews.llvm.org/rL298410).

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

7 years agoRevert "iFix Test deprecation behavior in C89 mode as a result of r298410"
Martin Bohme [Wed, 22 Mar 2017 13:33:03 +0000 (13:33 +0000)]
Revert "iFix Test deprecation behavior in C89 mode as a result of r298410"

This reverts commit r298433. (Required to revert r298410, see comments
there.)

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

7 years agoRemove an overly aggressive assert in r298491 and leave a comment
Chandler Carruth [Wed, 22 Mar 2017 10:38:07 +0000 (10:38 +0000)]
Remove an overly aggressive assert in r298491 and leave a comment
explaining why we have to ignore errors here even though in other parts
of codegen we can be more strict with builtins.

Also add a test case based on the code in a TSan test that found this
issue.

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

7 years ago[Serialization] Serialize DependentSizedExtVectorType
Alex Lorenz [Wed, 22 Mar 2017 10:04:48 +0000 (10:04 +0000)]
[Serialization] Serialize DependentSizedExtVectorType

rdar://30659700

Differential Revision: https://reviews.llvm.org/D31134

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

7 years ago[nonnull] Teach Clang to attach the nonnull LLVM attribute to
Chandler Carruth [Wed, 22 Mar 2017 09:09:13 +0000 (09:09 +0000)]
[nonnull] Teach Clang to attach the nonnull LLVM attribute to
declarations and calls instead of just definitions, and then teach it to
*not* attach such attributes even if the source code contains them.

This follows the design direction discussed on cfe-dev here:
http://lists.llvm.org/pipermail/cfe-dev/2017-January/052066.html

The idea is that for C standard library builtins, even if the library
vendor chooses to annotate their routines with __attribute__((nonnull)),
we will ignore those attributes which pertain to pointer arguments that
have an associated size. This allows the widespread (and seemingly
reasonable) pattern of calling these routines with a null pointer and
a zero size. I have only done this for the library builtins currently
recognized by Clang, but we can now trivially add to this set. This will
be controllable with -fno-builtin if anyone should care to do so.

Note that this does *not* change the AST. As a consequence, warnings,
static analysis, and source code rewriting are not impacted.

This isn't even a regression on any platform as neither Clang nor LLVM
have ever put 'nonnull' onto these arguments for declarations. All this
patch does is enable it on other declarations while preventing us from
ever accidentally enabling it on these libc functions due to a library
vendor.

It will also allow any other libraries using this annotation to gain
optimizations based on the annotation even when only a declaration is
visible.

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

7 years agoAdd LibreOffice Clang plugin to ExternalClangExamples.rst
Stephan Bergmann [Wed, 22 Mar 2017 08:45:49 +0000 (08:45 +0000)]
Add LibreOffice Clang plugin to ExternalClangExamples.rst

Reviewers: rsmith, rizsotto.mailinglist

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D31133

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

7 years agoMove setting of LangOpts based on target flags out of CompilerInstance
Eric Christopher [Wed, 22 Mar 2017 06:36:09 +0000 (06:36 +0000)]
Move setting of LangOpts based on target flags out of CompilerInstance
and into TargetInfo::adjust so that it gets called in more places
throughout the compiler (AST serialization in particular).

Should fix PPC modules after removing of faltivec.

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

7 years agoSuppress warning on unreachable [[clang::fallthrough]] within a template instantiation.
Richard Smith [Wed, 22 Mar 2017 01:49:19 +0000 (01:49 +0000)]
Suppress warning on unreachable [[clang::fallthrough]] within a template instantiation.

We don't know whether some other instantiation of the template might be able to
reach the annotation, so warning on it has a high chance of false positives.

Patch by Ahmed Asadi!

Differential Revision: https://reviews.llvm.org/D31069

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

7 years agoRemove -ffp-contract=fast from this test
Adam Nemet [Wed, 22 Mar 2017 00:58:18 +0000 (00:58 +0000)]
Remove -ffp-contract=fast from this test

It does not need it and causes mismatch after -ffp-contract=fast is turned
into an FMF.

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

7 years agoChange -ffp-contract=fast test to run on Aarch64
Adam Nemet [Wed, 22 Mar 2017 00:58:15 +0000 (00:58 +0000)]
Change -ffp-contract=fast test to run on Aarch64

(I don't have powerpc enabled in my build and I am changing
how -ffp-contract=fast works.)

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

7 years ago[Modules] Rebuild modules on umbrella header mismatch
Bruno Cardoso Lopes [Wed, 22 Mar 2017 00:11:21 +0000 (00:11 +0000)]
[Modules] Rebuild modules on umbrella header mismatch

This restores behavior pre-r230064 since after PCMCache work (r298278)
we don't reload PCMs from disk within the same compiler invocation.

Testcases from r230064 are still left around since they still guarantee
the correct behavior we're expecting.

rdar://problem/19889777

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

7 years agoRemove the -faltivec alias option and replace it with -maltivec everywhere.
Eric Christopher [Tue, 21 Mar 2017 22:06:18 +0000 (22:06 +0000)]
Remove the -faltivec alias option and replace it with -maltivec everywhere.
The alias was only ever used on darwin and had some issues there,
and isn't used in practice much. Also fixes a problem with -mno-altivec
not turning off -maltivec.

Also add a diagnostic for faltivec/fno-altivec that directs users to use
maltivec options and include the altivec.h file explicitly.

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

7 years agoAdd support for -fno-auto-profile and -fno-profile-sample-use
Dehao Chen [Tue, 21 Mar 2017 21:40:53 +0000 (21:40 +0000)]
Add support for -fno-auto-profile and -fno-profile-sample-use

Summary: We need to be able to disable samplepgo for specific files by supporting -fno-auto-profile and -fno-profile-sample-use

Reviewers: davidxl, dnovillo, echristo

Reviewed By: echristo

Subscribers: echristo, cfe-commits

Differential Revision: https://reviews.llvm.org/D31213

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

7 years agoApply clang-tidy's performance-unnecessary-value-param to parts of clang.
Benjamin Kramer [Tue, 21 Mar 2017 21:35:04 +0000 (21:35 +0000)]
Apply clang-tidy's performance-unnecessary-value-param to parts of clang.

No functionality change intended.

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

7 years ago[c-index-test] Fix memory leak in c-index-test tool.
Argyrios Kyrtzidis [Tue, 21 Mar 2017 21:34:05 +0000 (21:34 +0000)]
[c-index-test] Fix memory leak in c-index-test tool.

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

7 years agoiFix Test deprecation behavior in C89 mode as a result of r298410
Erich Keane [Tue, 21 Mar 2017 20:14:46 +0000 (20:14 +0000)]
iFix Test deprecation behavior in C89 mode as a result of r298410

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

7 years agoLet llvm.objectsize be conservative with null pointers
George Burgess IV [Tue, 21 Mar 2017 20:09:35 +0000 (20:09 +0000)]
Let llvm.objectsize be conservative with null pointers

D28494 adds another parameter to @llvm.objectsize. Clang needs to be
sure to pass that third arg whenever applicable.

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

7 years agoClang change: Do not inline hot callsites for samplepgo in thinlto compile phase.
Dehao Chen [Tue, 21 Mar 2017 19:55:46 +0000 (19:55 +0000)]
Clang change: Do not inline hot callsites for samplepgo in thinlto compile phase.

Summary:
Because SamplePGO passes will be invoked twice in ThinLTO build: once at compile phase, the other at backend. We want to make sure the IR at the 2nd phase matches the hot part in pro
file, thus we do not want to inline hot callsites in the first phase.

Reviewers: tejohnson, eraman

Reviewed By: tejohnson

Subscribers: mehdi_amini, cfe-commits, Prazek

Differential Revision: https://reviews.llvm.org/D31202

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

7 years ago[X86][MS-compatability][clang] allow MS TYPE/SIZE/LENGTH operators as a part of a...
Coby Tayree [Tue, 21 Mar 2017 19:33:32 +0000 (19:33 +0000)]
[X86][MS-compatability][clang] allow MS TYPE/SIZE/LENGTH operators as a part of a compound expression

This patch introduces X86AsmParser with the ability to handle the aforementioned ops within compound "MS" arithmetical expressions.
Currently - only supported as a stand alone Operand, e.g.:
"TYPE X"
now allowed :
"4 + TYPE X * 128"

LLVM side: https://reviews.llvm.org/D31173
Differential Revision: https://reviews.llvm.org/D31174

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

7 years ago[CMake] fix CLANG_INCLUDE_DIRS CMake export
Guillaume Papin [Tue, 21 Mar 2017 19:17:53 +0000 (19:17 +0000)]
[CMake] fix CLANG_INCLUDE_DIRS CMake export

Summary:
This change should fixes the export of CLANG_INCLUDE_DIRS variable in ClangConfig.cmake.

Unlike for the other variables, CLANG_INSTALL_PREFIX wasn't escaped meaning CLANG_INCLUDE_DIRS
resulting in the path "/include" instead of "${CLANG_INSTALL_PREFIX}/include".

Reviewers: beanz

Subscribers: mgorny

Differential Revision: https://reviews.llvm.org/D30911

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

7 years agoFix array sizes where address space is not yet known
Konstantin Zhuravlyov [Tue, 21 Mar 2017 18:55:39 +0000 (18:55 +0000)]
Fix array sizes where address space is not yet known

For variables in generic address spaces, for example:

```
unsigned char V[6442450944];
...
```

the address space is not yet known when we get into
*getConstantArrayType*, it is 0. AMDGCN target's
address space 0 has 32 bits pointers, so when we
call *getPointerWidth* with 0, the array size is
trimmed to 32 bits, which is not right.

Differential Revision: https://reviews.llvm.org/D30845

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

7 years agoModules: Remove an invalid check in unit tests for r298278
Duncan P. N. Exon Smith [Tue, 21 Mar 2017 18:26:18 +0000 (18:26 +0000)]
Modules: Remove an invalid check in unit tests for r298278

This is a fixup for the unit tests from r298278 (originally r298165).

Since the buffer that RawB2 pointed at was later deleted, a new call to
getBuffer may very well return a buffer at the same/old address.  Which is
fine.  Just delete the spurious check.

A Windows bot was occasionally hitting this in practice:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/7086

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

7 years agoCorrect class-template deprecation behavior
Erich Keane [Tue, 21 Mar 2017 17:49:17 +0000 (17:49 +0000)]
Correct class-template deprecation behavior

Based on the comment in the test, and my reading of the standard, a deprecated warning should be issued in the following case:
template<typename T> [[deprecated]] class Foo{}; Foo<int> f;

This was not the case, because the ClassTemplateSpecializationDecl creation did not also copy the deprecated attribute.

Note: I did NOT audit the complete set of attributes to see WHICH ones should be copied, so instead I simply copy ONLY the deprecated attribute.

Differential Revision: https://reviews.llvm.org/D27486

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

7 years agoUpdate Clang for LLVM rename AttributeSet -> AttributeList
Reid Kleckner [Tue, 21 Mar 2017 16:57:30 +0000 (16:57 +0000)]
Update Clang for LLVM rename AttributeSet -> AttributeList

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

7 years ago[index/AST] Determine if a typedef shares a name and spelling location with its under...
Argyrios Kyrtzidis [Tue, 21 Mar 2017 16:56:02 +0000 (16:56 +0000)]
[index/AST] Determine if a typedef shares a name and spelling location with its underlying tag type

In such a case, as when using the NS_ENUM macro, for indexing purposes treat the typedef as 'transparent',
meaning we treat its references as symbols of the underlying tag symbol.
Also provide a libclang API to check for such typedefs.

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

7 years ago[Modules] Find PrivateHeaders when looking into subframeworks
Bruno Cardoso Lopes [Tue, 21 Mar 2017 16:43:51 +0000 (16:43 +0000)]
[Modules] Find PrivateHeaders when looking into subframeworks

Fix the current parsing of subframeworks in modulemaps to lookup for
headers based on whether they are frameworks.

rdar://problem/30563982

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

7 years ago[DOXYGEN] Improvements to smmintrin.h and emmintrin.h intrinsics.
Ekaterina Romanova [Tue, 21 Mar 2017 13:34:06 +0000 (13:34 +0000)]
[DOXYGEN] Improvements to smmintrin.h and emmintrin.h intrinsics.

I made some small changes in smmintrin.h and emmintrin.h intrinsics.
 - changed some regular comments '//' into doxygen-style comments '///' where necessary
 - removed some trailing spaces in doxygen comments.

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@298371 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[OpenCL] Added diagnostic for checking length of vector
Egor Churaev [Tue, 21 Mar 2017 13:20:57 +0000 (13:20 +0000)]
[OpenCL] Added diagnostic for checking length of vector

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

Differential Revision: https://reviews.llvm.org/D30937

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

7 years ago[OpenCL] Added implicit conversion rank for overloading functions with vector data...
Egor Churaev [Tue, 21 Mar 2017 12:55:55 +0000 (12:55 +0000)]
[OpenCL] Added implicit conversion rank for overloading functions with vector data type in OpenCL

Summary: I added a new rank to ImplicitConversionRank enum to resolve the function overload ambiguity with vector types. Rank of scalar types conversion is lower than vector splat. So, we can choose which function should we call. See test for more details.

Reviewers: Anastasia, cfe-commits

Reviewed By: Anastasia

Subscribers: bader, yaxunl

Differential Revision: https://reviews.llvm.org/D30816

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

7 years ago[X86][AVX512] Add _mm512_cvtsd_f64 and _mm512_cvtss_f32 intrinsics (PR32305)
Simon Pilgrim [Tue, 21 Mar 2017 12:46:13 +0000 (12:46 +0000)]
[X86][AVX512] Add _mm512_cvtsd_f64 and _mm512_cvtss_f32 intrinsics (PR32305)

Differential Revision: https://reviews.llvm.org/D31155

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

7 years ago[scan-build-py] reuse command line output parameter for report directory
Laszlo Nagy [Tue, 21 Mar 2017 10:15:18 +0000 (10:15 +0000)]
[scan-build-py] reuse command line output parameter for report directory

Differential Revision: https://reviews.llvm.org/D30861

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

7 years agoAdd support for attribute enum_extensibility.
Akira Hatanaka [Tue, 21 Mar 2017 02:23:00 +0000 (02:23 +0000)]
Add support for attribute enum_extensibility.

This commit adds support for a new attribute that will be used to
distinguish between extensible and inextensible enums. There are three
main purposes of this attribute:

1. Give better control over when enum-related warnings are issued.
For example, in the code below, clang will not issue a -Wassign-enum
warning if the enum is marked "open":

enum __attribute__((enum_extensibility(closed))) EnumClosed {
  B0 = 1, B1 = 10
};

enum __attribute__((enum_extensibility(open))) EnumOpen {
  C0 = 1, C1 = 10
};

enum EnumClosed ec = 100; // warning issued
enum EnumOpen eo = 100; // no warning

2. Enable code-completion and debugging tools to offer better
suggestions.

3. Make it easier for swift's clang importer to determine which swift
type an enum should be mapped to.

For more details, see the discussion I started on cfe-dev:
http://lists.llvm.org/pipermail/cfe-dev/2017-February/052748.html

rdar://problem/12764379
rdar://problem/23145650

Differential Revision: https://reviews.llvm.org/D30766

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

7 years agoIRGen: Do not set dllexport on declarations.
Peter Collingbourne [Tue, 21 Mar 2017 02:02:41 +0000 (02:02 +0000)]
IRGen: Do not set dllexport on declarations.

Setting dllexport on a declaration has no effect, as we do not emit export
directives for declarations.

Part of the fix for PR32334.

Differential Revision: https://reviews.llvm.org/D31162

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

7 years agoAdd a function to MD5 a file's contents.
Zachary Turner [Mon, 20 Mar 2017 23:33:18 +0000 (23:33 +0000)]
Add a function to MD5 a file's contents.

In doing so, clean up the MD5 interface a little.  Most
existing users only care about the lower 8 bytes of an MD5,
but for some users that care about the upper and lower,
there wasn't a good interface.  Furthermore, consumers
of the MD5 checksum were required to handle endianness
details on their own, so it seems reasonable to abstract
this into a nicer interface that just gives you the right
value.

Differential Revision: https://reviews.llvm.org/D31105

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

7 years agoFix parsing of htmxlintrin.h in C++ mode
Eric Christopher [Mon, 20 Mar 2017 22:31:33 +0000 (22:31 +0000)]
Fix parsing of htmxlintrin.h in C++ mode
 - Fix a variable naming mismatch
 - Fix gcc extension pointer arithmetic on void to cast to char *.
 - Test that the header (and htmintrin.h) parse.

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

7 years ago[docs] Clarify sanitizer flag behavior
Vedant Kumar [Mon, 20 Mar 2017 21:40:58 +0000 (21:40 +0000)]
[docs] Clarify sanitizer flag behavior

PR32346 suggests that UBSan's docs about the -fsanitize,
-fno-sanitize-recover, and -fsanitize-trap options are not explicit
enough. Try to improve the wording.

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

7 years agoTurn on HTM on power8 and later (including powerpc64le) since it's
Eric Christopher [Mon, 20 Mar 2017 21:12:53 +0000 (21:12 +0000)]
Turn on HTM on power8 and later (including powerpc64le) since it's
available by default on those cpus and configurations.

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

7 years agoProposal: Backward-edge CFI for return statements (RCFI)
Kostya Serebryany [Mon, 20 Mar 2017 20:42:00 +0000 (20:42 +0000)]
Proposal: Backward-edge CFI for return statements (RCFI)

Summary: Proposal: Backward-edge CFI for return statements (RCFI)

Reviewers: pcc, eugenis, krasin

Reviewed By: eugenis

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31112

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

7 years agoAvoid these headers looking like the same file on a content-addressed file system.
Richard Smith [Mon, 20 Mar 2017 20:14:03 +0000 (20:14 +0000)]
Avoid these headers looking like the same file on a content-addressed file system.

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

7 years agoBump __cplusplus for C++17 to 201703L per the C++17 DIS.
Richard Smith [Mon, 20 Mar 2017 20:12:48 +0000 (20:12 +0000)]
Bump __cplusplus for C++17 to 201703L per the C++17 DIS.

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

7 years agoReapply "Modules: Cache PCMs in memory and avoid a use-after-free"
Duncan P. N. Exon Smith [Mon, 20 Mar 2017 17:58:26 +0000 (17:58 +0000)]
Reapply "Modules: Cache PCMs in memory and avoid a use-after-free"

This reverts commit r298185, effectively reapplying r298165, after fixing the
new unit tests (PR32338).  The memory buffer generator doesn't null-terminate
the MemoryBuffer it creates; this version of the commit informs getMemBuffer
about that to avoid the assert.

Original commit message follows:

----

Clang's internal build system for implicit modules uses lock files to
ensure that after a process writes a PCM it will read the same one back
in (without contention from other -cc1 commands).  Since PCMs are read
from disk repeatedly while invalidating, building, and importing, the
lock is not released quickly.  Furthermore, the LockFileManager is not
robust in every environment.  Other -cc1 commands can stall until
timeout (after about eight minutes).

This commit changes the lock file from being necessary for correctness
to a (possibly dubious) performance hack.  The remaining benefit is to
reduce duplicate work in competing -cc1 commands which depend on the
same module.  Follow-up commits will change the internal build system to
continue after a timeout, and reduce the timeout.  Perhaps we should
reconsider blocking at all.

This also fixes a use-after-free, when one part of a compilation
validates a PCM and starts using it, and another tries to swap out the
PCM for something new.

The PCMCache is a new type called MemoryBufferCache, which saves memory
buffers based on their filename.  Its ownership is shared by the
CompilerInstance and ModuleManager.

- The ModuleManager stores PCMs there that it loads from disk, never
touching the disk if the cache is hot.

- When modules fail to validate, they're removed from the cache.

- When a CompilerInstance is spawned to build a new module, each
already-loaded PCM is assumed to be valid, and is frozen to avoid
the use-after-free.

- Any newly-built module is written directly to the cache to avoid the
round-trip to the filesystem, making lock files unnecessary for
correctness.

Original patch by Manman Ren; most testcases by Adrian Prantl!

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

7 years agoFix some sphinx -Werror's
Jonathan Roelofs [Mon, 20 Mar 2017 17:07:49 +0000 (17:07 +0000)]
Fix some sphinx -Werror's

... mostly having to do with code blocks which the syntax highlighter chokes on

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

7 years ago[OpenCL] Fix extension guards for atomic functions
Anastasia Stulova [Mon, 20 Mar 2017 15:02:54 +0000 (15:02 +0000)]
[OpenCL] Fix extension guards for atomic functions

Review: D30830

Patch by James Price!

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

7 years agoAdd more examples to clang-format configuration
Sylvestre Ledru [Mon, 20 Mar 2017 12:56:40 +0000 (12:56 +0000)]
Add more examples to clang-format configuration

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D30990

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

7 years ago[scan-build-py] use python tempfile for tempdir
Laszlo Nagy [Mon, 20 Mar 2017 09:03:24 +0000 (09:03 +0000)]
[scan-build-py] use python tempfile for tempdir

Differential Revision: https://reviews.llvm.org/D30862

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

7 years agoCleaning up the IdentifierResolver::iterator class a bit; NFC.
Aaron Ballman [Sun, 19 Mar 2017 15:15:28 +0000 (15:15 +0000)]
Cleaning up the IdentifierResolver::iterator class a bit; NFC.

The comment about there being three different forms that Ptr represents was stale. Also, the opaque value does not need to be exposed (these functions are unused).

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

7 years ago[X86][AVX512][Clang][Intrinsics] Adding missing intrinsics to Clang .
Igor Breger [Sun, 19 Mar 2017 08:27:16 +0000 (08:27 +0000)]
[X86][AVX512][Clang][Intrinsics] Adding missing intrinsics to Clang .

Summary:
Adding missing intrinsics :
    _mm512_set_epi16,
    _mm512_set_epi8,
    _mm512_permutevar_epi32
    _mm512_mask_permutevar_epi32

Reviewers: zvi, guyblank, eladcohen, craig.topper

Reviewed By: craig.topper

Subscribers: craig.topper, cfe-commits

Differential Revision: https://reviews.llvm.org/D31034

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

7 years agoRevert "Modules: Cache PCMs in memory and avoid a use-after-free"
Renato Golin [Sat, 18 Mar 2017 12:31:32 +0000 (12:31 +0000)]
Revert "Modules: Cache PCMs in memory and avoid a use-after-free"

This reverts commit r298165, as it broke the ARM builds.

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

7 years ago[X86] Add NumRegisterParameters Module Flag.
Nirav Dave [Sat, 18 Mar 2017 00:43:39 +0000 (00:43 +0000)]
[X86] Add NumRegisterParameters Module Flag.

Reviewers: rnk, mkuper

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D27051

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

7 years ago[Modules] In case of lock timeout, fallback and build module
Bruno Cardoso Lopes [Sat, 18 Mar 2017 00:26:18 +0000 (00:26 +0000)]
[Modules] In case of lock timeout, fallback and build module

Duncan's r298165 introduced the PCMCache mechanism, which guarantees
that locks aren't necessary anymore for correctness but only for
performance, by avoiding building it twice when possible.

Change the logic to avoid an error but actually build the module in case
the timeout happens. Instead of an error, still emit a remark for
debugging purposes.

rdar://problem/30297862

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

7 years ago[index] For C++ constructors/destructors, add references to the parent type where...
Argyrios Kyrtzidis [Fri, 17 Mar 2017 23:41:59 +0000 (23:41 +0000)]
[index] For C++ constructors/destructors, add references to the parent type where its name appears in definitions and declarations

Patch by Nathan Hawes!
https://reviews.llvm.org/D30730

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

7 years agoModules: Cache PCMs in memory and avoid a use-after-free
Duncan P. N. Exon Smith [Fri, 17 Mar 2017 22:55:13 +0000 (22:55 +0000)]
Modules: Cache PCMs in memory and avoid a use-after-free

Clang's internal build system for implicit modules uses lock files to
ensure that after a process writes a PCM it will read the same one back
in (without contention from other -cc1 commands).  Since PCMs are read
from disk repeatedly while invalidating, building, and importing, the
lock is not released quickly.  Furthermore, the LockFileManager is not
robust in every environment.  Other -cc1 commands can stall until
timeout (after about eight minutes).

This commit changes the lock file from being necessary for correctness
to a (possibly dubious) performance hack.  The remaining benefit is to
reduce duplicate work in competing -cc1 commands which depend on the
same module.  Follow-up commits will change the internal build system to
continue after a timeout, and reduce the timeout.  Perhaps we should
reconsider blocking at all.

This also fixes a use-after-free, when one part of a compilation
validates a PCM and starts using it, and another tries to swap out the
PCM for something new.

The PCMCache is a new type called MemoryBufferCache, which saves memory
buffers based on their filename.  Its ownership is shared by the
CompilerInstance and ModuleManager.

  - The ModuleManager stores PCMs there that it loads from disk, never
    touching the disk if the cache is hot.

  - When modules fail to validate, they're removed from the cache.

  - When a CompilerInstance is spawned to build a new module, each
    already-loaded PCM is assumed to be valid, and is frozen to avoid
    the use-after-free.

  - Any newly-built module is written directly to the cache to avoid the
    round-trip to the filesystem, making lock files unnecessary for
    correctness.

Original patch by Manman Ren; most testcases by Adrian Prantl!

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

7 years ago[Sema] Unbreak GCC -Werror build (enum compare).
Davide Italiano [Fri, 17 Mar 2017 22:19:20 +0000 (22:19 +0000)]
[Sema] Unbreak GCC -Werror build (enum compare).

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

7 years agoImplement DR 373 "Lookup on namespace qualified name in using-directive"
Matthias Gehre [Fri, 17 Mar 2017 21:41:20 +0000 (21:41 +0000)]
Implement DR 373 "Lookup on namespace qualified name in using-directive"

Summary:
3.4.6 [basic.lookup.udir] paragraph 1:
In a using-directive or namespace-alias-definition, during the lookup for a namespace-name or for a name in a nested-name-specifier, only namespace names are considered.

Reviewers: rsmith, aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D30848

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

7 years ago[clang-cl] Fix cross-compilation with MSVC 2017.
Zachary Turner [Fri, 17 Mar 2017 16:24:34 +0000 (16:24 +0000)]
[clang-cl] Fix cross-compilation with MSVC 2017.

clang-cl works best when the user runs vcvarsall to set up
an environment before running, but even this is not enough
on VC 2017 when cross compiling (e.g. using an x64 toolchain
to target x86, or vice versa).

The reason is that although clang-cl itself will have a
valid environment, it will shell out to other tools (such
as link.exe) which may not.  Generally we solve this through
adding the appropriate linker flags, but this is not enough
in VC 2017.

The cross-linker and the regular linker both link against
some common DLLs, but these DLLs live in the binary directory
of the native linker.  When setting up a cross-compilation
environment through vcvarsall, it will add *both* directories
to %PATH%, so that when cl shells out to any of the associated
tools, those tools will be able to find all of the dependencies
that it links against.  If you don't do this, link.exe will
fail to run because the loader won't be able to find all of
the required DLLs that it links against.

To solve this we teach the driver how to spawn a process with
an explicitly specified environment.  Then we modify the
PATH before shelling out to subtools and run with the modified
PATH.

Patch by Hamza Sood
Differential Revision: https://reviews.llvm.org/D30991

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

7 years agoTest commit.
David Green [Fri, 17 Mar 2017 15:38:49 +0000 (15:38 +0000)]
Test commit.

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

7 years ago[AVX-512] Change the input type for some load intrinsics to take void type like the...
Craig Topper [Fri, 17 Mar 2017 05:59:25 +0000 (05:59 +0000)]
[AVX-512] Change the input type for some load intrinsics to take void type like the spec (and the test cases say).

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

7 years ago[AVX-512] Fix test cases that were using the builtins directly without typecasts...
Craig Topper [Fri, 17 Mar 2017 05:59:22 +0000 (05:59 +0000)]
[AVX-512] Fix test cases that were using the builtins directly without typecasts instead of the intrinsic header.

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

7 years ago[AVX-512] Add missing typecasts and parentheses to _mm512_mask_i64gather_ps. My macro...
Craig Topper [Fri, 17 Mar 2017 05:14:37 +0000 (05:14 +0000)]
[AVX-512] Add missing typecasts and parentheses to _mm512_mask_i64gather_ps. My macro cleanup script I used on the others last year must have missed it.

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

7 years ago[Serialization] Follow-up to r297972, deserialize name/loc in separate statements...
Argyrios Kyrtzidis [Fri, 17 Mar 2017 00:49:42 +0000 (00:49 +0000)]
[Serialization] Follow-up to r297972, deserialize name/loc in separate statements to make sure they deserialize in defined order.

This should fix the windows bots.

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

7 years agoRemove setting LessPreciseFPMADOption on the TargetOption as it's
Eric Christopher [Fri, 17 Mar 2017 00:37:53 +0000 (00:37 +0000)]
Remove setting LessPreciseFPMADOption on the TargetOption as it's
unused anywhere in llvm.

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

7 years ago[Headers] Reapply: Add #include_next for tgmath.h on Darwin
Bruno Cardoso Lopes [Thu, 16 Mar 2017 23:19:00 +0000 (23:19 +0000)]
[Headers] Reapply: Add #include_next for tgmath.h on Darwin

Reapply r289181 but rename the include guard to avoid
conflict with the one from Darwin.

Allow darwin to provide additional definitions and implementation
specifc values for tgmath.h on Apple platforms.

rdar://problem/19019845

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

7 years ago[Modules] Add documentation on private frameworks
Bruno Cardoso Lopes [Thu, 16 Mar 2017 23:18:55 +0000 (23:18 +0000)]
[Modules] Add documentation on private frameworks

Expand a bit on private modules with some guidance on how to write
them in the context of frameworks.

rdar://problem/24758771

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

7 years agoAdd a small test for __STRUCT_PARM_ALIGN__ for ppc64 darwin.
Eric Christopher [Thu, 16 Mar 2017 22:31:07 +0000 (22:31 +0000)]
Add a small test for __STRUCT_PARM_ALIGN__ for ppc64 darwin.

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

7 years agoCreate msbuild only when using MSVC
Reid Kleckner [Thu, 16 Mar 2017 21:21:00 +0000 (21:21 +0000)]
Create msbuild only when using MSVC

Patch by: Mateusz Mikula

Reviewers: rnk

Reviewed By: rnk

Subscribers: asl, mgorny, cfe-commits

Tags: #clang-c

Differential Revision: https://reviews.llvm.org/D29772

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

7 years agoUse arg_begin() instead of getArgumentList().begin(), the argument list is an impleme...
Reid Kleckner [Thu, 16 Mar 2017 18:55:46 +0000 (18:55 +0000)]
Use arg_begin() instead of getArgumentList().begin(), the argument list is an implementation detail

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

7 years ago[AST] Follow-up to r297972, add default value for setGetterName/setSetterName if...
Argyrios Kyrtzidis [Thu, 16 Mar 2017 18:40:13 +0000 (18:40 +0000)]
[AST] Follow-up to r297972, add default value for setGetterName/setSetterName if a source-loc is not provided.

Fixes lldb build.

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

7 years ago[index/AST] Add references for ObjC getter=/setter= property attributes and related...
Argyrios Kyrtzidis [Thu, 16 Mar 2017 18:25:40 +0000 (18:25 +0000)]
[index/AST] Add references for ObjC getter=/setter= property attributes and related property getter/setter role fixes

This enhances the AST to keep track of locations of the names in those ObjC property attributes, and reports them for indexing.

Patch by Nathan Hawes!
https://reviews.llvm.org/D30907

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

7 years ago[ObjC][Sema] Avoid ARC performSelector error for 'self' selector
Alex Lorenz [Thu, 16 Mar 2017 16:36:11 +0000 (16:36 +0000)]
[ObjC][Sema] Avoid ARC performSelector error for 'self' selector

The instance method 'self' does not actually return an over-retained object,
so we shouldn't report an error when it's used with 'performSelector'.

rdar://31071620

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

7 years agoMake table cells referring to Clang 4 green, as Clang 4 has been released.
Ed Schouten [Thu, 16 Mar 2017 14:21:00 +0000 (14:21 +0000)]
Make table cells referring to Clang 4 green, as Clang 4 has been released.

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

7 years ago[OpenCL] Implement as_type operator as alias of __builtin_astype.
Egor Churaev [Thu, 16 Mar 2017 12:15:10 +0000 (12:15 +0000)]
[OpenCL] Implement as_type operator as alias of __builtin_astype.

Reviewers: Anastasia

Reviewed By: Anastasia

Subscribers: cfe-commits, yaxunl, bader

Differential Revision: https://reviews.llvm.org/D28136

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

7 years ago[clang-format] disable adding extra space after MSVC '__super' keyword
Martin Probst [Thu, 16 Mar 2017 10:21:35 +0000 (10:21 +0000)]
[clang-format] disable adding extra space after MSVC '__super' keyword

clang-format treats MSVC `__super` keyword like all other keywords adding
a single space after. This change disables this behavior for `__super`.

Patch originally by jutocz (thanks!).

Differential Revision: https://reviews.llvm.org/D30932

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

7 years agoclang-format: Fix bug in wrapping behavior of operators.
Daniel Jasper [Thu, 16 Mar 2017 07:54:11 +0000 (07:54 +0000)]
clang-format: Fix bug in wrapping behavior of operators.

Before (even violating the column limit):
  auto Diag =
      diag()
      << aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
  auto Diag = diag() << aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa,
                                         aaaaaaaaaaaaaaaaaaaaaaaaaa);

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

7 years agoFix up testcase to:
Eric Christopher [Wed, 15 Mar 2017 23:41:58 +0000 (23:41 +0000)]
Fix up testcase to:

a) avoid actually compiling anything
b) avoid depositing files in the test directory
c) use a check line to make sure that we're looking for the correct behavior

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

7 years agoRemove repeated code (PR32250). NFCI.
Simon Pilgrim [Wed, 15 Mar 2017 22:43:36 +0000 (22:43 +0000)]
Remove repeated code (PR32250). NFCI.

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

7 years agofix build break by removing the target on command line
Guansong Zhang [Wed, 15 Mar 2017 21:46:44 +0000 (21:46 +0000)]
fix build break by removing the target on command line

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

7 years agoenable -save-temps with -finclude-defult-header
Guansong Zhang [Wed, 15 Mar 2017 20:57:11 +0000 (20:57 +0000)]
enable -save-temps with -finclude-defult-header

Currently the two flags can not work together.

To illustrate the issue, we can have an one line file a.cl contains only an empty function

cat a.cl

void test(){}

Then use

clang -v -save-temps -x cl -Xclang -cl-std=CL2.0 -Xclang -finclude-default-header -target amdgcn -S -c a.cl

we will get redefinition errors for various things.

The reason is that the -finclude-default-header flag is not meant to be on cc1 command other than the preprocessor.

The fix is modeled after the code just below the change to filter the -finclude-default-header flag out when we are not in the preprocess phase.

Differential Revision: https://reviews.llvm.org/D30743

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

7 years ago[X86][XOP] Add codegen tests for vector integer comparison intrinsics (PR15844)
Simon Pilgrim [Wed, 15 Mar 2017 20:20:43 +0000 (20:20 +0000)]
[X86][XOP] Add codegen tests for vector integer comparison intrinsics (PR15844)

We were testing for the generic _mm_com_* intrinsics, but not the specific comparison mode versions.

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

7 years agoAdd AST matchers for ObjCProtocolDecl, ObjCCategoryDecl, ObjCMethodDecl, ObjCIvarDecl...
Aaron Ballman [Wed, 15 Mar 2017 20:14:25 +0000 (20:14 +0000)]
Add AST matchers for ObjCProtocolDecl, ObjCCategoryDecl, ObjCMethodDecl, ObjCIvarDecl, and ObjCPropertyDecl.

Patch by Dave Lee.

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

7 years agoFix uninitialized value.
Zachary Turner [Wed, 15 Mar 2017 19:54:25 +0000 (19:54 +0000)]
Fix uninitialized value.

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

7 years ago[Driver] Define macro __APPLE_EMBEDDED_SIMULATOR__ when option
Akira Hatanaka [Wed, 15 Mar 2017 18:04:13 +0000 (18:04 +0000)]
[Driver] Define macro __APPLE_EMBEDDED_SIMULATOR__ when option
-m(i|tv|watch)os-simulator-version-min is on the command line.

Previously the driver would treat -m(i|tv|watch)os-simulator-version-min
as an alias of -m(i|tv|watch)os-version-min. This no longer works since
we now need to distinguish between the two options (the latter is used
for iOS running in a VM, for example).

This commit stops making the simulator options the aliases of the OS
options and defines a macro to differentiate between the two groups of
options.

rdar://problem/28872911

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

7 years ago[ObjC][Sema] Avoid warning about a call to an instance method on an
Alex Lorenz [Wed, 15 Mar 2017 17:16:41 +0000 (17:16 +0000)]
[ObjC][Sema] Avoid warning about a call to an instance method on an
instance of a qualified Class object when that instance method comes from
a protocol that's implemented by NSObject

Instance methods from a root class like NSObject are also class methods because
the metaclass of root class derives from that root class. Therefore, we can
avoid the warning for instances of qualified Class objects that point to classes
that derive from NSObject. Note that we actually don't know if a Class instance
points to a class that derives from NSObject at compile-time, so we have to
make a reasonable assumption that the majority of instances will do so.

rdar://22812517

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

7 years agoDon't use MSVC Setup Api on MinGW.
Zachary Turner [Wed, 15 Mar 2017 17:09:36 +0000 (17:09 +0000)]
Don't use MSVC Setup Api on MinGW.

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

7 years agoDisable warning about MSVC not found.
Zachary Turner [Wed, 15 Mar 2017 16:35:13 +0000 (16:35 +0000)]
Disable warning about MSVC not found.

When this test runs on bots that are configured to default
to MSVC, but MSVC isn't actually installed, we can emit a
warning that MSVC is not found.  Since MSVC isn't actually
needed for this test to succeed, just disable this warning.

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

7 years agoUpdate clang-cl driver for MSVC 2017.
Zachary Turner [Wed, 15 Mar 2017 16:07:35 +0000 (16:07 +0000)]
Update clang-cl driver for MSVC 2017.

2017 changes the way you find an installed copy of
Visual Studio as well as its internal directory layout.
As a result, clang-cl was unable to find VS2017 even
when you had run vcvarsall to set up a toolchain
environment.  This patch updates everything for 2017
and cleans up the way we handle a tiered search a la
environment -> installation -> PATH for which copy
of Visual Studio to bind to.

Patch originally by Hamza Sood, with some fixups for landing.

Differential Revision: https://reviews.llvm.org/D30758

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