]> granicus.if.org Git - clang/log
clang
8 years agoDsiable FormatStyle::GetStyleOfFile test case for mingw.
Eric Liu [Thu, 24 Mar 2016 14:59:39 +0000 (14:59 +0000)]
Dsiable FormatStyle::GetStyleOfFile test case for mingw.

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

8 years agoRecommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug...
Amjad Aboud [Thu, 24 Mar 2016 13:30:41 +0000 (13:30 +0000)]
Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 (the fix is included in this commit).

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

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

8 years agoAdded support for different VFSs in format::getStyle. Disable platform-related test...
Eric Liu [Thu, 24 Mar 2016 13:22:42 +0000 (13:22 +0000)]
Added support for different VFSs in format::getStyle. Disable platform-related test case for MS compilers to avoid breaking buildbot.

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

8 years agoRevert "Added support for different VFSs in format::getStyle."
Eric Liu [Thu, 24 Mar 2016 13:22:37 +0000 (13:22 +0000)]
Revert "Added support for different VFSs in format::getStyle."

This reverts commit r264253. It is breaking the buildbot http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2203

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

8 years agoRevert "removed redundant comment in format::getStyle."
Eric Liu [Thu, 24 Mar 2016 13:22:28 +0000 (13:22 +0000)]
Revert "removed redundant comment in format::getStyle."

This reverts commit r264254.

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

8 years agoFix Sphinx errors with documentation build.
Aaron Ballman [Thu, 24 Mar 2016 12:34:44 +0000 (12:34 +0000)]
Fix Sphinx errors with documentation build.

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

8 years agoRevert "Added support for different VFSs in format::getStyle."
Eric Liu [Thu, 24 Mar 2016 11:25:28 +0000 (11:25 +0000)]
Revert "Added support for different VFSs in format::getStyle."

This reverts commit r264253. It is breaking the buildbot http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/2203

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

8 years agoRevert "removed redundant comment in format::getStyle."
Eric Liu [Thu, 24 Mar 2016 11:24:49 +0000 (11:24 +0000)]
Revert "removed redundant comment in format::getStyle."

This reverts commit r264254.

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

8 years agoremoved redundant comment in format::getStyle.
Eric Liu [Thu, 24 Mar 2016 10:50:26 +0000 (10:50 +0000)]
removed redundant comment in format::getStyle.

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

8 years agoAdded support for different VFSs in format::getStyle.
Eric Liu [Thu, 24 Mar 2016 10:50:17 +0000 (10:50 +0000)]
Added support for different VFSs in format::getStyle.

Summary:
Previously, format::getStyle assumes that the given file resides in
the real file system, which prevents the use of virtual file system in testing etc.
This patch adds a parameter in format::getStyle interface so that users can specify
the right file system. By default, the file system is the real file system.

Reviewers: djasper, klimek

Subscribers: cfe-commits, klimek

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

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

8 years agoTest commit access to clang repo.
Eric Liu [Thu, 24 Mar 2016 10:21:00 +0000 (10:21 +0000)]
Test commit access to clang repo.

Summary: Test commit access to clang repo.

Reviewers: cfe-commits

Subscribers: klimek

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

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

8 years ago[OpenCL] Add ocl and spir version for spir target
Xiuli Pan [Thu, 24 Mar 2016 03:57:17 +0000 (03:57 +0000)]
[OpenCL] Add ocl and spir version for spir target

Summary: Add opencl.spir.version and opencl.ocl.version metadata for CodeGen to identify OpenCL version.

Reviewers: yaxunl, Anastasia

Subscribers: cfe-commits, pekka.jaaskelainen

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

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

8 years agoAdd release notes for the removal of the silent include of altivec.h.
Eric Christopher [Thu, 24 Mar 2016 01:28:25 +0000 (01:28 +0000)]
Add release notes for the removal of the silent include of altivec.h.

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

8 years agoThe time when -faltivec (or, on clang only, -maltivec) will magically
Eric Christopher [Thu, 24 Mar 2016 01:26:08 +0000 (01:26 +0000)]
The time when -faltivec (or, on clang only, -maltivec) will magically
include altivec.h has come and gone.

Rationale: This causes modules, rewrite-includes, etc to be sad and
people should just include altivec.h in their source.

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

8 years agoDisplay const/volatile/restrict qualifiers in Visual Studio visualizations
Mike Spertus [Thu, 24 Mar 2016 00:38:54 +0000 (00:38 +0000)]
Display const/volatile/restrict qualifiers in Visual Studio visualizations

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

8 years agoModules builds are necessarily compile actions, but they don't
Eric Christopher [Thu, 24 Mar 2016 00:34:02 +0000 (00:34 +0000)]
Modules builds are necessarily compile actions, but they don't
necessarily produce object files. Turn off split dwarf if we're not
producing a file that the driver believes is an object file.

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

8 years agoNFC: clarify comment on lock-free macros
JF Bastien [Thu, 24 Mar 2016 00:20:44 +0000 (00:20 +0000)]
NFC: clarify comment on lock-free macros

Used by both libstdc++ and libc++.

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

8 years agoFix a typo, Tiles -> Files, NFC
Vedant Kumar [Wed, 23 Mar 2016 23:51:36 +0000 (23:51 +0000)]
Fix a typo, Tiles -> Files, NFC

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

8 years agoclang-cl: Add a FIXME for bumping the default msc version.
Nico Weber [Wed, 23 Mar 2016 23:26:59 +0000 (23:26 +0000)]
clang-cl: Add a FIXME for bumping the default msc version.

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

8 years agoFix typo in test from r264210, sigh.
Nico Weber [Wed, 23 Mar 2016 23:01:38 +0000 (23:01 +0000)]
Fix typo in test from r264210, sigh.

(The test passes both with and without this change, but it's confusing without
it.)

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

8 years agoclang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.
Nico Weber [Wed, 23 Mar 2016 22:57:55 +0000 (22:57 +0000)]
clang-cl: With -fmsc-version=1900, use MSVS2015 diag formatting.

Remove tests that have neither a triple nor an explicit -fmsc-version flag,
since in the absence of an -fmsc-version flag, the implicit value of the flag
is 17 (MSVC2013) with MSVC triples but 0 (not set) for other triples, and
the default triple is platform dependent.

This relands r263974 with a test fix.

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

8 years ago[CUDA] Merge most of CodeGenCUDA/function-overload.cu into SemaCUDA/function-overload.cu.
Justin Lebar [Wed, 23 Mar 2016 22:42:30 +0000 (22:42 +0000)]
[CUDA] Merge most of CodeGenCUDA/function-overload.cu into SemaCUDA/function-overload.cu.

Summary:
Previously we were using the codegen test to ensure that we choose the
right overload.  But we can do this within sema, with a bit of
cleverness.

I left the constructor/destructor checks in CodeGen, because these
overloads (particularly on the destructors) are hard to check in Sema.

Reviewers: tra

Subscribers: cfe-commits

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

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

8 years ago[CUDA] Simplify SemaCUDA/function-overload.cu test.
Justin Lebar [Wed, 23 Mar 2016 22:42:28 +0000 (22:42 +0000)]
[CUDA] Simplify SemaCUDA/function-overload.cu test.

Summary:
Principally, don't hardcode the line numbers of various notes.  This
lets us make changes to the test without recomputing linenos everywhere.

Instead, just tell -verify that we may get 0 or more notes pointing to
the relevant function definitions.  Checking that we get exactly the
right note isn't so important (and anyway is checked elsewhere).

Reviewers: tra

Subscribers: cfe-commits

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

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

8 years ago[CUDA] Don't define __NVCC__.
Justin Lebar [Wed, 23 Mar 2016 22:42:27 +0000 (22:42 +0000)]
[CUDA] Don't define __NVCC__.

Summary:
We decided this makes life too difficult for code authors.  For example,
people may want to detect NVCC and disable variadic templates, which
NVCC does not support, but which we do.

Since people are going to have to change compiler flags *anyway* in
order to compile with clang, if they really want the old behavior, they
can pass -D__NVCC__.

Tested with tensorflow and thrust, no apparent problems.

Reviewers: tra

Subscribers: cfe-commits

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

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

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