]> granicus.if.org Git - clang/log
clang
8 years agoMerging r280120: release_39 origin/release_39
Tom Stellard [Tue, 29 Nov 2016 15:53:17 +0000 (15:53 +0000)]
Merging r280120:

------------------------------------------------------------------------
r280120 | niels_ole | 2016-08-30 11:00:22 -0700 (Tue, 30 Aug 2016) | 4 lines

Basic/Targets.cpp: Add polaris10 and polaris11 gpus

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

------------------------------------------------------------------------

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

8 years agoMerging r284620:
Tom Stellard [Tue, 29 Nov 2016 04:05:32 +0000 (04:05 +0000)]
Merging r284620:

------------------------------------------------------------------------
r284620 | simon.dardis | 2016-10-19 10:50:52 -0700 (Wed, 19 Oct 2016) | 14 lines

[mips][msa] Range check MSA intrinsics with immediates

This patch teaches clang to range check immediates for MIPS MSA instrinsics.
This checking is done strictly in comparison to some existing GCC
implementations. E.g. msa_andvi_b(var, 257) does not result in andvi $wX, 1.
Similarily msa_ldi_b takes a range of -128 to 127.

As part of this effort, correct the existing MSA test as it has both illegal
types and immediates.

Reviewers: vkalintiris

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

------------------------------------------------------------------------

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

8 years agoMerging r281975:
Tom Stellard [Tue, 29 Nov 2016 04:05:30 +0000 (04:05 +0000)]
Merging r281975:

------------------------------------------------------------------------
r281975 | simon.dardis | 2016-09-20 08:07:36 -0700 (Tue, 20 Sep 2016) | 9 lines

[mips] MSA intrinsics header file

This patch adds the msa.h header file containing the shorter names for the
MSA instrinsics, e.g. msa_sll_b for builtin_msa_sll_b.

Reviewers: vkalintiris, zoran.jovanovic

Differential Review: https://reviews.llvm.org/D24674

------------------------------------------------------------------------

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

8 years agoMerging r287999:
Tom Stellard [Mon, 28 Nov 2016 20:37:50 +0000 (20:37 +0000)]
Merging r287999:

------------------------------------------------------------------------
r287999 | hfinkel | 2016-11-27 08:26:14 -0800 (Sun, 27 Nov 2016) | 14 lines

Adjust type-trait evaluation to properly handle Using(Shadow)Decls

Since r274049, for an inheriting constructor declaration, the name of the using
declaration (and using shadow declaration comes from the using declaration) is
the name of a derived class, not the base class (line 8225-8232 of
lib/Sema/SemaDeclCXX.cpp in https://reviews.llvm.org/rL274049). Because of
this, name-based lookup performed inside Sema::LookupConstructors returns not
only CXXConstructorDecls but also Using(Shadow)Decls, which results assertion
failure reported in PR29087.

Patch by Taewook Oh, thanks!

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

------------------------------------------------------------------------

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

8 years agoMerging r287227:
Alexey Bataev [Mon, 28 Nov 2016 17:55:42 +0000 (17:55 +0000)]
Merging r287227:
------------------------------------------------------------------------
r287227 | abataev | 2016-11-17 15:12:05 +0000 (Thu, 17 Nov 2016) | 4 lines

[OPENMP] Fixed codegen for 'omp cancel' construct.

If 'omp cancel' construct is used in a worksharing construct it may
cause hanging of the software in case if reduction clause is used. Patch fixes this problem by avoiding extra reduction processing for branches that were canceled.
------------------------------------------------------------------------

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

8 years agoMerging r275926:
Tom Stellard [Wed, 23 Nov 2016 21:29:33 +0000 (21:29 +0000)]
Merging r275926:

------------------------------------------------------------------------
r275926 | kkwli0 | 2016-07-18 15:49:16 -0700 (Mon, 18 Jul 2016) | 25 lines

[OpenMP] Fix incorrect diagnostics in map clause

Having the following code pattern will result in incorrect diagnostic

int main() {
  int arr[10];
#pragma omp target data map(arr[:])
#pragma omp target map(arr)
  {}
}

t.cpp:4:24: error: original storage of expression in data environment is shared
      but data environment do not fully contain mapped expression storage
#pragma omp target map(arr)
                       ^~~
t.cpp:3:29: note: used here
#pragma omp target data map(arr[:])
                            ^~~~~~
1 error generated.

Patch by David S.

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

------------------------------------------------------------------------

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

8 years agoMerge r275905 into 3.9 branch: Allow iOS and tvOS version numbers with 2-digit major...
Mehdi Amini [Wed, 23 Nov 2016 21:25:50 +0000 (21:25 +0000)]
Merge r275905 into 3.9 branch: Allow iOS and tvOS version numbers with 2-digit major version numbers.

See: http://llvm.org/PR30555

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

8 years agoMerging r281797:
Tom Stellard [Wed, 23 Nov 2016 18:21:42 +0000 (18:21 +0000)]
Merging r281797:

------------------------------------------------------------------------
r281797 | richard-llvm | 2016-09-16 16:30:39 -0700 (Fri, 16 Sep 2016) | 10 lines

Fix a couple of wrong-code bugs in switch-on-constant optimization:

 * recurse through intermediate LabelStmts and AttributedStmts when checking
   whether a statement inside a switch declares a variable
 * if the end of a compound statement is reachable from the chosen case label,
   and the compound statement contains a variable declaration, it's not valid
   to just emit the contents of the compound statement -- we must emit the
   statement itself or we lose the scope (and thus end lifetimes at the wrong
   point)

------------------------------------------------------------------------

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

8 years ago[LTO] Merge r287685 into the 3.9.1 branch, darwin: Unconditionally pass -lto_library...
Mehdi Amini [Wed, 23 Nov 2016 18:00:06 +0000 (18:00 +0000)]
[LTO] Merge r287685 into the 3.9.1 branch, darwin: Unconditionally pass -lto_library, remove -Wliblto warning.

See: https://llvm.org/bugs/PR31120

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

8 years agoMerge r285525 into 3.9.1: Fix clang installed path to handle case where clang is...
Mehdi Amini [Mon, 21 Nov 2016 21:29:59 +0000 (21:29 +0000)]
Merge r285525 into 3.9.1: Fix clang installed path to handle case where clang is invoked through a symlink

See https://llvm.org/PR30840

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

8 years ago[LTO] Merge r285254 into 3.9.1 (Darwin clang driver always pass -lto_library)
Mehdi Amini [Mon, 21 Nov 2016 21:27:58 +0000 (21:27 +0000)]
[LTO] Merge r285254 into 3.9.1 (Darwin clang driver always pass -lto_library)

See: https://llvm.org/PR30840

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

8 years agoMerge 286819 and 286821: [OpenCL] always use SPIR address spaces for kernel_arg_addr_...
Pekka Jaaskelainen [Thu, 17 Nov 2016 17:30:56 +0000 (17:30 +0000)]
Merge 286819 and 286821: [OpenCL] always use SPIR address spaces for kernel_arg_addr_space MD

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

8 years agoMerge r280672, per bug 30839:
Ed Schouten [Wed, 16 Nov 2016 10:18:17 +0000 (10:18 +0000)]
Merge r280672, per bug 30839:

  Add support for targeting armv6-unknown-cloudabi-eabihf.

  I'm in the progress of adding ARMv6 support to CloudABI. On the compiler
  side, everything seems to work properly with this tiny change applied.

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

8 years agoMerging r287025:
Alexey Bataev [Tue, 15 Nov 2016 21:24:19 +0000 (21:24 +0000)]
Merging r287025:
------------------------------------------------------------------------
r287025 | abataev | 2016-11-15 20:57:18 +0000 (Tue, 15 Nov 2016) | 3 lines

[OPENMP] Fix stack use after delete, NFC.

Fixed possible use of stack variable after deletion.
------------------------------------------------------------------------

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

8 years agoMerging r283223:
Alexey Bataev [Tue, 15 Nov 2016 14:44:21 +0000 (14:44 +0000)]
Merging r283223:
r283223 | davidsh | 2016-10-04 10:41:36 -0400 (Tue, 04 Oct 2016) | 1 line

[OpenMP] fix segfault when a variable referenced in reduction clause is a reference parameter
Differential Revision: http://reviews.llvm.org/D24524

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

8 years agoMerging r284229:
Alexey Bataev [Tue, 15 Nov 2016 14:30:48 +0000 (14:30 +0000)]
Merging r284229:
------------------------------------------------------------------------
r284229 | abataev | 2016-10-14 12:43:59 +0000 (Fri, 14 Oct 2016) | 37 lines

Fix for PR30632: Name mangling issue.

There was a bug in the implementation of captured statements. If it has
a lambda expression in it and the same lambda expression is used outside
the captured region, clang produced an error:
```
error: definition with same mangled name as another definition
```
Here is an example:
```
struct A {
 template <typename L>
 void g(const L&) { }
};

template<typename T>
void f() {
  {
    A().g([](){});
  }
  A().g([](){});
}

int main() {
  f<void>();
}
```

Error report:
```
main.cpp:3:10: error: definition with same mangled name as another
definition
    void g(const L&) { }
             ^
main.cpp:3:10: note: previous definition is here
```
Patch fixes this bug.
------------------------------------------------------------------------

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

8 years agoMerging r286944:
Alexey Bataev [Tue, 15 Nov 2016 14:26:49 +0000 (14:26 +0000)]
Merging r286944:
------------------------------------------------------------------------
r286944 | abataev | 2016-11-15 09:11:50 +0000 (Tue, 15 Nov 2016) | 6 lines

[OPENMP] Fixed codegen for 'omp cancel' construct.

If 'omp cancel' construct is used in a worksharing construct it may cause
hanging of the software in case if reduction clause is used. Patch fixes
this problem by avoiding extra reduction processing for branches that
were canceled.
------------------------------------------------------------------------

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

8 years agoMerging r286584:
Alexey Bataev [Tue, 15 Nov 2016 14:23:10 +0000 (14:23 +0000)]
Merging r286584:
------------------------------------------------------------------------
r286584 | abataev | 2016-11-11 12:36:20 +0000 (Fri, 11 Nov 2016) | 31 lines

Fix for PR28523: unexpected compilation error.

Clang emits error message for the following code:
```
template <class F> void parallel_loop(F &&f) { f(0); }

int main() {
  int x;
  parallel_loop([&](auto y) {
    {
      x = y;
    };
  });
}
```

$ clang++ --std=gnu++14 clang_test.cc -o clang_test
clang_test.cc:9:7: error: reference to local variable 'x' declared in enclosing function 'main'
      x = y;
            ^
clang_test.cc:2:48: note: in instantiation of function template specialization 'main()::(anonymous class)::operator()<int>' requested here
            template <class F> void parallel_loop(F &&f) { f(0); }
                                                           ^
clang_test.cc:6:3: note: in instantiation of function template specialization 'parallel_loop<(lambda at clang_test.cc:6:17)>' requested here parallel_loop([&](auto y) {
           ^
clang_test.cc:5:7: note: 'x' declared here
      int x;
          ^
1 error generated.

Patch fixes this issue.
------------------------------------------------------------------------

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

8 years agoMerging r286129:
Alexey Bataev [Tue, 15 Nov 2016 14:15:56 +0000 (14:15 +0000)]
Merging r286129:
------------------------------------------------------------------------
r286129 | abataev | 2016-11-07 18:15:02 +0000 (Mon, 07 Nov 2016) | 8 lines

[OPENMP] Fixed codegen for __real/__imag expressions in atomic
constructs.

For __real/__imag unary expressions clang emits lvalue with the
associated type from the original complex expression, but not the
underlying builtin integer or float type. This causes crash in codegen
for atomic constructs, if __real/__imag expression are used in atomic
  constructs.
------------------------------------------------------------------------

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

8 years agoMerging r284110:
Alexey Bataev [Tue, 15 Nov 2016 14:12:57 +0000 (14:12 +0000)]
Merging r284110:
------------------------------------------------------------------------
r284110 | abataev | 2016-10-13 09:52:46 +0000 (Thu, 13 Oct 2016) | 9 lines

Fix for PR30639: CGDebugInfo Null dereference with OpenMP array
access, by Erich Keane

OpenMP creates a variable array type with a a null size-expr. The Debug
generation failed to due to this. This patch corrects the openmp
implementation, updates the tests, and adds a new one for this
condition.

Differential Revision: https://reviews.llvm.org/D25373
------------------------------------------------------------------------

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

8 years agoMerging rr285370:
Richard Trieu [Tue, 15 Nov 2016 01:16:26 +0000 (01:16 +0000)]
Merging rr285370:
------------------------------------------------------------------------
r285370 | rtrieu | 2016-10-27 17:15:24 -0700 (Thu, 27 Oct 2016) | 10 lines

Fix a crash on invalid code.

The diagnostic was attempting to access the QualType of a TypeDecl by calling
TypeDecl::getTypeForDecl.  However, the Type pointer stored there is lazily
loaded by functions in ASTContext.  In most cases, the pointer is loaded and
this does not cause a problem.  However, when more that 50 or so unknown types
are seen beforehand, this causes the Type to not be loaded, passing a null
Type to the diagnostics, leading to the crash.  Using
ASTContext::getTypeDeclType will give a proper QualType for all cases.

------------------------------------------------------------------------

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

8 years agoMerging r282989:
Richard Trieu [Tue, 15 Nov 2016 01:05:08 +0000 (01:05 +0000)]
Merging r282989:
------------------------------------------------------------------------
r282989 | rtrieu | 2016-09-30 17:15:24 -0700 (Fri, 30 Sep 2016) | 10 lines

Fix crash when emitting error.

With templated classes, is possible to not be able to determine is a member
function is a special member function before the class is instantiated.  Only
these special member functions can be defaulted.  In some cases, knowing
whether a function is a special member function can't be determined until
instantiation, so an uninstantiated function could possibly be defaulted too.
Add a case to the error diagnostic when the function marked with a default is
not known to be a special member function.

------------------------------------------------------------------------

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

8 years agoMerging r281287:
Richard Trieu [Tue, 15 Nov 2016 00:51:55 +0000 (00:51 +0000)]
Merging r281287:
------------------------------------------------------------------------
r281287 | rtrieu | 2016-09-12 18:37:01 -0700 (Mon, 12 Sep 2016) | 2 lines

Handle empty message in static_asserts.

------------------------------------------------------------------------

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

8 years agoMerging r281286:
Richard Trieu [Fri, 11 Nov 2016 23:11:36 +0000 (23:11 +0000)]
Merging r281286:
------------------------------------------------------------------------
r281286 | rtrieu | 2016-09-12 18:20:40 -0700 (Mon, 12 Sep 2016) | 6 lines

Fix interaction between serialization and c++1z feature.

In c++1z, static_assert is not required to have a StringLiteral message, where
previously it was required.  Update the AST Reader to be able to handle a
null StringLiteral.

------------------------------------------------------------------------

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

8 years agoMerging rr280190:
Eric Fiselier [Wed, 28 Sep 2016 21:25:06 +0000 (21:25 +0000)]
Merging rr280190:
------------------------------------------------------------------------
r280190 | rsmith | 2016-08-30 20:15:21 -0600 (Tue, 30 Aug 2016) | 12 lines

PR12298 et al: don't recursively instantiate a template specialization from
within the instantiation of that same specialization. This could previously
happen for eagerly-instantiated function templates, variable templates,
exception specifications, default arguments, and a handful of other cases.

We still have an issue here for default template arguments that recursively
make use of themselves and likewise for substitution into the type of a
non-type template parameter, but in those cases we're producing a different
entity each time, so they should instead be caught by the instantiation depth
limit. However, currently we will typically run out of stack before we reach
it. :(

------------------------------------------------------------------------

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

8 years agoMinor change to OpenCL release notes to add one missing item.
Anastasia Stulova [Fri, 19 Aug 2016 09:19:36 +0000 (09:19 +0000)]
Minor change to OpenCL release notes to add one missing item.

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

8 years agoReleaseNotes: missing char
Hans Wennborg [Thu, 18 Aug 2016 23:01:18 +0000 (23:01 +0000)]
ReleaseNotes: missing char

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

8 years agoReleaseNotes: sphinx build fixes
Hans Wennborg [Thu, 18 Aug 2016 21:09:19 +0000 (21:09 +0000)]
ReleaseNotes: sphinx build fixes

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

8 years agoReleaseNotes: clean up
Hans Wennborg [Thu, 18 Aug 2016 20:32:21 +0000 (20:32 +0000)]
ReleaseNotes: clean up

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

8 years agoReleaseNotes: remove in-progress warning
Hans Wennborg [Thu, 18 Aug 2016 20:18:58 +0000 (20:18 +0000)]
ReleaseNotes: remove in-progress warning

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

8 years agoMerging r278988:
Hans Wennborg [Thu, 18 Aug 2016 17:56:48 +0000 (17:56 +0000)]
Merging r278988:
------------------------------------------------------------------------
r278988 | cbieneman | 2016-08-17 14:54:30 -0700 (Wed, 17 Aug 2016) | 14 lines

[Darwin] Stop linking libclang_rt.eprintf.a

Summary:
The eprintf library was added before the general OS X builtins library existed as a place to store one builtin function. Since we have for several years had an actual mandated builtin library for OS X > 10.5, we should just merge eprintf into the main library.

This change will resolve PR28855.

As a follow up I'll also patch compiler-rt to not generate the eprintf library anymore.

Reviewers: ddunbar, bob.wilson

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23531
------------------------------------------------------------------------

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

8 years agoRemoved extra space in OpenCL release notes
Anastasia Stulova [Thu, 18 Aug 2016 16:17:20 +0000 (16:17 +0000)]
Removed extra space in OpenCL release notes

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

8 years agoMerging r278786:
Hans Wennborg [Wed, 17 Aug 2016 21:58:11 +0000 (21:58 +0000)]
Merging r278786:
------------------------------------------------------------------------
r278786 | jamesm | 2016-08-16 02:45:36 -0700 (Tue, 16 Aug 2016) | 4 lines

Left shifts of negative values are defined if -fwrapv is set

This means we shouldn't emit ubsan detection code or warn.
Fixes PR25552.
------------------------------------------------------------------------

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

8 years agoMerging r277852:
Hans Wennborg [Wed, 17 Aug 2016 00:25:07 +0000 (00:25 +0000)]
Merging r277852:
------------------------------------------------------------------------
r277852 | dblaikie | 2016-08-05 12:03:01 -0700 (Fri, 05 Aug 2016) | 7 lines

PR26423: Assert on valid use of using declaration of a function with an undeduced auto return type

For now just disregard the using declaration in this case. Suboptimal,
but wiring up the ability to have declarations of functions that are
separate from their definition (we currently only do that for member
functions) and have differing return types (we don't have any support
for that) is more work than seems reasonable to at least fix this crash.
------------------------------------------------------------------------

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

8 years agoReleaseNotes: mention new /imsvc flag
Hans Wennborg [Wed, 17 Aug 2016 00:19:41 +0000 (00:19 +0000)]
ReleaseNotes: mention new /imsvc flag

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

8 years agoMerging r278763:
Hans Wennborg [Tue, 16 Aug 2016 16:19:18 +0000 (16:19 +0000)]
Merging r278763:
------------------------------------------------------------------------
r278763 | rsmith | 2016-08-15 17:13:47 -0700 (Mon, 15 Aug 2016) | 5 lines

PR28978: If we need overload resolution for the move constructor of an
anonymous union member of a class, we need overload resolution for the move
constructor of the class itself too; we can't rely on Sema to do the right
thing for us for anonymous union types.

------------------------------------------------------------------------

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

8 years ago[Branch 3.9] Remove any traces of partial constexpr lambda implementation
Faisal Vali [Tue, 16 Aug 2016 02:11:53 +0000 (02:11 +0000)]
[Branch 3.9] Remove any traces of partial constexpr lambda implementation

This patch essentially reverses all the changes from the following commit: https://reviews.llvm.org/rL264513 for branch 3.9.

Requested by Richard and Approved by Hans here: https://reviews.llvm.org/D23485

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

8 years agoMerging r277783 and r278156 to unbreak Clang on the branch after r278674
Hans Wennborg [Mon, 15 Aug 2016 16:32:18 +0000 (16:32 +0000)]
Merging r277783 and r278156 to unbreak Clang on the branch after r278674

------------------------------------------------------------------------
r277783 | timshen | 2016-08-04 16:03:44 -0700 (Thu, 04 Aug 2016) | 9 lines

[ADT] Migrate DepthFirstIterator to use NodeRef

Summary: The corresponding LLVM change is D23146.

Reviewers: dblaikie, chandlerc

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23147
------------------------------------------------------------------------

------------------------------------------------------------------------
r278156 | timshen | 2016-08-09 13:22:55 -0700 (Tue, 09 Aug 2016) | 16 lines

[ADT] Change iterator_adaptor_base's default template arguments to forward more underlying typedefs

Summary:
The corresponding LLVM change: D23217.

LazyVector::iterator breaks, because int isn't an iterator type.
Since iterator_adaptor_base shouldn't be blamed to break at the call to
iterator_traits<int>::xxx, I'd rather "fix" LazyVector::iterator.

The perfect solution is to model "relative pointer", but it's beyond the goal of this patch.

Reviewers: chandlerc, bkramer

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23218
------------------------------------------------------------------------

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

8 years agoOpenCL release notes
Anastasia Stulova [Mon, 15 Aug 2016 16:28:10 +0000 (16:28 +0000)]
OpenCL release notes

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

8 years agoMerge r278393 and r278395.
Ed Schouten [Sat, 13 Aug 2016 20:43:56 +0000 (20:43 +0000)]
Merge r278393 and r278395.

LLVM/Clang 3.8 is directly usable as a cross compiler for CloudABI/i686.
In 3.9rc1 there are a couple of regressions in the driver that cause it
to be less usable:

- PIE was enabled unconditionally, even though it's only available for
  x86-64 and aarch64.
- Some inline assembly fails to build, due to a shortage of registers,
  as frame pointers are not omitted.

Both these changes are fairly low risk (read: they don't affect other
targets), so go ahead and merge them into 3.9, so we can use an
unmodified compiler on all architectures.

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

8 years agoMerging r278471:
George Burgess IV [Fri, 12 Aug 2016 05:11:46 +0000 (05:11 +0000)]
Merging r278471:
------------------------------------------------------------------------
r278471 | gbiv | 2016-08-11 21:12:31 -0700 (Thu, 11 Aug 2016) | 11 lines

[Sema] Fix a crash on variadic enable_if functions.

Currently, when trying to evaluate an enable_if condition, we try to
evaluate all arguments a user passes to a function. Given that we can't
use variadic arguments from said condition anyway, not converting them
is a reasonable thing to do. So, this patch makes us ignore any varargs
when attempting to check an enable_if condition.

We'd crash because, in order to convert an argument, we need its
ParmVarDecl. Variadic arguments don't have ParmVarDecls.

------------------------------------------------------------------------

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

8 years agoUpdate release notes for new warnings.
Richard Trieu [Fri, 12 Aug 2016 00:00:21 +0000 (00:00 +0000)]
Update release notes for new warnings.

Document -Wcomma, -Wfloat-zero-conversion, and -Wfloat-overflow-conversion

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

8 years agoMerging r277522:
Hans Wennborg [Thu, 11 Aug 2016 18:16:47 +0000 (18:16 +0000)]
Merging r277522:
------------------------------------------------------------------------
r277522 | dcoughlin | 2016-08-02 14:07:23 -0700 (Tue, 02 Aug 2016) | 8 lines

[CFG] Fix crash finding destructor of lifetime-extended temporary.

Fix a crash under -Wthread-safety when finding the destructor for a
lifetime-extending reference.

A patch by Nandor Licker!

Differential Revision: https://reviews.llvm.org/D22419
------------------------------------------------------------------------

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

8 years agoMerging r276900:
Hans Wennborg [Thu, 11 Aug 2016 18:13:48 +0000 (18:13 +0000)]
Merging r276900:
------------------------------------------------------------------------
r276900 | epilk | 2016-07-27 11:25:10 -0700 (Wed, 27 Jul 2016) | 5 lines

[Sema] Teach getCurrentThisType to reconize lambda in in-class initializer

Fixes PR27994, a crash on valid.

Differential revision: https://reviews.llvm.org/D21145
------------------------------------------------------------------------

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

8 years agoMerging r278234 and r278235:
Hans Wennborg [Wed, 10 Aug 2016 17:34:17 +0000 (17:34 +0000)]
Merging r278234 and r278235:
------------------------------------------------------------------------
r278234 | joey | 2016-08-10 08:57:02 -0700 (Wed, 10 Aug 2016) | 5 lines

[OpenCL] Change block descriptor address space to constant.

The block descriptor is a GlobalVariable in the LLVM IR, so it shouldn't be
in the private address space.

------------------------------------------------------------------------

------------------------------------------------------------------------
r278235 | joey | 2016-08-10 09:04:14 -0700 (Wed, 10 Aug 2016) | 2 lines

[OpenCL] Fix typo in test that I accidentally introduced in my previous commit.

------------------------------------------------------------------------

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

8 years agoMerging r278139:
Hans Wennborg [Wed, 10 Aug 2016 16:36:05 +0000 (16:36 +0000)]
Merging r278139:
------------------------------------------------------------------------
r278139 | rnk | 2016-08-09 10:23:56 -0700 (Tue, 09 Aug 2016) | 6 lines

[clang-cl] Make -gline-tables-only imply -gcodeview

It's surprising that you have to pass /Z7 in addition to -gcodeview to
get debug info. The sanitizer runtime, for example, expects that if the
compiler supports the -gline-tables-only flag, then it will emit debug
info.
------------------------------------------------------------------------

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

8 years ago[docs] Update 3.9 release notes for the static analyzer.
Devin Coughlin [Tue, 9 Aug 2016 23:01:43 +0000 (23:01 +0000)]
[docs] Update 3.9 release notes for the static analyzer.

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

8 years agoMerging r277796, r277797, r277866, r277889 and r277900:
Hans Wennborg [Mon, 8 Aug 2016 16:37:00 +0000 (16:37 +0000)]
Merging r277796, r277797, r277866, r277889 and r277900:

------------------------------------------------------------------------
r277796 | rtrieu | 2016-08-04 19:39:30 -0700 (Thu, 04 Aug 2016) | 6 lines

Allow -1 to assign max value to unsigned bitfields.

Silence the -Wbitfield-constant-conversion warning for when -1 or other
negative values are assigned to unsigned bitfields, provided that the bitfield
is wider than the minimum number of bits needed to encode the negative value.

------------------------------------------------------------------------

------------------------------------------------------------------------
r277797 | rtrieu | 2016-08-04 20:16:36 -0700 (Thu, 04 Aug 2016) | 7 lines

Fix crash in template type diffing.

When the type being diffed is a type alias, and the orginal type is not a
templated type, then there will be no unsugared TemplateSpecializationType.
When this happens, exit early from the constructor.  Also add assertions to
the other iterator accessor to prevent the iterator from being used.

------------------------------------------------------------------------

------------------------------------------------------------------------
r277866 | rtrieu | 2016-08-05 14:02:34 -0700 (Fri, 05 Aug 2016) | 12 lines

Fix false positive in -Wunsequenced and templates.

For builtin logical operators, there is a well-defined ordering of argument
evaluation.  For overloaded operator of the same type, there is no argument
evaluation order, similar to other function calls.  When both are present,
uninstantiated templates with an operator&& is treated as an unresolved
function call.  Unresolved function calls are treated as normal function calls,
and may result in false positives when the builtin logical operator is used.
Have the unsequenced checker ignore dependent expressions to avoid this
false positive.  The check also happens in template instantiations to catch
when the overloaded operator is used.

------------------------------------------------------------------------

------------------------------------------------------------------------
r277889 | rtrieu | 2016-08-05 16:24:47 -0700 (Fri, 05 Aug 2016) | 9 lines

Fix two false positives in -Wreturn-stack-address

If the return type is a pointer and the function returns the reference to a
pointer, don't warn since only the value is returned, not the reference.

If a reference function parameter appears in the reference chain, don't warn
since binding happens at the caller scope, so addresses returned are not
to local stack.  This includes default arguments as well.

------------------------------------------------------------------------

------------------------------------------------------------------------
r277900 | rtrieu | 2016-08-05 18:44:06 -0700 (Fri, 05 Aug 2016) | 2 lines

Fix typos from r277797 and unused variable from r277889.

------------------------------------------------------------------------

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

8 years agoMerging r277743:
Hans Wennborg [Mon, 8 Aug 2016 16:32:10 +0000 (16:32 +0000)]
Merging r277743:
------------------------------------------------------------------------
r277743 | bader | 2016-08-04 11:06:27 -0700 (Thu, 04 Aug 2016) | 12 lines

[OpenCL] Added underscores to the names of 'to_addr' OpenCL built-ins.

Summary:
In order to re-define OpenCL built-in functions
'to_{private,local,global}' in OpenCL run-time library LLVM names must
be different from the clang built-in function names.

Reviewers: yaxunl, Anastasia

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D23120
------------------------------------------------------------------------

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

8 years ago[docs] Add 3.9 release notes for the static analyzer.
Devin Coughlin [Thu, 4 Aug 2016 21:27:47 +0000 (21:27 +0000)]
[docs] Add 3.9 release notes for the static analyzer.

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

8 years agoAdd a note about clang-cl pch support to the 3.9 release notes.
Nico Weber [Thu, 4 Aug 2016 18:55:57 +0000 (18:55 +0000)]
Add a note about clang-cl pch support to the 3.9 release notes.

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

8 years agogrammar fix
Nico Weber [Thu, 4 Aug 2016 18:52:17 +0000 (18:52 +0000)]
grammar fix

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

8 years agoMerging r277095:
Hans Wennborg [Tue, 2 Aug 2016 21:29:54 +0000 (21:29 +0000)]
Merging r277095:
------------------------------------------------------------------------
r277095 | epilk | 2016-07-28 17:55:40 -0700 (Thu, 28 Jul 2016) | 5 lines

[Parser] Fix bug where delayed typo in conditional expression was corrected twice

Patch by David Tarditi!

Differential revision: https://reviews.llvm.org/D22930
------------------------------------------------------------------------

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

8 years agoMerging r277457
Diana Picus [Tue, 2 Aug 2016 14:34:15 +0000 (14:34 +0000)]
Merging r277457

[clang-cl] Fix PCH tests to use x86_64 as target

These tests require x86-registered-target, but they don't force the target as
x86 on the command line, which means they will be run and they might fail when
building the x86 backend on another platform (such as AArch64).

Fixes https://llvm.org/bugs/show_bug.cgi?id=28797

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

8 years agoMerging r277307:
Dimitry Andric [Tue, 2 Aug 2016 06:46:09 +0000 (06:46 +0000)]
Merging r277307:

------------------------------------------------------------------------
r277307 | dim | 2016-07-31 22:23:23 +0200 (Sun, 31 Jul 2016) | 23 lines

Add more gcc compatibility names to clang's cpuid.h

Summary:
Some cpuid bit defines are named slightly different from how gcc's
cpuid.h calls them.

Define a few more compatibility names to appease software built for gcc:

* `bit_PCLMUL`      alias of `bit_PCLMULQDQ`
* `bit_SSE4_1`      alias of `bit_SSE41`
* `bit_SSE4_2`      alias of `bit_SSE42`
* `bit_AES`         alias of `bit_AESNI`
* `bit_CMPXCHG8B`   alias of `bit_CX8`

While here, add the misssing 29th bit, `bit_F16C` (which is how gcc
calls this bit).

Reviewers: joerg, rsmith

Subscribers: bruno, cfe-commits

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

------------------------------------------------------------------------

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

8 years agoMerging r277221:
Hans Wennborg [Mon, 1 Aug 2016 20:33:18 +0000 (20:33 +0000)]
Merging r277221:
------------------------------------------------------------------------
r277221 | echristo | 2016-07-29 15:11:11 -0700 (Fri, 29 Jul 2016) | 3 lines

Remove unused variable.

Fixes PR28761.
------------------------------------------------------------------------

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

8 years agoDelete offloading-interoperability.c
Hans Wennborg [Fri, 29 Jul 2016 20:02:38 +0000 (20:02 +0000)]
Delete offloading-interoperability.c

The test is now failing on Windows. This is causing too much pain,
let's just drop it from the branch.

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

8 years agoMerging r276983, r277138 and r277141:
Hans Wennborg [Fri, 29 Jul 2016 18:36:36 +0000 (18:36 +0000)]
Merging r276983, r277138 and r277141:
------------------------------------------------------------------------
r276983 | sfantao | 2016-07-28 07:56:19 -0700 (Thu, 28 Jul 2016) | 5 lines

[OpenMP] Fix link command pattern in offloading interoperability test.

It was causing a few bots to fail.
------------------------------------------------------------------------

------------------------------------------------------------------------
r277138 | d0k | 2016-07-29 06:07:09 -0700 (Fri, 29 Jul 2016) | 4 lines

Make test not fail on hosts where the default omp library is gomp.

This is the case on some linuxes, just force libomp so we get the
desired results.
------------------------------------------------------------------------

------------------------------------------------------------------------
r277141 | djasper | 2016-07-29 06:45:03 -0700 (Fri, 29 Jul 2016) | 1 line

Add missing '-no-canonical-prefixes' in test.
------------------------------------------------------------------------

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

8 years agoMerging r276653:
Hans Wennborg [Thu, 28 Jul 2016 23:06:58 +0000 (23:06 +0000)]
Merging r276653:
------------------------------------------------------------------------
r276653 | ssrivastava | 2016-07-25 10:17:06 -0700 (Mon, 25 Jul 2016) | 11 lines

Support '#pragma once' in headers when using PCH

The '#pragma once' directive was erroneously ignored when encountered
in the header-file specified in generate-PCH-mode. This resulted in
compile-time errors in some cases with legal code, and also a misleading
warning being produced.

Patch by Warren Ristow!

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

------------------------------------------------------------------------

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

8 years agoMerging r276979:
Hans Wennborg [Thu, 28 Jul 2016 17:11:02 +0000 (17:11 +0000)]
Merging r276979:
------------------------------------------------------------------------
r276979 | sfantao | 2016-07-28 07:29:18 -0700 (Thu, 28 Jul 2016) | 12 lines

[OpenMP][CUDA] Do not forward OpenMP flags for CUDA device actions.

Summary:
This patch prevents OpenMP flags from being forwarded to CUDA device commands. That was causing the CUDA frontend to attempt to emit OpenMP code which is not supported.

This fixes the bug reported in https://llvm.org/bugs/show_bug.cgi?id=28723.

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

Subscribers: caomhin, cfe-commits

Differential Revision: https://reviews.llvm.org/D22895
------------------------------------------------------------------------

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

8 years agoMention of proper support for "__unaligned" type qualifier in 3.9 clang release notes
Hans Wennborg [Thu, 28 Jul 2016 15:59:18 +0000 (15:59 +0000)]
Mention of proper support for "__unaligned" type qualifier in 3.9 clang release notes

Patch by: Andrey Bokhanko <andreybokhanko@gmail.com>

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

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

8 years agoMerging r276102:
Hans Wennborg [Thu, 28 Jul 2016 15:41:25 +0000 (15:41 +0000)]
Merging r276102:
------------------------------------------------------------------------
r276102 | rksimon | 2016-07-20 03:18:01 -0700 (Wed, 20 Jul 2016) | 11 lines

[X86][SSE] Reimplement SSE fp2si conversion intrinsics instead of using generic IR

D20859 and D20860 attempted to replace the SSE (V)CVTTPS2DQ and VCVTTPD2DQ truncating conversions with generic IR instead.

It turns out that the behaviour of these intrinsics is different enough from generic IR that this will cause problems, INF/NAN/out of range values are guaranteed to result in a 0x80000000 value - which plays havoc with constant folding which converts them to either zero or UNDEF. This is also an issue with the scalar implementations (which were already generic IR and what I was trying to match).

This patch changes both scalar and packed versions back to using x86-specific builtins.

It also deals with the other scalar conversion cases that are runtime rounding mode dependent and can have similar issues with constant folding.

Differential Revision: https://reviews.llvm.org/D22105
------------------------------------------------------------------------

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

8 years agoMerging r276350:
Hans Wennborg [Thu, 28 Jul 2016 15:18:14 +0000 (15:18 +0000)]
Merging r276350:
------------------------------------------------------------------------
r276350 | epilk | 2016-07-21 15:31:40 -0700 (Thu, 21 Jul 2016) | 3 lines

[CodeGen] Fix a crash when constant folding switch statement

Differential revision: https://reviews.llvm.org/D22542
------------------------------------------------------------------------

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

8 years agoMerging r276887:
Hans Wennborg [Wed, 27 Jul 2016 16:56:35 +0000 (16:56 +0000)]
Merging r276887:
------------------------------------------------------------------------
r276887 | hans | 2016-07-27 09:39:45 -0700 (Wed, 27 Jul 2016) | 1 line

Update cxx_dr_Status after 3.9 branch
------------------------------------------------------------------------

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

8 years agoGenerate docs/AttributeReference.rst
Hans Wennborg [Wed, 27 Jul 2016 16:48:23 +0000 (16:48 +0000)]
Generate docs/AttributeReference.rst

$ bin/clang-tblgen -gen-attr-docs -I../cfe.src/include \
    ../cfe.src/include/clang/Basic/Attr.td \
    -o ../cfe.src/docs/AttributeReference.rst

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

8 years agoMerging r276887:
Hans Wennborg [Wed, 27 Jul 2016 16:41:01 +0000 (16:41 +0000)]
Merging r276887:
------------------------------------------------------------------------
r276887 | hans | 2016-07-27 09:39:45 -0700 (Wed, 27 Jul 2016) | 1 line

Update cxx_dr_Status after 3.9 branch
------------------------------------------------------------------------

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

8 years agoMerging r276716:
Hans Wennborg [Tue, 26 Jul 2016 20:47:37 +0000 (20:47 +0000)]
Merging r276716:
------------------------------------------------------------------------
r276716 | vedantk | 2016-07-25 17:24:59 -0700 (Mon, 25 Jul 2016) | 10 lines

[Coverage] Do not write out coverage mappings with zero entries

After r275121, we stopped mapping regions from system headers. Lambdas
declared in regions belonging to system headers started producing empty
coverage mappings, since the files corresponding to their spelling locs
were being ignored.

The coverage reader doesn't know what to do with these empty mappings.
This commit makes sure that we don't produce them and adds a test. I'll
make the reader stricter in a follow-up commit.
------------------------------------------------------------------------

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

8 years agoMerging r276473:
Hans Wennborg [Tue, 26 Jul 2016 15:57:30 +0000 (15:57 +0000)]
Merging r276473:
------------------------------------------------------------------------
r276473 | vvassilev | 2016-07-22 14:08:24 -0700 (Fri, 22 Jul 2016) | 13 lines

[modules] Teach the ASTWriter to ignore mutations coming from the ASTReader.

Processing update records (and loading a module, in general) might trigger
unexpected calls to the ASTWriter (being a mutation listener). Now we have a
mechanism to suppress those calls to the ASTWriter but notify other possible
mutation listeners.

Fixes https://llvm.org/bugs/show_bug.cgi?id=28332

Patch by Cristina Cristescu and me.

Reviewed by Richard Smith (D21800).

------------------------------------------------------------------------

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

8 years agoMerging r276361:
Hans Wennborg [Mon, 25 Jul 2016 17:19:19 +0000 (17:19 +0000)]
Merging r276361:
------------------------------------------------------------------------
r276361 | wolfgangp | 2016-07-21 16:28:18 -0700 (Thu, 21 Jul 2016) | 5 lines

Reverting r275115 which caused PR28634.
When empty (forwarding) basic blocks that are referenced by user labels
are removed, incorrect code may be generated.

------------------------------------------------------------------------

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

8 years agoMerging Clang-side of r275967: (the LLVM side already merged in r276561)
Hans Wennborg [Mon, 25 Jul 2016 16:21:28 +0000 (16:21 +0000)]
Merging Clang-side of r275967: (the LLVM side already merged in r276561)
------------------------------------------------------------------------
r275967 | dsanders | 2016-07-19 03:49:03 -0700 (Tue, 19 Jul 2016) | 16 lines

[mips] Correct label prefixes for N32 and N64.

Summary:
N32 and N64 follow the standard ELF conventions (.L) whereas O32 uses its own
($).

This fixes the majority of object differences between -fintegrated-as and
-fno-integrated-as.

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

------------------------------------------------------------------------

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

8 years agoMerging r276232:
George Burgess IV [Fri, 22 Jul 2016 22:57:21 +0000 (22:57 +0000)]
Merging r276232:
------------------------------------------------------------------------
r276232 | gbiv | 2016-07-20 20:28:13 -0700 (Wed, 20 Jul 2016) | 13 lines

[Sema] Fix PR28623.

In atomic builtins, we assumed that the LValue conversion on the first
argument would succeed. So, we would crash given code like:

```
void ovl(char);
void ovl(int);
__atomic_store_n(ovl, 0, 0);
```

This patch makes us not assume that said conversion is successful. :)

------------------------------------------------------------------------

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

8 years agoReleaseNotes: s/3.7/3.8/ in 'since the 3.7 release'
Hans Wennborg [Fri, 22 Jul 2016 14:17:04 +0000 (14:17 +0000)]
ReleaseNotes: s/3.7/3.8/ in 'since the 3.7 release'

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

8 years agoAdd attribute abi_tag to the release notes
Hans Wennborg [Wed, 20 Jul 2016 13:28:36 +0000 (13:28 +0000)]
Add attribute abi_tag to the release notes

Patch by Dmitry Polukhin <dmitry.polukhin@gmail.com>!

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

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

8 years agoMerging r275880:
Hans Wennborg [Mon, 18 Jul 2016 20:12:49 +0000 (20:12 +0000)]
Merging r275880:
------------------------------------------------------------------------
r275880 | dcoughlin | 2016-07-18 11:57:50 -0700 (Mon, 18 Jul 2016) | 3 lines

Revert "[analyzer] Add checker modeling potential C++ self-assignment"

This reverts commit r275820. It is failing on the bots.
------------------------------------------------------------------------

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

8 years agoAnalyzer docs: update version to 3.9
Hans Wennborg [Mon, 18 Jul 2016 18:20:49 +0000 (18:20 +0000)]
Analyzer docs: update version to 3.9

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

8 years agoCreating release_39 branch off revision 275826
Hans Wennborg [Mon, 18 Jul 2016 17:52:43 +0000 (17:52 +0000)]
Creating release_39 branch off revision 275826

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

8 years ago[clang-cl] Reinstate -gline-tables-only as a CoreOption while we sort out the fate...
Reid Kleckner [Mon, 18 Jul 2016 17:49:40 +0000 (17:49 +0000)]
[clang-cl] Reinstate -gline-tables-only as a CoreOption while we sort out the fate of /Zd

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

8 years ago[analyzer] Add checker modeling potential C++ self-assignment
Devin Coughlin [Mon, 18 Jul 2016 17:23:30 +0000 (17:23 +0000)]
[analyzer] Add checker modeling potential C++ self-assignment

This checker checks copy and move assignment operators whether they are
protected against self-assignment. Since C++ core guidelines discourages
explicit checking for `&rhs==this` in general we take a different approach: in
top-frame analysis we branch the exploded graph for two cases, where &rhs==this
and &rhs!=this and let existing checkers (e.g. unix.Malloc) do the rest of the
work. It is important that we check all copy and move assignment operator in top
frame even if we checked them already since self-assignments may happen
undetected even in the same translation unit (e.g. using random indices for an
array what may or may not be the same).

A patch by Ádám Balogh!

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

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

8 years agoRelease note for 'nodebug' on variables
Paul Robinson [Mon, 18 Jul 2016 17:19:12 +0000 (17:19 +0000)]
Release note for 'nodebug' on variables

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

8 years ago[OpenMP] update test cases for -std=c++11 compile
Kelvin Li [Mon, 18 Jul 2016 16:09:53 +0000 (16:09 +0000)]
[OpenMP] update test cases for -std=c++11 compile

target_parallel_for_simd_collapse_messages.cpp and target_parallel_for_simd_ordered_messages.cpp give different diagnostic messages in compiling with -std=c++11. The test cases are updated to make it compatible.

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

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

8 years agoRevert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument...
NAKAMURA Takumi [Mon, 18 Jul 2016 03:23:25 +0000 (03:23 +0000)]
Revert r275678, "Revert "Revert r275027 - Let FuncAttrs infer the 'returned' argument attribute""

This reverts also r275029, "Update Clang tests after adding inference for the returned argument attribute"

It broke LTO build. Seems miscompilation.

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

8 years agotest: add missing triple to test
Saleem Abdulrasool [Sun, 17 Jul 2016 22:54:42 +0000 (22:54 +0000)]
test: add missing triple to test

The test was relying on the default triple which may not be correct.  Explicitly
provide it a triple.  Should repair the windows on Linux builder.

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

8 years agoCodeGen: honour dllstorage on ObjC types
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:44 +0000 (22:27 +0000)]
CodeGen: honour dllstorage on ObjC types

Add support for ObjC types to respect the DLLImport/DLLExport storage
annotations.  This only effects COFF output.  This would allow usage with
clang/C2, but not with clang/LLVM due to hard coded section names.

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

8 years agoCodeGen: whitespace, formatting cleanups, NFC
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:41 +0000 (22:27 +0000)]
CodeGen: whitespace, formatting cleanups, NFC

Format some code which was oddly formatted.  Use a bit of auto to make the code
more legible.  NFC.

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

8 years agoCodeGen: whitespace cleanup, StringRef usage in ObjC EH type construction
Saleem Abdulrasool [Sun, 17 Jul 2016 22:27:38 +0000 (22:27 +0000)]
CodeGen: whitespace cleanup, StringRef usage in ObjC EH type construction

Clean up some formatting issues and use a bit more StringRef based operations
instead of SmallStrings.  NFC.

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

8 years agoAttempt to work around MSVC rejects-valid, round 2.
Richard Smith [Sun, 17 Jul 2016 20:00:59 +0000 (20:00 +0000)]
Attempt to work around MSVC rejects-valid, round 2.

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

8 years agoPR28589: attempt to work around MSVC rejects-valid.
Richard Smith [Sun, 17 Jul 2016 19:24:51 +0000 (19:24 +0000)]
PR28589: attempt to work around MSVC rejects-valid.

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

8 years ago[CodeGen] Some assorted cleanups
David Majnemer [Sun, 17 Jul 2016 00:39:12 +0000 (00:39 +0000)]
[CodeGen] Some assorted cleanups

No functional change, just some cleanups:
- Use auto when it is appropriate.
- There were some strange static_casts which were superfluous.
- Use range-based for loops when appropriate.
- The dyn_cast_or_null construct was used when null was impossible.

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

8 years agoCodeGen: use StringRefs more in ObjC class generation, NFC
Saleem Abdulrasool [Sat, 16 Jul 2016 22:42:06 +0000 (22:42 +0000)]
CodeGen: use StringRefs more in ObjC class generation, NFC

Rather than building up a number of SmallString-s in order to construct a
std::string, use more StringRefs and construct the string once before use.  This
avoids unnecessary string constructions.  NFC.

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

8 years agoCodeGen: simplify using a local variable, NFC
Saleem Abdulrasool [Sat, 16 Jul 2016 22:42:04 +0000 (22:42 +0000)]
CodeGen: simplify using a local variable, NFC

Add a couple of local variables for the class interface and the super class
interface.  This allows for the repeated access of the information to be cached
and makes the code simpler to understand.  NFC.

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

8 years agoRevert "Revert r275029 - Update Clang tests after adding inference for the returned...
Hal Finkel [Sat, 16 Jul 2016 07:22:09 +0000 (07:22 +0000)]
Revert "Revert r275029 - Update Clang tests after adding inference for the returned argument attribute"

This reverts commit r275043 after reapplying the underlying LLVM commit.

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

8 years ago[Driver] Add flags for enabling both types of PGO Instrumentation
Sean Silva [Sat, 16 Jul 2016 02:54:58 +0000 (02:54 +0000)]
[Driver] Add flags for enabling both types of PGO Instrumentation

The flags:
Enable IR-level instrumentation -fprofile-generate or -fprofile-generate=
When applying profile data: -fprofile-use=/path/to/profdata

Patch by Jake VanAdrighem!

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

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

8 years agoRemove extra semi-colon. Fixes warning and Werror bots.
Eric Christopher [Sat, 16 Jul 2016 00:58:34 +0000 (00:58 +0000)]
Remove extra semi-colon. Fixes warning and Werror bots.

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

8 years ago[ObjC] Implement @available in the Parser and AST
Erik Pilkington [Sat, 16 Jul 2016 00:35:23 +0000 (00:35 +0000)]
[ObjC] Implement @available in the Parser and AST

This patch adds a new AST node: ObjCAvailabilityCheckExpr, and teaches the
Parser and Sema to generate it. This node represents an availability check of
the form:

  @available(macos 10.10, *);

Which will eventually compile to a runtime check of the host's OS version. This
is the first patch of the feature I proposed here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/049851.html

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

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

8 years agoReimplement ExternalSemaSource delegation in terms of
Richard Smith [Sat, 16 Jul 2016 00:35:14 +0000 (00:35 +0000)]
Reimplement ExternalSemaSource delegation in terms of
MultiplexExternalSemaSource to remove one of the places that needs updating
every time the ExternalSemaSource interface changes.

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

8 years agoUse std::string instead of StringRef when generating the auxiliar triple in the front...
Samuel Antao [Sat, 16 Jul 2016 00:15:56 +0000 (00:15 +0000)]
Use std::string instead of StringRef when generating the auxiliar triple in the frontend tool.

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

8 years agoAttempt to fix breakage caused by r275645 for Windows bots.
Samuel Antao [Fri, 15 Jul 2016 23:51:21 +0000 (23:51 +0000)]
Attempt to fix breakage caused by r275645 for Windows bots.

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

8 years ago[CUDA][OpenMP] Create generic offload action
Samuel Antao [Fri, 15 Jul 2016 23:13:27 +0000 (23:13 +0000)]
[CUDA][OpenMP] Create generic offload action

Summary:
This patch replaces the CUDA specific action by a generic offload action. The offload action may have multiple dependences classier in “host” and “device”. The way this generic offloading action is used is very similar to what is done today by the CUDA implementation: it is used to set a specific toolchain and architecture to its dependences during the generation of jobs.

This patch also proposes propagating the offloading information through the action graph so that that information can be easily retrieved at any time during the generation of commands. This allows e.g. the "clang tool” to evaluate whether CUDA should be supported for the device or host and ptas to easily retrieve the target architecture.

This is an example of how the action graphs would look like (compilation of a single CUDA file with two GPU architectures)
```
0: input, "cudatests.cu", cuda, (host-cuda)
1: preprocessor, {0}, cuda-cpp-output, (host-cuda)
2: compiler, {1}, ir, (host-cuda)
3: input, "cudatests.cu", cuda, (device-cuda, sm_35)
4: preprocessor, {3}, cuda-cpp-output, (device-cuda, sm_35)
5: compiler, {4}, ir, (device-cuda, sm_35)
6: backend, {5}, assembler, (device-cuda, sm_35)
7: assembler, {6}, object, (device-cuda, sm_35)
8: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {7}, object
9: offload, "device-cuda (nvptx64-nvidia-cuda:sm_35)" {6}, assembler
10: input, "cudatests.cu", cuda, (device-cuda, sm_37)
11: preprocessor, {10}, cuda-cpp-output, (device-cuda, sm_37)
12: compiler, {11}, ir, (device-cuda, sm_37)
13: backend, {12}, assembler, (device-cuda, sm_37)
14: assembler, {13}, object, (device-cuda, sm_37)
15: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {14}, object
16: offload, "device-cuda (nvptx64-nvidia-cuda:sm_37)" {13}, assembler
17: linker, {8, 9, 15, 16}, cuda-fatbin, (device-cuda)
18: offload, "host-cuda (powerpc64le-unknown-linux-gnu)" {2}, "device-cuda (nvptx64-nvidia-cuda)" {17}, ir
19: backend, {18}, assembler
20: assembler, {19}, object
21: input, "cuda", object
22: input, "cudart", object
23: linker, {20, 21, 22}, image
```
The changes in this patch pass the existent regression tests (keeps the existent functionality) and resulting binaries execute correctly in a Power8+K40 machine.

Reviewers: echristo, hfinkel, jlebar, ABataev, tra

Subscribers: guansong, andreybokhanko, tcramer, mkuron, cfe-commits, arpith-jacob, carlo.bertolli, caomhin

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

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

8 years ago[index] Create different USR if a property is a class property.
Argyrios Kyrtzidis [Fri, 15 Jul 2016 22:18:19 +0000 (22:18 +0000)]
[index] Create different USR if a property is a class property.

Avoids USR conflicts between class & instance properties of the same name.

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

8 years agoRevert r275481, r275490. This broke modules bootstrap.
Richard Smith [Fri, 15 Jul 2016 21:33:46 +0000 (21:33 +0000)]
Revert r275481, r275490. This broke modules bootstrap.

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