]> granicus.if.org Git - clang/log
clang
8 years agoAdd missing __builtin_bitreverse8
Matt Arsenault [Wed, 23 Mar 2016 22:14:43 +0000 (22:14 +0000)]
Add missing __builtin_bitreverse8

Also add documentation for bitreverse builtins

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

8 years agoObjC: add getter/setter for class properties to global pool.
Manman Ren [Wed, 23 Mar 2016 21:39:31 +0000 (21:39 +0000)]
ObjC: add getter/setter for class properties to global pool.

rdar://problem/25323072

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

8 years agoMake SemaAccess smarter about determining when a dependent class might
Richard Smith [Wed, 23 Mar 2016 20:39:06 +0000 (20:39 +0000)]
Make SemaAccess smarter about determining when a dependent class might
instantiate to match a friend class declaration. It's still pretty dumb,
though.

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

8 years agoMake sure to perform dependent access checks when instantiating a
Richard Smith [Wed, 23 Mar 2016 20:07:07 +0000 (20:07 +0000)]
Make sure to perform dependent access checks when instantiating a
lambda-expression. We don't actually instantiate the closure type / operator()
in the template in order to produce the closure type / operator() in the
instantiation, so this isn't caught by the normal path.

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

8 years agoclang-cl: Fix remaining bugs in interaction of /Yc and /FI /showIncludes.
Nico Weber [Wed, 23 Mar 2016 18:46:57 +0000 (18:46 +0000)]
clang-cl: Fix remaining bugs in interaction of /Yc and /FI /showIncludes.

Instead of putting the /Yc header into ExtraDeps, give DependencyOutputOptions
a dedicated field for /Yc mode, and let HeaderIncludesCallback hang on to the
full DependencyOutputOptions object, not just ExtraDeps.

Reverts parts of r263352 that are now no longer needed.

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

8 years agoclang-cl: Add more tests for the interaction of /FI and /Yc /Yu.
Nico Weber [Wed, 23 Mar 2016 18:17:02 +0000 (18:17 +0000)]
clang-cl: Add more tests for the interaction of /FI and /Yc /Yu.

Most things even work; see the included FIXMEs for things that need polishing.

Also don't warn about unused flags for the `/Yuh2.h /FIh1.h /FIh2.h`.  The
common case is that the pch was built with `/Ych2.h /FIh1.h /FIh2.h`, so h1.h
is in the PCH, and we shouldn't warn about /FIh1.h not having an effect.
(If we wanted to get fancy, we could store the list of -include flags in the
pch and then check that it matches later on.)

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

8 years agoclang-cl: Include /FI headers in /showIncludes output.
Nico Weber [Wed, 23 Mar 2016 18:00:22 +0000 (18:00 +0000)]
clang-cl: Include /FI headers in /showIncludes output.

-H in gcc mode doesn't print -include headers, but they are included in
depfiles written by MMD and friends. Since /showIncludes is what's used instead
of depfiles, printing /FI there seems important (and matches cl.exe).

Instead of giving HeaderIncludeGen more options, just switch on ShowAllHeaders
in clang-cl mode and let clang::InitializePreprocessor() not put -include flags
in the <command line> block. This changes the behavior of -E slightly, and it
removes the <command line> flag from the output triggered by setting the
obscure CC_PRINT_HEADERS=1 env var to true while running clang. Both of these
seem ok to change.

http://reviews.llvm.org/D18401

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

8 years ago[NFC] Delete an unused function parameter from a static function
Faisal Vali [Wed, 23 Mar 2016 17:39:51 +0000 (17:39 +0000)]
[NFC] Delete an unused function parameter from a static function

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

8 years agoVisualize fields of records as they were declared in Visual Studio debugger
Mike Spertus [Wed, 23 Mar 2016 17:29:42 +0000 (17:29 +0000)]
Visualize fields of records as they were declared in Visual Studio debugger

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

8 years agoObjC: Handle boolean fixed type for enum.
Manman Ren [Wed, 23 Mar 2016 16:28:28 +0000 (16:28 +0000)]
ObjC: Handle boolean fixed type for enum.

Before this commit, we assert failure in ImplicitCastExpr
"unheralded conversion to bool". This commit fixes the assertion by using
the correct cast type when the fixed type is boolean.

This commit also fixes the behavior for Microsoft mode as well, since
Obj-C and Microsoft mode share the same code path.

rdar://24999533

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

8 years ago[analyzer] Fix typo s/initalize/initialize/
Chih-Hung Hsieh [Wed, 23 Mar 2016 16:14:12 +0000 (16:14 +0000)]
[analyzer] Fix typo s/initalize/initialize/

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

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

8 years agoclang-cl: Don't warn about /Oy- being unused in 64-bit builds.
Nico Weber [Wed, 23 Mar 2016 15:37:41 +0000 (15:37 +0000)]
clang-cl: Don't warn about /Oy- being unused in 64-bit builds.

http://reviews.llvm.org/D18392

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

8 years agoUse an enum instead of hardcoded indices. NFC.
Alexander Kornienko [Wed, 23 Mar 2016 14:28:52 +0000 (14:28 +0000)]
Use an enum instead of hardcoded indices. NFC.

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

8 years agoCombine identical check-prefixes in Clang test/Preprocessor/arm-target-features.c
Artyom Skrobov [Wed, 23 Mar 2016 13:32:33 +0000 (13:32 +0000)]
Combine identical check-prefixes in Clang test/Preprocessor/arm-target-features.c

Reviewers: rengolin, t.p.northover

Subscribers: aemerson, cfe-commits, rengolin

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

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

8 years ago[X86] Add "x87" in x86 target feature map.
Andrey Turetskiy [Wed, 23 Mar 2016 11:15:10 +0000 (11:15 +0000)]
[X86] Add "x87" in x86 target feature map.

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

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

8 years ago[Sema] Allow implicit conversions of &overloaded_fn in C.
George Burgess IV [Wed, 23 Mar 2016 02:33:58 +0000 (02:33 +0000)]
[Sema] Allow implicit conversions of &overloaded_fn in C.

Also includes a minor ``enable_if`` docs update.

Currently, our address-of overload machinery will only allow implicit
conversions of overloaded functions to void* in C. For example:

```
void f(int) __attribute__((overloadable));
void f(double) __attribute__((overloadable, enable_if(0, "")));

void *fp = f; // OK. This is C and the target is void*.
void (*fp2)(void) = f; // Error. This is C, but the target isn't void*.
```

This patch makes the assignment of `fp2` select the `f(int)` overload,
rather than emitting an error (N.B. you'll still get a warning about the
`fp2` assignment if you use -Wincompatible-pointer-types).

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

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

8 years ago[Apple Clang] Expose llvm-config from stage2 builds in stage1
Chris Bieneman [Wed, 23 Mar 2016 01:47:05 +0000 (01:47 +0000)]
[Apple Clang] Expose llvm-config from stage2 builds in stage1

This exposes the stage2-llvm-config target though the stage1 build configuration.

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

8 years ago[CUDA] Don't allow templated variadic functions.
Justin Lebar [Tue, 22 Mar 2016 22:06:19 +0000 (22:06 +0000)]
[CUDA] Don't allow templated variadic functions.

Reviewers: tra

Subscribers: cfe-commits

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

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

8 years agoUpdate cxx-features test to C++1z
JF Bastien [Tue, 22 Mar 2016 21:12:48 +0000 (21:12 +0000)]
Update cxx-features test to C++1z

Forked from the following patch:
  http://reviews.llvm.org/D17950

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

8 years agoD18325: Added mm_malloc module export.
John Thompson [Tue, 22 Mar 2016 20:57:51 +0000 (20:57 +0000)]
D18325: Added mm_malloc module export.

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

8 years agoStaticAnalyzer: Avoid an unintentional copy
Justin Bogner [Tue, 22 Mar 2016 17:50:05 +0000 (17:50 +0000)]
StaticAnalyzer: Avoid an unintentional copy

The range here isn't over references, so using `auto &` here incites a
copy. Switching to `auto *` would do, but we might as well list an
explicit type for clarity.

Found by -Wrange-loop-analysis.

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

8 years agoMake build bots happy
David Majnemer [Tue, 22 Mar 2016 17:10:07 +0000 (17:10 +0000)]
Make build bots happy

BasicBlock's lose their names for some builders, don't mention such
names.

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

8 years ago[MS ABI] Assign an inheritance model for the dest of a member pointer upcast
David Majnemer [Tue, 22 Mar 2016 16:44:39 +0000 (16:44 +0000)]
[MS ABI] Assign an inheritance model for the dest of a member pointer upcast

While we correctly assigned an inheritance model for the source of a
member pointer upcast, we did not do so for the destination.

This fixes PR27030.

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

8 years ago[Perf-training] Using os.devnull instead of a temp file
Chris Bieneman [Tue, 22 Mar 2016 16:33:23 +0000 (16:33 +0000)]
[Perf-training] Using os.devnull instead of a temp file

This is based on post-commit feedback from Vedant. Totally didn't know that existed and worked on Windows.

Thanks Vedant!

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

8 years ago[Perf-training] Cleanup based on feedback from Sean Silvas
Chris Bieneman [Tue, 22 Mar 2016 16:27:35 +0000 (16:27 +0000)]
[Perf-training] Cleanup based on feedback from Sean Silvas

Sean provided feedback based on r257934 on cfe-commits. This change addresses that feedback.

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

8 years agoclang-format: [JS] do not wrap ES6 imports/exports.
Daniel Jasper [Tue, 22 Mar 2016 14:32:20 +0000 (14:32 +0000)]
clang-format: [JS] do not wrap ES6 imports/exports.

"import ... from '...';" and "export ... from '...';" should be treated
the same as goog.require/provide/module/forwardDeclare calls.

Patch by Martin Probst.

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

8 years ago[ASTMatchers] New matcher hasReturnValue added
Alexander Kornienko [Tue, 22 Mar 2016 11:03:03 +0000 (11:03 +0000)]
[ASTMatchers] New matcher hasReturnValue added

Summary: A checker (will be uploaded after this patch) needs to check implicit casts. Existing generic matcher "has" ignores implicit casts and parenthesized expressions and no specific matcher for matching return value expression preexisted. The patch adds such a matcher (hasReturnValue).

Reviewers: klimek, sbenza

Subscribers: xazax.hun, klimek, cfe-commits

Patch by Ádám Balogh!

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

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

8 years agoFix warning about extra semicolon. NFC.
Vasileios Kalintiris [Tue, 22 Mar 2016 10:41:20 +0000 (10:41 +0000)]
Fix warning about extra semicolon. NFC.

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

8 years ago[Objective-c] Do not set IsExact to true when the receiver is a class.
Akira Hatanaka [Tue, 22 Mar 2016 05:00:21 +0000 (05:00 +0000)]
[Objective-c] Do not set IsExact to true when the receiver is a class.

IsExact shouldn't be set to true in WeakObjectProfileTy::getBaseInfo
when the receiver is a class because having a class as the receiver
doesn't guarantee that the Base is exact.

This is a follow-up to r263818.

rdar://problem/25208167

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

8 years ago[Perf-training] Fixing an issue with multi-threading PGO generation
Chris Bieneman [Tue, 22 Mar 2016 02:55:40 +0000 (02:55 +0000)]
[Perf-training] Fixing an issue with multi-threading PGO generation

When LIT parallelizes the profraw file generation we need to generate unique temp filenames then clean them up after the driver executes.

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

8 years agoVisual Studio Native Visualizations for constructors and methods
Mike Spertus [Tue, 22 Mar 2016 02:29:22 +0000 (02:29 +0000)]
Visual Studio Native Visualizations for constructors and methods

With this change, the class

  struct A {
    A(int _i);
    ~A();
    int foo(double d);
    double bar(A *a) { return 1.3; }
  };

appears in the VS2015 Locals Window as

D              0x02dbb378 struct A
|- DeclKind    CXXRecord
|- Members
 |- [0]        implicit struct A
 |- [1]        Constructor {A(int _i)}
 |- [2]        Destructor {~A()}
 |- [3]        Method {int foo(double d)}
 |- [4]        Method {double bar(struct A *)}
|- [Raw View]  /* Other stuff */

Note that these changes only benefit VS2015 as
VS2013 does not have views and only displays the
struct name "A", but the change does no apparent
harm in VS2013, so is still a win.

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

8 years ago[OpenMP] Base support for target directive codegen on NVPTX device.
Arpith Chacko Jacob [Tue, 22 Mar 2016 01:48:56 +0000 (01:48 +0000)]
[OpenMP] Base support for target directive codegen on NVPTX device.

Summary:
This patch adds base support for codegen of the target directive on the NVPTX device.

Reviewers: ABataev

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

Reworked test case after buildbot failure on windows.
Updated patch to integrate r263837 and test case nvptx_target_firstprivate_codegen.cpp.

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

8 years ago[CUDA] Implement atomicInc and atomicDec builtins
Justin Lebar [Tue, 22 Mar 2016 00:09:28 +0000 (00:09 +0000)]
[CUDA] Implement atomicInc and atomicDec builtins

These functions cannot be implemented as atomicrmw or cmpxchg
instructions, so they are implemented as a call to the NVVM intrinsics
@llvm.nvvm.atomic.load.inc.32.p0i32 and
@llvm.nvvm.atomic.load.dec.32.p0i32.

Patch by Jason Henline.

Reviewers: jlebar

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

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

8 years ago[sema] [CUDA] Use std algorithms in EraseUnwantedCUDAMatchesImpl.
Justin Lebar [Tue, 22 Mar 2016 00:09:25 +0000 (00:09 +0000)]
[sema] [CUDA] Use std algorithms in EraseUnwantedCUDAMatchesImpl.

Summary: NFC

Reviewers: tra

Subscribers: cfe-commits

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

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

8 years agoRevert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting."
NAKAMURA Takumi [Mon, 21 Mar 2016 23:51:50 +0000 (23:51 +0000)]
Revert r263974, "clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting."

It seems the test wouldn't expect if default target is *-win32.

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

8 years ago[Perf-training] Adding support for tests to skip the clang driver
Chris Bieneman [Mon, 21 Mar 2016 22:37:14 +0000 (22:37 +0000)]
[Perf-training] Adding support for tests to skip the clang driver

This patch adds a new set of substitutions to the lit run lines for order files and PGO generation which run the clang driver to get the cc1 command, then execute the cc1 command directly. This allows the scripts to bypass profiling the clang driver over and over again.

The approach in this patch was discussed via IRC with Sean Silvas.

Special thanks to Daniel Dunbar whose out-of-tree code I liberally plagiarized.

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

8 years ago[modules] Store mangling numbers in a deterministic order so they don't cause the...
Richard Smith [Mon, 21 Mar 2016 22:33:02 +0000 (22:33 +0000)]
[modules] Store mangling numbers in a deterministic order so they don't cause the resulting .pcm files to be nondeterministic.

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

8 years ago[modules] Renumber DECL_UPDATES from 30 to 50, so it no longer collides with
Richard Smith [Mon, 21 Mar 2016 21:16:01 +0000 (21:16 +0000)]
[modules] Renumber DECL_UPDATES from 30 to 50, so it no longer collides with
TYPE_TEMPLATE_SPECIALIZATION. This was fine in practice because both record
kinds are only ever found by offset, but made the llvm-bcanalyzer -dump output
very confusing.

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

8 years agoRevert "Convert some ObjC msgSends to runtime calls."
Pete Cooper [Mon, 21 Mar 2016 20:50:03 +0000 (20:50 +0000)]
Revert "Convert some ObjC msgSends to runtime calls."

This reverts commit r263607.

This change caused more objc_retain/objc_release calls in the IR but those
are then incorrectly optimized by the ARC optimizer.  Work is going to have
to be done to ensure the ARC optimizer doesn't optimize user written RR, but
that should land before this change.

This change will also need to be updated to take account for any changes required
to ensure that user written calls to RR are distinct from those inserted by ARC.

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

8 years agoclang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.
Nico Weber [Mon, 21 Mar 2016 19:44:18 +0000 (19:44 +0000)]
clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.

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

8 years ago[modules] Don't invent a module cache path unless implicit module builds are enabled.
Richard Smith [Mon, 21 Mar 2016 19:06:06 +0000 (19:06 +0000)]
[modules] Don't invent a module cache path unless implicit module builds are enabled.

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

8 years agoclang-format: [JS] no space in union and intersection types.
Daniel Jasper [Mon, 21 Mar 2016 17:57:31 +0000 (17:57 +0000)]
clang-format: [JS] no space in union and intersection types.

The operators | and & in types, as opposed to the bitwise operators,
should not have whitespace around them (e.g. `Foo<Bar|Baz>`).

Patch by Martin Probst. Thank you.

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

8 years agoAdd replacement = "xxx" to AvailabilityAttr.
Manman Ren [Mon, 21 Mar 2016 17:30:55 +0000 (17:30 +0000)]
Add replacement = "xxx" to AvailabilityAttr.

This commit adds a named argument to AvailabilityAttr, while r263652 adds an
optional string argument to __attribute__((deprecated)).

This was commited in r263687 and reverted in 263752 due to misaligned
access.

rdar://20588929

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

8 years ago[ARM] Clang tests for ARM Cortex-A32 support
Renato Golin [Mon, 21 Mar 2016 17:29:51 +0000 (17:29 +0000)]
[ARM] Clang tests for ARM Cortex-A32 support

Patch by Sam Parker.

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

8 years agoNFC: wrap Availability-related data in its own struct in AttributeList.
Manman Ren [Mon, 21 Mar 2016 17:26:40 +0000 (17:26 +0000)]
NFC: wrap Availability-related data in its own struct in AttributeList.

This makes it easy to add more data into Availability.

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

8 years agoclang-cl: Move /FC from "Unsupported" to "Ignored" list.
Nico Weber [Mon, 21 Mar 2016 17:19:31 +0000 (17:19 +0000)]
clang-cl: Move /FC from "Unsupported" to "Ignored" list.

/FC affects if diagnostics print with full paths and if __FILE__ expands with a
full path.  clang-cl does both of these two by default.

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

8 years agoclang-cl: support __cdecl-on-struct anachronism
Reid Kleckner [Mon, 21 Mar 2016 16:08:49 +0000 (16:08 +0000)]
clang-cl: support __cdecl-on-struct anachronism

Summary:
The Microsoft compiler emits

  warning C4229: anachronism used : modifiers on data are ignored

for

  struct {} __cdecl s;

but ICU's gendict can generate such (and does when building
LibreOffice), so accepting this in clang-cl too would be useful.

Reviewers: rnk

Patch by Stephan Bergmann

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

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

8 years agoclang-format: Make include sorting's main include detection configurable.
Daniel Jasper [Mon, 21 Mar 2016 14:11:27 +0000 (14:11 +0000)]
clang-format: Make include sorting's main include detection configurable.

This patch adds a regular expression to configure suffixes of an
included file to check whether it is the "main" include of the current
file. Previously, clang-format has allowed arbitrary suffixes on the
formatted file, which is still the case when no IncludeMainRegex is
specified.

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

8 years agoRemove debug output. Sorry for the noise.
NAKAMURA Takumi [Mon, 21 Mar 2016 11:44:05 +0000 (11:44 +0000)]
Remove debug output. Sorry for the noise.

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

8 years agoclang/test/CodeGenCXX/cxx1z-lambda-star-this.cpp: Satisfy -Asserts.
NAKAMURA Takumi [Mon, 21 Mar 2016 11:40:15 +0000 (11:40 +0000)]
clang/test/CodeGenCXX/cxx1z-lambda-star-this.cpp: Satisfy -Asserts.

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

8 years agoclang/test/Frontend/plugin-annotate-functions.c requires the target examples/Annotate...
NAKAMURA Takumi [Mon, 21 Mar 2016 11:03:39 +0000 (11:03 +0000)]
clang/test/Frontend/plugin-annotate-functions.c requires the target examples/AnnotateFunctions.

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

8 years agoReorder data members to be consistent with member initializers, to silence warnings.
Faisal Vali [Mon, 21 Mar 2016 10:37:42 +0000 (10:37 +0000)]
Reorder data members to be consistent with member initializers, to silence warnings.

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

8 years ago[Cxx1z] Implement Lambda Capture of *this by Value as [=,*this] (P0018R3)
Faisal Vali [Mon, 21 Mar 2016 09:25:37 +0000 (09:25 +0000)]
[Cxx1z] Implement Lambda Capture of *this by Value as [=,*this] (P0018R3)

Implement lambda capture of *this by copy.
For e.g.:
struct A {

  int d = 10;
  auto foo() { return [*this] (auto a) mutable { d+=a; return d; }; }

};

auto L = A{}.foo(); // A{}'s lifetime is gone.

// Below is still ok, because *this was captured by value.
assert(L(10) == 20);
assert(L(100) == 120);

If the capture was implicit, or [this] (i.e. *this was captured by reference), this code would be otherwise undefined.

Implementation Strategy:
  - amend the parser to accept *this in the lambda introducer
  - add a new king of capture LCK_StarThis
  - teach Sema::CheckCXXThisCapture to handle by copy captures of the
    enclosing object (i.e. *this)
  - when CheckCXXThisCapture does capture by copy, the corresponding
    initializer expression for the closure's data member
    direct-initializes it thus making a copy of '*this'.
  - in codegen, when assigning to CXXThisValue, if *this was captured by
    copy, make sure it points to the corresponding field member, and
    not, unlike when captured by reference, what the field member points
    to.
  - mark feature as implemented in svn

Much gratitude to Richard Smith for his carefully illuminating reviews!

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

8 years agoclang-cl: Add a comment about /Oy- (see r245913).
Nico Weber [Mon, 21 Mar 2016 02:48:05 +0000 (02:48 +0000)]
clang-cl: Add a comment about /Oy- (see r245913).

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

8 years agoVisual Studio Visualizers for clang::FunctionDecl
Mike Spertus [Sun, 20 Mar 2016 20:15:23 +0000 (20:15 +0000)]
Visual Studio Visualizers for clang::FunctionDecl

Readably displays a FunctionDecl in the Visual Studio Locals Window something like:
  void g(int, double d, struct A && arr)

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

8 years ago[tsan] Allow -fsanitize=thread for iOS-style simulator targets
Devin Coughlin [Sun, 20 Mar 2016 18:24:33 +0000 (18:24 +0000)]
[tsan] Allow -fsanitize=thread for iOS-style simulator targets

Update the clang driver to allow -fsanitize=thread when targeting x86_64 iOS and tvOS
simulators. Also restrict TSan targeting OS X to only be supported on x86_64 and not i386.

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

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

8 years ago[VFS] Fix test to use more restrict set of headers
Bruno Cardoso Lopes [Sun, 20 Mar 2016 18:08:32 +0000 (18:08 +0000)]
[VFS] Fix test to use more restrict set of headers

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

8 years agoAST: Fix some bogus indentation. NFC
Justin Bogner [Sun, 20 Mar 2016 16:58:03 +0000 (16:58 +0000)]
AST: Fix some bogus indentation. NFC

Noticed by Liu Xin. Thanks!

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

8 years agoFixed -Wdocumentation warning
Simon Pilgrim [Sun, 20 Mar 2016 16:25:23 +0000 (16:25 +0000)]
Fixed -Wdocumentation warning

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

8 years agoMark C++ features implemented in Clang 3.8 as done now that 3.8 has released.
Richard Smith [Sun, 20 Mar 2016 10:37:12 +0000 (10:37 +0000)]
Mark C++ features implemented in Clang 3.8 as done now that 3.8 has released.

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

8 years agoP0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops to...
Richard Smith [Sun, 20 Mar 2016 10:33:40 +0000 (10:33 +0000)]
P0184R0: Allow types of 'begin' and 'end' expressions in range-based for loops to differ.

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

8 years agoReapply [2] [VFS] Add 'overlay-relative' field to YAML files
Bruno Cardoso Lopes [Sun, 20 Mar 2016 02:08:48 +0000 (02:08 +0000)]
Reapply [2] [VFS] Add 'overlay-relative' field to YAML files

This reapplies r261552 and r263748. Fixed testcase to reapply.

The VFS overlay mapping between virtual paths and real paths is done through
the 'external-contents' entries in YAML files, which contains hardcoded paths
to the real files.

When a module compilation crashes, headers are dumped into <name>.cache/vfs
directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script
generated for reproduction uses -ivfsoverlay pointing to file to gather the
mapping between virtual paths and files inside <name>.cache/vfs. Currently, we
are only capable of reproducing such crashes in the same machine as they
happen, because of the hardcoded paths in 'external-contents'.

To be able to reproduce a crash in another machine, this patch introduces a new
option in the VFS yaml file called 'overlay-relative'. When it's equal to
'true' it means that the provided path to the YAML file through the
-ivfsoverlay option should also be used to prefix the final path for every
'external-contents'.

Example, given the invocation snippet "... -ivfsoverlay
<name>.cache/vfs/vfs.yaml" and the following entry in the yaml file:

"overlay-relative": "true",
"roots": [
...
  "type": "directory",
  "name": "/usr/include",
  "contents": [
    {
      "type": "file",
      "name": "stdio.h",
      "external-contents": "/usr/include/stdio.h"
    },
...

Here, a file manager request for virtual "/usr/include/stdio.h", that will map
into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h.

This is a useful feature for debugging module crashes in machines other than
the one where the error happened.

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

rdar://problem/24499339

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

8 years agoBetter visualization of clang::BuiltinType in VisualStudio
Mike Spertus [Sun, 20 Mar 2016 00:32:30 +0000 (00:32 +0000)]
Better visualization of clang::BuiltinType in VisualStudio

Whenever possible, use C++ names for visualizing builtin types. E.g., "long double" instead of "LongDouble"

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

8 years agoVisual Studio Visualizer for clang::FunctionProtoType
Mike Spertus [Sun, 20 Mar 2016 00:20:43 +0000 (00:20 +0000)]
Visual Studio Visualizer for clang::FunctionProtoType

Displays return type and parameters for the Function Protoype object in the Locals window.

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

8 years ago[Sema] Make type deduction work with some overloadable functions
George Burgess IV [Sat, 19 Mar 2016 21:51:45 +0000 (21:51 +0000)]
[Sema] Make type deduction work with some overloadable functions

Some functions can't have their address taken. If we encounter an
overload set where only one of the candidates can have its address
taken, we should automatically select that candidate's type in type
deduction.

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

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

8 years ago[Sema] Allow casting of some overloaded functions
George Burgess IV [Sat, 19 Mar 2016 21:36:10 +0000 (21:36 +0000)]
[Sema] Allow casting of some overloaded functions

Some functions can't have their address taken. If we encounter an
overload set where only one of the candidates can have its address
taken, we should automatically select that candidate in cast
expressions.

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

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

8 years ago[TLS on Darwin] use CXX_FAST_TLS calling convention for tls_init.
Manman Ren [Fri, 18 Mar 2016 23:35:21 +0000 (23:35 +0000)]
[TLS on Darwin] use CXX_FAST_TLS calling convention for tls_init.

This makes sure we don't generate a lot of code to spill/reload
CSRs when calling tls_init from the access functions.

This helps performance when tls_init is not inlined into the access
functions.

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

8 years ago[OPENMP] Implementation of codegen for firstprivate clause of target directive
Carlo Bertolli [Fri, 18 Mar 2016 21:43:32 +0000 (21:43 +0000)]
[OPENMP] Implementation of codegen for firstprivate clause of target directive

This patch implements the following aspects:

It extends sema to check that a variable is not reference in both a map clause and firstprivate or private. This is needed to ensure correct functioning at codegen level, apart from being useful for the user.
It implements firstprivate for target in codegen. The implementation applies to both host and nvptx devices.
It adds regression tests for codegen of firstprivate, host and device side when using the host as device, and nvptx side.
Please note that the regression test for nvptx codegen is missing VLAs. This is because VLAs currently require saving and restoring the stack which appears not to be a supported operation by nvptx backend.

It adds a check in sema regression tests for target map, firstprivate, and private clauses.

http://reviews.llvm.org/D18203

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

8 years agoFix printing of anonymous struct typedefs.
Steven Watanabe [Fri, 18 Mar 2016 21:35:59 +0000 (21:35 +0000)]
Fix printing of anonymous struct typedefs.

clang -cc1 -ast-print put the struct
definition in the wrong place, like this:

  struct {} typedef S;

The reason that this happens is that the printing code
first prints the struct definition, and then tells the next
declaration to leave out the type. This behavior
is correct for simple variable declarations, but fails for
typedefs (or extern, mutable, etc).

The patch address this problem by skipping the struct
declaration when we first see it, and then telling the first
subsequent declaration that it needs to print out the full
struct definition.

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

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

8 years ago[Objective-c] Fix a crash in WeakObjectProfileTy::getBaseInfo.
Akira Hatanaka [Fri, 18 Mar 2016 19:03:50 +0000 (19:03 +0000)]
[Objective-c] Fix a crash in WeakObjectProfileTy::getBaseInfo.

The crash occurs in WeakObjectProfileTy::getBaseInfo when getBase() is
called on an ObjCPropertyRefExpr object whose receiver is an interface.
This commit fixes the crash by checking the type of the receiver and
setting IsExact to true if it is an interface.

rdar://problem/25208167

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

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

8 years ago[clang-cl] Allow use of -gline-tables-only
Reid Kleckner [Fri, 18 Mar 2016 18:42:56 +0000 (18:42 +0000)]
[clang-cl] Allow use of -gline-tables-only

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

8 years agoAdd -fnative-half-arguments-and-returns
Pirama Arumuga Nainar [Fri, 18 Mar 2016 16:58:36 +0000 (16:58 +0000)]
Add -fnative-half-arguments-and-returns

Summary:
r246764 handled __fp16 arguments and returns for AAPCS, but skipped this
handling for OpenCL.  Simlar to OpenCL, RenderScript also handles __fp16
type natively.

This patch adds the -fnative-half-arguments-and-returns command line
flag to allow such languages to skip this coercion of __fp16.

Reviewers: srhines, olista01

Subscribers: cfe-commits

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

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

8 years agoShow members of DeclContexts (i.e., class members) in Visual Studio native visualizers
Mike Spertus [Fri, 18 Mar 2016 16:38:34 +0000 (16:38 +0000)]
Show members of DeclContexts (i.e., class members) in Visual Studio native visualizers

This change shows members of DeclContext objects in the Visual Studio debugger. It will also cast a TagType like a class or a struct to a DeclContext, so its methods and fields are visualized.

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

8 years agoMake LookupResult movable again.
Benjamin Kramer [Fri, 18 Mar 2016 13:31:00 +0000 (13:31 +0000)]
Make LookupResult movable again.

We lost copy semantics in r263730, because it only worked for a few very
specific cases. Move semantics don't have this issue. Sadly the
implementation is a bit messy but I don't know how to clean it up
without losing support for msvc 2013 :/

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

8 years agoRevert r263783 as buildbot failure is being investigated.
Arpith Chacko Jacob [Fri, 18 Mar 2016 12:39:40 +0000 (12:39 +0000)]
Revert r263783 as buildbot failure is being investigated.

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

8 years ago[OpenMP] Base support for target directive codegen on NVPTX device.
Arpith Chacko Jacob [Fri, 18 Mar 2016 11:47:43 +0000 (11:47 +0000)]
[OpenMP] Base support for target directive codegen on NVPTX device.

Summary:
Reworked test case after buildbot failure on windows.

This patch adds base support for codegen of the target directive on the NVPTX device.

Reviewers: ABataev

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

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

8 years agoRemove usage of LLVM_PREFIX.
Chaoren Lin [Fri, 18 Mar 2016 00:05:37 +0000 (00:05 +0000)]
Remove usage of LLVM_PREFIX.

Summary: LLVM_PREFIX could be undefined if CMAKE_INSTALL_PREFIX were set to empty.

Reviewers: kparzysz, bkramer, chandlerc

Subscribers: cfe-commits

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

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

8 years agoRevert r263687 for ubsan bot failure.
Manman Ren [Thu, 17 Mar 2016 22:13:50 +0000 (22:13 +0000)]
Revert r263687 for ubsan bot failure.

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

8 years agoRevert "Reapply [VFS] Add 'overlay-relative' field to YAML files"
Bruno Cardoso Lopes [Thu, 17 Mar 2016 21:30:55 +0000 (21:30 +0000)]
Revert "Reapply [VFS] Add 'overlay-relative' field to YAML files"

Tests failing on
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/46102

This reverts commit a1683cd6c9e07359c09f86e98a4db6b4e1bc51fc.

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

8 years agoReapply [VFS] Add 'overlay-relative' field to YAML files
Bruno Cardoso Lopes [Thu, 17 Mar 2016 21:11:23 +0000 (21:11 +0000)]
Reapply [VFS] Add 'overlay-relative' field to YAML files

This reapplies r261552.

The VFS overlay mapping between virtual paths and real paths is done through
the 'external-contents' entries in YAML files, which contains hardcoded paths
to the real files.

When a module compilation crashes, headers are dumped into <name>.cache/vfs
directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script
generated for reproduction uses -ivfsoverlay pointing to file to gather the
mapping between virtual paths and files inside <name>.cache/vfs. Currently, we
are only capable of reproducing such crashes in the same machine as they
happen, because of the hardcoded paths in 'external-contents'.

To be able to reproduce a crash in another machine, this patch introduces a new
option in the VFS yaml file called 'overlay-relative'. When it's equal to
'true' it means that the provided path to the YAML file through the
-ivfsoverlay option should also be used to prefix the final path for every
'external-contents'.

Example, given the invocation snippet "... -ivfsoverlay
<name>.cache/vfs/vfs.yaml" and the following entry in the yaml file:

"overlay-relative": "true",
"roots": [
...
  "type": "directory",
  "name": "/usr/include",
  "contents": [
    {
      "type": "file",
      "name": "stdio.h",
      "external-contents": "/usr/include/stdio.h"
    },
...

Here, a file manager request for virtual "/usr/include/stdio.h", that will map
into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h.

This is a useful feature for debugging module crashes in machines other than
the one where the error happened.

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

rdar://problem/24499339

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

8 years agoRe-add (user defined) move ops to UnresolvedSetImpl to allow UnresolvedSet to be...
David Blaikie [Thu, 17 Mar 2016 20:45:38 +0000 (20:45 +0000)]
Re-add (user defined) move ops to UnresolvedSetImpl to allow UnresolvedSet to be implicitly movable

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

8 years agoRevert "For MS ABI, emit dllexport friend functions defined inline in class"
Reid Kleckner [Thu, 17 Mar 2016 20:06:58 +0000 (20:06 +0000)]
Revert "For MS ABI, emit dllexport friend functions defined inline in class"

This reverts commit r263738.

This appears to cause a failure in
CXX/temp/temp.decls/temp.friend/p1.cpp

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

8 years agoFor MS ABI, emit dllexport friend functions defined inline in class
Reid Kleckner [Thu, 17 Mar 2016 19:52:20 +0000 (19:52 +0000)]
For MS ABI, emit dllexport friend functions defined inline in class

Summary: ...as that is apparently what MSVC does

Reviewers: rnk

Patch by Stephan Bergmann

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

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

8 years agoRemove defaulted move ops, the type is zero-cost copyable anyway, so there's no need...
David Blaikie [Thu, 17 Mar 2016 18:28:16 +0000 (18:28 +0000)]
Remove defaulted move ops, the type is zero-cost copyable anyway, so there's no need for specific move ops

(addresses MSVC build error, since MSVC 2013 can't generate default move
ops)

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

8 years agoFix implicit copy ctor and copy assignment operator warnings when -Wdeprecated passed.
David Blaikie [Thu, 17 Mar 2016 18:05:07 +0000 (18:05 +0000)]
Fix implicit copy ctor and copy assignment operator warnings when -Wdeprecated passed.

Fix implicit copy ctor and copy assignment operator warnings
when -Wdeprecated passed.

Patch by Don Hinton!

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

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

8 years agoUse a simpler set of mock headers for the vfs+modules crash recovery tests.
Benjamin Kramer [Thu, 17 Mar 2016 16:19:51 +0000 (16:19 +0000)]
Use a simpler set of mock headers for the vfs+modules crash recovery tests.

The System/ mock is large and too complex for this test. It can cause
the tests to fail in mysterious ways as it depends on the resource dir
being present, which is not really supported for driver tests (using
%clang instead of %clang_cc1). Copy the tree and trim out all the
%unnecessary fat.

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

8 years agoclang-format: [JS] Make requoting of JavaScript string literals only
Daniel Jasper [Thu, 17 Mar 2016 13:03:41 +0000 (13:03 +0000)]
clang-format: [JS] Make requoting of JavaScript string literals only
change affected ranges.

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

8 years agoclang-format: [JS] Fix incorrect spacing around contextual keywords.
Daniel Jasper [Thu, 17 Mar 2016 12:17:59 +0000 (12:17 +0000)]
clang-format: [JS] Fix incorrect spacing around contextual keywords.

Before:
  x.of ();

After:
  x.of();

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

8 years agoclang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.
Daniel Jasper [Thu, 17 Mar 2016 12:00:22 +0000 (12:00 +0000)]
clang-format: Slightly weaken AlignAfterOpenBracket=AlwaysBreak.

If a call takes a single argument, using AlwaysBreak can lead to lots
of wasted lines and additional indentation without improving the
readability in a significant way.

Before:
  caaaaaaaaaaaall(
      caaaaaaaaaaaall(
          caaaaaaaaaaaall(
              caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaaaaaaaaaaa))));

After:
  caaaaaaaaaaaall(caaaaaaaaaaaall(caaaaaaaaaaaall(
      caaaaaaaaaaaaaaaaaaaaaaall(aaaaaaaaaaaaaaaaaaaaaaa))));

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

8 years ago[OPENMP 4.5] Allow to use private data members in 'copyprivate' clause.
Alexey Bataev [Thu, 17 Mar 2016 10:50:17 +0000 (10:50 +0000)]
[OPENMP 4.5] Allow to use private data members in 'copyprivate' clause.

OpenMP 4.5 allows privatization of non-static data members in non-static
member functions. This patch adds support of private data members in
'copyprivate' clauses.

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

8 years ago[OPENMP 4.0] Use 'declare reduction' constructs in 'reduction' clauses.
Alexey Bataev [Thu, 17 Mar 2016 10:19:46 +0000 (10:19 +0000)]
[OPENMP 4.0] Use 'declare reduction' constructs in 'reduction' clauses.

OpenMP 4.0 allows to define custom reduction operations using '#pragma
omp declare reduction' construct. Patch allows to use this custom
defined reduction operations in 'reduction' clauses.

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

8 years agoMinor code cleanups. NFC.
Junmo Park [Thu, 17 Mar 2016 06:41:27 +0000 (06:41 +0000)]
Minor code cleanups. NFC.

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

8 years ago[VFS] Remove wrong header include
Bruno Cardoso Lopes [Thu, 17 Mar 2016 04:59:52 +0000 (04:59 +0000)]
[VFS] Remove wrong header include

Follow up from r263686. Forgot to remove the wrong header file.

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

8 years ago[index] Make sure that declarations of builtin functions are indexed.
Argyrios Kyrtzidis [Thu, 17 Mar 2016 04:28:19 +0000 (04:28 +0000)]
[index] Make sure that declarations of builtin functions are indexed.

rdar://25154630

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

8 years agoAdd an optional named argument (replacement = "xxx") to AvailabilityAttr.
Manman Ren [Thu, 17 Mar 2016 03:09:55 +0000 (03:09 +0000)]
Add an optional named argument (replacement = "xxx") to AvailabilityAttr.

This commit adds a named argument to AvailabilityAttr, while r263652 adds an
optional string argument to __attribute__((deprecated)). This enables the
compiler to provide Fix-Its for deprecated declarations.

rdar://20588929

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

8 years agoReapply [2]: [VFS] Add support for handling path traversals
Bruno Cardoso Lopes [Thu, 17 Mar 2016 02:20:43 +0000 (02:20 +0000)]
Reapply [2]: [VFS] Add support for handling path traversals

This was applied twice r261551 and 263617 and later reverted because:

(1) Windows bot failing on unittests. Change the current behavior to do
not handle path traversals on windows.

(2) Windows bot failed to include llvm/Config/config.h in order to use
HAVE_REALPATH. Use LLVM_ON_UNIX instead, as done in lib/Basic/FileManager.cpp.

Handle ".", ".." and "./" with trailing slashes while collecting files
to be dumped into the vfs overlay directory.

Include the support for symlinks into components. Given the path:

/install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin"
component is a symlink, it's not safe to use `path::remove_dots` here,
and `realpath` is used to get the right answer. Since `realpath`
is expensive, we only do it at collecting time (which only happens
during the crash reproducer) and cache the base directory for fast lookups.

Overall, this makes the input to the VFS YAML file to be canonicalized
to never contain traversal components.

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

rdar://problem/24499339

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

8 years ago[OPENMP] Support for codegen of private clause of target, host side
Carlo Bertolli [Wed, 16 Mar 2016 19:04:22 +0000 (19:04 +0000)]
[OPENMP] Support for codegen of private clause of target, host side

This patch adds support for codegen of private clause of target and a regression test for host code generation, when the host is used as target device. I believe that code generation for nvptx backend would not require anything additional or different to what is done for the host.

http://reviews.llvm.org/D18105

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

8 years agoAdd an optional string argument to DeprecatedAttr for Fix-It.
Manman Ren [Wed, 16 Mar 2016 18:50:49 +0000 (18:50 +0000)]
Add an optional string argument to DeprecatedAttr for Fix-It.

We only add this to __attribute__((deprecated)).

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

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

8 years agoAdd attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C...
Roman Levenstein [Wed, 16 Mar 2016 18:00:46 +0000 (18:00 +0000)]
Add attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end

Till now, preserve_mostcc/preserve_allcc calling convention attributes were only
available at the LLVM IR level. This patch adds attributes for
preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end.

The code was mostly written by Juergen Ributzka.
I just added support for the AArch64 target and tests.

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

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

8 years agoFix destructor definition of invalid classes
Olivier Goffart [Wed, 16 Mar 2016 14:36:11 +0000 (14:36 +0000)]
Fix destructor definition of invalid classes

The declaration of the destructor of an invalid class was not properly marked
as noexcept. As a result, the definition of the same destructor, which was
properly implicitly marked as noexcept, would not match the definition.
This would cause the definition CXXDestructorDecl to be matked as invalid
and omited from the AST.

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

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