]> granicus.if.org Git - clang/log
clang
10 years ago[PPC64LE] Implement little-endian semantics for vec_perm
Bill Schmidt [Thu, 5 Jun 2014 19:07:40 +0000 (19:07 +0000)]
[PPC64LE] Implement little-endian semantics for vec_perm

The PowerPC vperm (vector permute) instruction is defined
architecturally with a big-endian bias, in that the two input vectors
are assumed to be concatenated "left to right" and the elements of the
combined input vector are assumed to be numbered from "left to right"
(i.e., with element 0 referencing the high-order element).  This
definition is unnatural for little-endian code generation.

To facilitate ease of porting, the vec_perm interface is designed to
use natural element ordering, so that elements are numbered according
to little-endian design principles when code is generated for a
little-endian target.  The desired semantics can be achieved with the
vperm instruction provided that the two input vector registers are
reversed, and the permute control vector is complemented.  The
complementing is performed using an xor with a vector containing all
one bits.

Only the rightmost 5 bits of each element of the permute control
vector are relevant, so it would be possible to complement the vector
with respect to a <16xi8> vector containing all 31s.  However, when
the permute control vector is not a constant, using 255 instead has
the advantage that the vec_xor can be recognized during code
generation as a vnor instruction.  (Power8 introduces a vnand
instruction which could alternatively be generated.)

The correctness of this code is tested by the new perm.c test added in
a previous patch.  I plan to later make the existing ppc32 Altivec
compile-time tests work for ppc64 and ppc64le as well.

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

10 years agoAdd hasLocalStorage/hasGlobalStorage matchers.
Samuel Benzaquen [Thu, 5 Jun 2014 18:22:14 +0000 (18:22 +0000)]
Add hasLocalStorage/hasGlobalStorage matchers.

Summary:
Add hasLocalStorage/hasGlobalStorage matchers for VarDecl nodes.
Update the doc. Also add them to the dynamic registry.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

10 years agoFix bot for named register test
Renato Golin [Thu, 5 Jun 2014 16:52:20 +0000 (16:52 +0000)]
Fix bot for named register test

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

10 years agoAdd pointer types to global named register
Renato Golin [Thu, 5 Jun 2014 16:45:22 +0000 (16:45 +0000)]
Add pointer types to global named register

This patch adds support for pointer types in global named registers variables.
It'll be lowered as a pair of read/write_register and inttoptr/ptrtoint calls.
Also adds some early checks on types on SemaDecl to avoid the assert.

Tests changed accordingly. (PR19837)

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

10 years ago[mips] Add macros _MIPS_ISA and __mips_isa_rev (same expansion as defined by GCC).
Matheus Almeida [Thu, 5 Jun 2014 14:59:18 +0000 (14:59 +0000)]
[mips] Add macros _MIPS_ISA and __mips_isa_rev (same expansion as defined by GCC).

Summary: The Linux Kernel is one example of a piece of software that relies on them.

Reviewers: atanasyan

Reviewed By: atanasyan

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

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

10 years agoFix equalsNode() to accept pointers to derived types.
Samuel Benzaquen [Thu, 5 Jun 2014 14:47:08 +0000 (14:47 +0000)]
Fix equalsNode() to accept pointers to derived types.

Summary:
Move the 'const' in the AST_*MATCHER_P* macros to the right of ParamType to
avoiad applying the constness on the wrong level when ParamType is a pointer.
Change equalsNode() to explicitly accept 'const Decl*' or 'const Stmt*'.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

10 years agoFix driver warning about -pthread on Android.
Evgeniy Stepanov [Thu, 5 Jun 2014 11:41:39 +0000 (11:41 +0000)]
Fix driver warning about -pthread on Android.

-pthread is no-op on Android. Suppress the unused argument warning.

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

10 years agoFix driver warning about -shared-libasan on Android.
Evgeniy Stepanov [Thu, 5 Jun 2014 11:14:00 +0000 (11:14 +0000)]
Fix driver warning about -shared-libasan on Android.

Asan runtime library is always shared on Android, and -shared-libasan is no-op.
Suppress the unused argument warning.

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

10 years agoXCore target: Fix 'typestring' binding qualifier to the array and not the type
Robert Lytton [Thu, 5 Jun 2014 09:06:21 +0000 (09:06 +0000)]
XCore target: Fix 'typestring' binding qualifier to the array and not the type

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

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

10 years agoChanging this line of code back to the way it was before Alp's config.h clean up...
Puyan Lotfi [Thu, 5 Jun 2014 04:29:21 +0000 (04:29 +0000)]
Changing this line of code back to the way it was before Alp's config.h clean up changes.
I've already spoken to Alp and he signed off on making this one change, so that our buildbots
go green in the short term.

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

10 years agoBugfix: don't assert if someone manages to declare an operator new/delete template...
Richard Smith [Thu, 5 Jun 2014 00:43:02 +0000 (00:43 +0000)]
Bugfix: don't assert if someone manages to declare an operator new/delete template before the builtin operator new/delete.

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

10 years agoFlush C stdio streams upon process termination
Reid Kleckner [Thu, 5 Jun 2014 00:13:43 +0000 (00:13 +0000)]
Flush C stdio streams upon process termination

Due to what can only be described as a CRT bug, stdout and amazingly
even stderr are not always flushed upon process termination, especially
when the system is under high threading pressure.  I have found two
repros for this:

1) In lib\Support\Threading.cpp, change sys::Mutex to an
std::recursive_mutex and run check-clang.  Usually between 30 and 40
tests will fail.

2) Add OutputDebugStrings in code that runs during static initialization
and static shutdown.  This will sometimes generate similar failures.

After a substantial amount of troubleshooting and debugging, I found
that I could reproduce this from the command line without running
check-clang.  Simply make the mutex change described in #1, then
manually run the following command many times by running it once, then
pressing Up -> Enter very quickly:

D:\src\llvm\build\vs2013\Debug\bin\c-index-test.EXE -cursor-at=D:\src\llvm\tools\clang\test\Index\targeted-preamble.h:2:15 D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -include D:\src\llvm\build\vs2013\tools\clang\test\Index\Output\targeted-cursor.c.tmp.h -Xclang -error-on-deserialized-decl=NestedVar1      -Xclang -error-on-deserialized-decl=TopVar    | D:\src\llvm\build\vs2013\Debug\bin\FileCheck.EXE D:\src\llvm\tools\clang\test\Index\targeted-cursor.c -check-prefix=PREAMBLE-CURSOR1

Sporadically they will fail, and attaching a debugger to a failed
instance indicates that stdin of FileCheck.exe is empty.

Note that due to the repro in #2, we can rule out a bug in the STL's
mutex implementation, and instead conclude that this is a real flake in
the windows test harness.

Test Plan:
Without patch: Ran check-clang 10 times and saw over 30 Unexpected failures on every run.
With patch: Ran check-clang 10 times and saw 0 unexpected failures across all runs.

Reviewers: rnk

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

Patch by Zachary Turner!

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

10 years ago[ubsan] Don't add a --dynamic-list for ubsan symbols when building a shared
Richard Smith [Wed, 4 Jun 2014 23:28:46 +0000 (23:28 +0000)]
[ubsan] Don't add a --dynamic-list for ubsan symbols when building a shared
library. That results in the linker resolving all references to weak symbols in
the DSO to the definition from within that DSO. Ironically, this rarely causes
observable problems, except that it causes ubsan's own dynamic type check to
spuriously fail (because we fail to properly merge type_info object names).

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

10 years agoFormatting cleanup.
Richard Smith [Wed, 4 Jun 2014 23:26:06 +0000 (23:26 +0000)]
Formatting cleanup.

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

10 years agoDon't dynamically initialize dllimport vars (PR19933)
Hans Wennborg [Wed, 4 Jun 2014 21:09:46 +0000 (21:09 +0000)]
Don't dynamically initialize dllimport vars (PR19933)

They should be initialized when they're exported.

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

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

10 years agoRemove the overload of GetAddrOfConstantString method
Alexey Samsonov [Wed, 4 Jun 2014 20:25:57 +0000 (20:25 +0000)]
Remove the overload of GetAddrOfConstantString method

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

10 years agoRefactor and generalize GetAddrOfConstantString and GetAddrOfConstantStringFromLiteral.
Alexey Samsonov [Wed, 4 Jun 2014 19:56:57 +0000 (19:56 +0000)]
Refactor and generalize GetAddrOfConstantString and GetAddrOfConstantStringFromLiteral.

Share mode code between these functions and re-structure them in a way
which shows how similar they actually are. The latter function works well
with literals of multi-byte chars and does a GlobalVariable name mangling
(if global strings are non-writable).

No functionality change.

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

10 years agoThis cast is not necessary any more (llvm api change).
Rafael Espindola [Wed, 4 Jun 2014 19:03:20 +0000 (19:03 +0000)]
This cast is not necessary any more (llvm api change).

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

10 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 4 Jun 2014 18:51:46 +0000 (18:51 +0000)]
Update for llvm api change.

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

10 years agoMS-ABI: Mangle empty template parameter packs correctly
David Majnemer [Wed, 4 Jun 2014 16:46:32 +0000 (16:46 +0000)]
MS-ABI: Mangle empty template parameter packs correctly

Tested for compatibility with VS2013.

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

10 years agoMS-ABI: Implement user defined literals
David Majnemer [Wed, 4 Jun 2014 16:46:26 +0000 (16:46 +0000)]
MS-ABI: Implement user defined literals

Straightforward implementation of UDLs, it's compatible with VS "14".

This nearly completes our implementation of C++ name mangling for the
MS-ABI.

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

10 years ago[OPENMP] Parsing/Sema for OMPLasprivateClause.
Alexander Musman [Wed, 4 Jun 2014 13:06:39 +0000 (13:06 +0000)]
[OPENMP] Parsing/Sema for OMPLasprivateClause.
Parsing this clause, allowing it on directive ‘omp simd’ and semantic checks.

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

10 years agoclang-format: Leave empty lines within UnwrappedLines.
Daniel Jasper [Wed, 4 Jun 2014 12:40:57 +0000 (12:40 +0000)]
clang-format: Leave empty lines within UnwrappedLines.

These are commonly used to structure things like enums or long braced
lists. There doesn't seem to be a good reason to have the behavior in
such structures be different from the behavior between statements.

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

10 years ago[OPENMP] Small comment and reformatting fixes.
Alexander Musman [Wed, 4 Jun 2014 07:53:32 +0000 (07:53 +0000)]
[OPENMP] Small comment and reformatting fixes.

Fix post-commit review comments by Carlo Bertolli
for commit r209660 - OMP collapse clause.

Re-formatted TransformOMP* functions in TreeTransform.h with clang-format.

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

10 years agoRemove the last remaining llvm/Config/config.h includes
Alp Toker [Wed, 4 Jun 2014 03:28:55 +0000 (03:28 +0000)]
Remove the last remaining llvm/Config/config.h includes

This corrects long-standing misuses of LLVM's internal config.h.

In most cases the public llvm-config.h header was intended and we can now
remove the old hacks thanks to LLVM r210144.

The config.h header is private, won't be installed and should no longer be
included by clang or other modules.

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

10 years agoDowngrade "definition of dllimport static field" error to warning for class templates...
Hans Wennborg [Wed, 4 Jun 2014 00:18:41 +0000 (00:18 +0000)]
Downgrade "definition of dllimport static field" error to warning for class templates (PR19902)

This allows us to compile the following kind of code, which occurs in MSVC
headers:

  template <typename> struct S {
    __declspec(dllimport) static int x;
  };
  template <typename T> int S<T>::x;

The definition works similarly to a dllimport inline function definition and
gets available_externally linkage.

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

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

10 years agoAdd __builtin_operator_new and __builtin_operator_delete, which act like calls
Richard Smith [Tue, 3 Jun 2014 23:27:44 +0000 (23:27 +0000)]
Add __builtin_operator_new and __builtin_operator_delete, which act like calls
to the normal non-placement ::operator new and ::operator delete, but allow
optimizations like new-expressions and delete-expressions do.

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

10 years agoUpdate DR page for latest revision of CWG issues list.
Richard Smith [Tue, 3 Jun 2014 21:58:55 +0000 (21:58 +0000)]
Update DR page for latest revision of CWG issues list.

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

10 years agoFix leak from r210059
Alp Toker [Tue, 3 Jun 2014 17:23:34 +0000 (17:23 +0000)]
Fix leak from r210059

Also revert r210096 which temporarily disabled the test while this was being
investigated.

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

10 years agoUse IntrusiveRefCntPtr's == and != nullptr operators.
Rafael Espindola [Tue, 3 Jun 2014 13:27:48 +0000 (13:27 +0000)]
Use IntrusiveRefCntPtr's == and != nullptr operators.

This is a partial revert of r210075.

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

10 years agoclang-format: Refactor indentation behavior for multiple nested blocks.
Daniel Jasper [Tue, 3 Jun 2014 12:02:45 +0000 (12:02 +0000)]
clang-format: Refactor indentation behavior for multiple nested blocks.

This fixes a few oddities when formatting multiple nested JavaScript
blocks, e.g.:

Before:
  promise.then(
      function success() {
        doFoo();
        doBar();
      },
      [], function error() {
        doFoo();
        doBaz();
      });
  promise.then([],
               function success() {
                 doFoo();
                 doBar();
               },
               function error() {
    doFoo();
    doBaz();
  });

After:
  promise.then(
      function success() {
        doFoo();
        doBar();
      },
      [],
      function error() {
        doFoo();
        doBaz();
      });
  promise.then([],
               function success() {
                 doFoo();
                 doBar();
               },
               function error() {
                 doFoo();
                 doBaz();
               });

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

10 years agotemporary disable part of a test because it causes clang to leak memory (want to...
Kostya Serebryany [Tue, 3 Jun 2014 11:45:37 +0000 (11:45 +0000)]
temporary disable part of a test because it causes clang to leak memory (want to have the sanitizer bot green)

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

10 years ago[OPENMP] Loop canonical form analysis (Sema)
Alexander Musman [Tue, 3 Jun 2014 10:16:47 +0000 (10:16 +0000)]
[OPENMP] Loop canonical form analysis (Sema)

This patch implements semantic analysis to make sure that the loop is in OpenMP canonical form.
This is the form required for 'omp simd', 'omp for' and other loop pragmas.

Differential revision: http://reviews.llvm.org/D3778

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

10 years agoRemove incorrect assertion.
Richard Smith [Tue, 3 Jun 2014 08:40:27 +0000 (08:40 +0000)]
Remove incorrect assertion.

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

10 years agoImplement DR990 and DR1070. Aggregate initialization initializes uninitialized
Richard Smith [Tue, 3 Jun 2014 08:26:00 +0000 (08:26 +0000)]
Implement DR990 and DR1070. Aggregate initialization initializes uninitialized
elements from {}, rather than value-initializing them. This permits calling an
initializer-list constructor or constructing a std::initializer_list object.
(It would also permit initializing a const reference or rvalue reference if
that weren't explicitly prohibited by other rules.)

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

10 years agoTeach AST dumper to dump the array filler in an initializer list.
Richard Smith [Tue, 3 Jun 2014 08:24:28 +0000 (08:24 +0000)]
Teach AST dumper to dump the array filler in an initializer list.

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

10 years agoPR11410: Extend diagnostic to cover all cases of aggregate initialization, not
Richard Smith [Tue, 3 Jun 2014 07:28:54 +0000 (07:28 +0000)]
PR11410: Extend diagnostic to cover all cases of aggregate initialization, not
just the extremely specific case of a trailing array element that couldn't be
initialized because the default constructor for the element type is deleted.

Also reword the diagnostic to better match our other context diagnostics and to
prepare for the implementation of core issue 1070.

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

10 years agoList DR532 as implemented on the defect report status page by renaming the namespace.
Nikola Smiljanic [Tue, 3 Jun 2014 07:06:20 +0000 (07:06 +0000)]
List DR532 as implemented on the defect report status page by renaming the namespace.

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

10 years agoWhen emitting a multidimensional array new, emit the initializers for the
Richard Smith [Tue, 3 Jun 2014 06:58:52 +0000 (06:58 +0000)]
When emitting a multidimensional array new, emit the initializers for the
trailing elements as a single loop, rather than sometimes emitting a nest of
several loops. This fixes a bug where CodeGen would sometimes try to emit an
expression with the wrong type for the element being initialized. Plus various
other minor cleanups to the IR produced for array new initialization.

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

10 years agoDon't assume an implicit IntrusiveRefCntPtr -> bool operator.
Rafael Espindola [Tue, 3 Jun 2014 05:04:52 +0000 (05:04 +0000)]
Don't assume an implicit IntrusiveRefCntPtr -> bool operator.

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

10 years agoMove DR532 test where it belongs.
Nikola Smiljanic [Tue, 3 Jun 2014 02:56:59 +0000 (02:56 +0000)]
Move DR532 test where it belongs.

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

10 years agoUpdate for llvm API change.
Rafael Espindola [Tue, 3 Jun 2014 02:42:01 +0000 (02:42 +0000)]
Update for llvm API change.

Aliases in llvm now hold an arbitrary expression.

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

10 years agoFix -emit-codegen-only to not generate binaries
Alp Toker [Tue, 3 Jun 2014 02:14:20 +0000 (02:14 +0000)]
Fix -emit-codegen-only to not generate binaries

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

10 years agoEliminate redundant MangleBuffer class
Alp Toker [Tue, 3 Jun 2014 02:13:57 +0000 (02:13 +0000)]
Eliminate redundant MangleBuffer class

The only remaining user didn't actually use the non-dynamic storage facility
this class provides.

The std::string is transitional and likely to be StringRefized shortly.

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

10 years agoItanium ABI: Update getAddrOfVTable to set the DLL storage class for vtables
Hans Wennborg [Mon, 2 Jun 2014 23:13:03 +0000 (23:13 +0000)]
Itanium ABI: Update getAddrOfVTable to set the DLL storage class for vtables

This corresponds to the same change for the MS ABI in r209908.

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

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

10 years agoallow optional signext attribute
Will Schmidt [Mon, 2 Jun 2014 21:47:14 +0000 (21:47 +0000)]
allow optional signext attribute

Allow the tests to succeed with tne signext (or other) attribute is present.  The attributes
show up for Power, but not for x86*, so need to be appropriately wildcarded.

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

10 years agoDelete apparently unused method
Alexey Samsonov [Mon, 2 Jun 2014 21:05:54 +0000 (21:05 +0000)]
Delete apparently unused method

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

10 years ago[CodeGen] Don't use SizeTy for EmitNeonSplat.
Michael J. Spencer [Mon, 2 Jun 2014 19:48:59 +0000 (19:48 +0000)]
[CodeGen] Don't use SizeTy for EmitNeonSplat.

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

10 years agoRemove unused variable
Alexey Samsonov [Mon, 2 Jun 2014 19:45:14 +0000 (19:45 +0000)]
Remove unused variable

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

10 years agoFix comment vs function name mismatch
Hans Wennborg [Mon, 2 Jun 2014 18:50:54 +0000 (18:50 +0000)]
Fix comment vs function name mismatch

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

10 years agoRemove sanitizer blacklist from ASan/TSan/MSan function passes.
Alexey Samsonov [Mon, 2 Jun 2014 18:08:08 +0000 (18:08 +0000)]
Remove sanitizer blacklist from ASan/TSan/MSan function passes.

Instrumentation passes now use attributes
address_safety/thread_safety/memory_safety which are added by Clang frontend.
Clang parses the blacklist file and adds the attributes accordingly.

Currently blacklist is still used in ASan module pass to disable instrumentation
for certain global variables. We should fix this as well by collecting the
set of globals we're going to instrument in Clang and passing it to ASan
in metadata (as we already do for dynamically-initialized globals and init-order
checking).

This change also removes -tsan-blacklist and -msan-blacklist LLVM commandline
flags in favor of -fsanitize-blacklist= Clang flag.

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

10 years agoCGDebugInfo: Simplify/invert createLexicalBlock parameter construction.
David Blaikie [Mon, 2 Jun 2014 16:32:05 +0000 (16:32 +0000)]
CGDebugInfo: Simplify/invert createLexicalBlock parameter construction.

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

10 years agoThe exception-declaration for a function-try-block cannot redeclare a
Aaron Ballman [Mon, 2 Jun 2014 13:10:07 +0000 (13:10 +0000)]
The exception-declaration for a function-try-block cannot redeclare a
function parameter. One of our existing test cases was XFAILed because
of this. This fixes the issue and un-XFAILs the test.

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

10 years agoclang-format: Fix special case of binary operator detection.
Daniel Jasper [Mon, 2 Jun 2014 11:54:20 +0000 (11:54 +0000)]
clang-format: Fix special case of binary operator detection.

There is a pattern where evaluation order is used as control flow.
This patch special-cases a commonly occuring version of this pattern.

Before:
  Aaaaa *aaa = nullptr;
  // ...
  aaa &&aaa->f();

After:
  Aaaaa *aaa = nullptr;
  // ...
  aaa && aaa->f();

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

10 years agoclang-format: No space between ")" and braced init list.
Daniel Jasper [Mon, 2 Jun 2014 10:57:55 +0000 (10:57 +0000)]
clang-format: No space between ")" and braced init list.

Before:
  auto j = decltype(i) {};

After:
  auto j = decltype(i){};

This fixes llvm.org/PR19892.

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

10 years agoclang-format: Fix Allman brace breaking of enums.
Daniel Jasper [Mon, 2 Jun 2014 10:17:32 +0000 (10:17 +0000)]
clang-format: Fix Allman brace breaking of enums.

Before:
  enum Side
  { LEFT,
    RIGHT };

After:
  enum Side
  {
    LEFT,
    RIGHT
  };

This fixes llvm.org/PR19911.

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

10 years agoclang-format: Fix trailing const (etc.) with Allman brace style.
Daniel Jasper [Mon, 2 Jun 2014 09:52:08 +0000 (09:52 +0000)]
clang-format: Fix trailing const (etc.) with Allman brace style.

Before:
  void someLongFunction(int someLongParameter)
      const
  {
  }

After:
  void someLongFunction(
      int someLongParameter) const
  {
  }

This fixes llvm.org/PR19912.

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

10 years agoRevert "Fix the undefined-but-used odr-use marker (DR48)"
Alp Toker [Sun, 1 Jun 2014 19:13:44 +0000 (19:13 +0000)]
Revert "Fix the undefined-but-used odr-use marker (DR48)"

Wrong patch got committed (this one isn't ready for prime time).

This reverts commit r209996.

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

10 years agoFix the undefined-but-used odr-use marker (DR48)
Alp Toker [Sun, 1 Jun 2014 18:49:32 +0000 (18:49 +0000)]
Fix the undefined-but-used odr-use marker (DR48)

We should treat tentative definitions as undefined for the purpose of
ODR-use linkage checking.

This broke somewhere around r149731 when tests were disabled.

Note that test coverage for these diagnostics is generally lacking due to a
separate issue (PR19910: Don't suppress unused/undefined warnings when there
are errors).

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

10 years agoDon't compare an error_code with nullptr.
Rafael Espindola [Sun, 1 Jun 2014 16:16:02 +0000 (16:16 +0000)]
Don't compare an error_code with nullptr.

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

10 years agoFix PR18498: Support explicit template arguments with variadic generic lambdas
Faisal Vali [Sun, 1 Jun 2014 16:11:54 +0000 (16:11 +0000)]
Fix PR18498: Support explicit template arguments with variadic generic lambdas

http://llvm.org/bugs/show_bug.cgi?id=18498

This code was resulting in a crash:

auto L = [](auto ... v) { };
L.operator()<int>(3);

The reason is that the partially-substituted-pack is incorrectly retained within the current-instantiation-scope during template-argument-finalization, and because lambda's are local, there parent instantiation scopes are merged, which leads to the expansion-pattern being retained in the finalized specialization.

This patch ensures that once we have finalized deduction of a parameter-pack, we remove the partially-substituted-pack so that it doesn't cause CheckParameterPacksForExpansion to incorrectly inform the caller that it needs to retain the expansion pattern.

Thanks to Richard Smith for the review!

http://reviews.llvm.org/D2135

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

10 years agoTest fixes and improvements.
Rafael Espindola [Sun, 1 Jun 2014 13:45:09 +0000 (13:45 +0000)]
Test fixes and improvements.

Remove redundant -fno-stack-protector run with openbsd.
Add -target to the -fstack-protector tests so they pass on openbsd.

Patch by Brad Smith.

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

10 years agoDon't add examples to the check-clang dependencies unless requested
Alp Toker [Sun, 1 Jun 2014 02:02:23 +0000 (02:02 +0000)]
Don't add examples to the check-clang dependencies unless requested

The tests were correctly getting skipped but the targets still mistakenly got
built.

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

10 years agoPreprocessor: make C++ operator names as macro identifiers a compatible extension
Alp Toker [Sat, 31 May 2014 16:32:22 +0000 (16:32 +0000)]
Preprocessor: make C++ operator names as macro identifiers a compatible extension

With recent changes, this is now a compatible language extension and can be
safely enabled with -ms-extensions instead of requiring the full
-ms-compatibility MSVC drop-in mode. As such we can now also emit an extension
warning under -Wmicrosoft to help users port their code.

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

10 years agoFix test on platforms where size_t is not 'unsigned long'.
Benjamin Kramer [Sat, 31 May 2014 15:06:33 +0000 (15:06 +0000)]
Fix test on platforms where size_t is not 'unsigned long'.

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

10 years agoSupport C++11 scoped enums in NamedDecl::isCXXClassMember()
Alp Toker [Sat, 31 May 2014 06:11:09 +0000 (06:11 +0000)]
Support C++11 scoped enums in NamedDecl::isCXXClassMember()

Resolves an old FIXME.

No callers depend on this giving the right answer so I haven't been able to
cook up a useful test case.

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

10 years agoRename utility function templates
Alp Toker [Sat, 31 May 2014 06:11:02 +0000 (06:11 +0000)]
Rename utility function templates

isExternCTemplate() and getLanguageLinkageTemplate() have nothing to do with
templates despite the dubious naming scheme.

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

10 years agoFormat strings: check against an enum's underlying type.
Jordan Rose [Sat, 31 May 2014 04:12:14 +0000 (04:12 +0000)]
Format strings: check against an enum's underlying type.

This allows us to be more careful when dealing with enums whose fixed
underlying type requires special handling in a format string, like
NSInteger.

A refinement of r163266 from a year and a half ago, which added the
special handling for NSInteger and friends in the first place.

<rdar://problem/16616623>

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

10 years agoAST Dump: print the Inherited flag on attributes
Hans Wennborg [Sat, 31 May 2014 04:05:57 +0000 (04:05 +0000)]
AST Dump: print the Inherited flag on attributes

Also move the attribute-specific dumping to after dumping this and
the Implicit flag.

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

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

10 years agoPreprocessor: recover gracefully when C++ operator names are used as macro identifiers
Alp Toker [Sat, 31 May 2014 03:38:17 +0000 (03:38 +0000)]
Preprocessor: recover gracefully when C++ operator names are used as macro identifiers

This failure mode shows up occasionally when users try to include C headers in
C++ projects or when porting from Windows. We might as well recover in the way
the user expected, thus avoiding confusing diagnostic messages at point of use.

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

10 years agoPreprocessor: don't exit early in CheckMacroName()
Alp Toker [Sat, 31 May 2014 03:38:08 +0000 (03:38 +0000)]
Preprocessor: don't exit early in CheckMacroName()

The checks below can hypothetically apply to converted operator name
identifiers.

In practice there are no builtin macros etc. with those names so there's no
behavioural change to test.

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

10 years agoThere is no std::errc:success, remove the llvm one.
Rafael Espindola [Sat, 31 May 2014 03:20:52 +0000 (03:20 +0000)]
There is no std::errc:success, remove the llvm one.

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

10 years agoUse make_error_code in preparation for making errc an enum class.
Rafael Espindola [Sat, 31 May 2014 02:23:01 +0000 (02:23 +0000)]
Use make_error_code in preparation for making errc an enum class.

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

10 years agoPR12961 - Extend DR532 to cover C++98/03.
Nikola Smiljanic [Sat, 31 May 2014 02:10:59 +0000 (02:10 +0000)]
PR12961 - Extend DR532 to cover C++98/03.

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

10 years agoDiagnose dll attribute on member of class that already has a dll attribute
Hans Wennborg [Sat, 31 May 2014 02:08:49 +0000 (02:08 +0000)]
Diagnose dll attribute on member of class that already has a dll attribute

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

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

10 years agoMake Attr::Clone() also clone the Inherited, IsPackExpansion and Implicit flags
Hans Wennborg [Sat, 31 May 2014 01:30:30 +0000 (01:30 +0000)]
Make Attr::Clone() also clone the Inherited, IsPackExpansion and Implicit flags

I was bitten by this when working with the dll attributes: when a dll
attribute was cloned from a class template declaration to its
specialization, the Inherited flag didn't get cloned.

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

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

10 years agoUse error_code() instead of error_code::succes()
Rafael Espindola [Sat, 31 May 2014 01:26:30 +0000 (01:26 +0000)]
Use error_code() instead of error_code::succes()

There is no std::error_code::success, so this removes much of the noise
in transitioning to std::error_code.

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

10 years ago[CodeGen] Don't cast and use SizeTy instead of Int32Ty when constructing {extract...
Michael J. Spencer [Sat, 31 May 2014 00:22:12 +0000 (00:22 +0000)]
[CodeGen] Don't cast and use SizeTy instead of Int32Ty when constructing {extract,insert} vector element instructions.

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

10 years agoRefactor: use the DeclarationNameInfo form of BuildMemberReferenceExpr
Richard Smith [Sat, 31 May 2014 00:18:32 +0000 (00:18 +0000)]
Refactor: use the DeclarationNameInfo form of BuildMemberReferenceExpr
consistently, rather than sometimes performing lookup and calling the
LookupResult form. No functionality change intended.

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

10 years agocc1as: invert return bool to indicate failure
Alp Toker [Sat, 31 May 2014 00:02:27 +0000 (00:02 +0000)]
cc1as: invert return bool to indicate failure

This simplifies code flow and matches the convention used in surrounding code.

No functional change.

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

10 years agocc1as: fix a potential leak and unremoved output file in error conditions
Alp Toker [Sat, 31 May 2014 00:02:21 +0000 (00:02 +0000)]
cc1as: fix a potential leak and unremoved output file in error conditions

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

10 years agoTake PrintingPolicy::SuppressUnwrittenScope into account when printing the
Richard Smith [Fri, 30 May 2014 22:16:51 +0000 (22:16 +0000)]
Take PrintingPolicy::SuppressUnwrittenScope into account when printing the
qualified name of a NamedDecl. Patch by Volodymyr Sapsai!

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

10 years agoInvalidate the file system cache entries for files that may rebuild
Ben Langmuir [Fri, 30 May 2014 21:20:54 +0000 (21:20 +0000)]
Invalidate the file system cache entries for files that may rebuild

This reapplies r209910 with a fix for the assertion failures hit on the
buildbots.

original commit message:
I thought we could get away without this, but it means that the
FileEntry objects actually refer to the wrong files, since pcms are not
updated inplace, they are atomically renamed into place after compiling
a module.

So we are close to the original behaviour of invalidating the cache for
all modules being removed, but now we should only invalidate the ones
that depend on whichever module failed to load.

Unfortunately I haven't come up with a new test that didn't require
a race between parallel invocations of clang.

<rdar://problem/17038180>

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

10 years agoRemove unused struct from test
Alp Toker [Fri, 30 May 2014 21:07:40 +0000 (21:07 +0000)]
Remove unused struct from test

This presumably got inadvertently copied from dllimport-members.cpp.

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

10 years agoAdd a FIXME for a bug Doug pointed out in code review.
Richard Smith [Fri, 30 May 2014 19:44:17 +0000 (19:44 +0000)]
Add a FIXME for a bug Doug pointed out in code review.

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

10 years agoThread Safety Analysis: fix handling of string and char literals.
DeLesley Hutchins [Fri, 30 May 2014 18:20:04 +0000 (18:20 +0000)]
Thread Safety Analysis: fix handling of string and char literals.

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

10 years agoRevert "Invalidate the file system cache entries for files that may rebuild"
Ben Langmuir [Fri, 30 May 2014 17:54:59 +0000 (17:54 +0000)]
Revert "Invalidate the file system cache entries for files that may rebuild"

This reverts commit r209910, which is breaking some of the bots.

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

10 years agoInvalidate the file system cache entries for files that may rebuild
Ben Langmuir [Fri, 30 May 2014 17:42:15 +0000 (17:42 +0000)]
Invalidate the file system cache entries for files that may rebuild

I thought we could get away without this, but it means that the
FileEntry objects actually refer to the wrong files, since pcms are not
updated inplace, they are atomically renamed into place after compiling
a module.

So we are close to the original behaviour of invalidating the cache for
all modules being removed, but now we should only invalidate the ones
that depend on whichever module failed to load.

Unfortunately I haven't come up with a new test that didn't require
a race between parallel invocations of clang.

<rdar://problem/17038180>

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

10 years agoStart adding support for dllimport/dllexport on classes (PR11170)
Hans Wennborg [Fri, 30 May 2014 16:59:42 +0000 (16:59 +0000)]
Start adding support for dllimport/dllexport on classes (PR11170)

This implements the central part of support for dllimport/dllexport on
classes: allowing the attribute on class declarations, inheriting it
to class members, and forcing emission of exported members. It's based
on Nico Rieck's patch from http://reviews.llvm.org/D1099.

This patch doesn't propagate dllexport to bases that are template
specializations, which is an interesting problem. It also doesn't
look at the rules when redeclaring classes with different attributes,
I'd like to do that separately.

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

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

10 years agoObjective-C. Diagnose assigning a block pointer type to
Fariborz Jahanian [Fri, 30 May 2014 16:35:53 +0000 (16:35 +0000)]
Objective-C. Diagnose assigning a block pointer type to
an Objective-C object type other than 'id'.
// rdar://16739120

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

10 years agoThread Safety Analysis: fix uninitialized member in TIL Literal.
DeLesley Hutchins [Fri, 30 May 2014 15:55:25 +0000 (15:55 +0000)]
Thread Safety Analysis: fix uninitialized member in TIL Literal.

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

10 years agoAArch64: combine arm64 & aarch64 cases in switch
Tim Northover [Fri, 30 May 2014 14:14:07 +0000 (14:14 +0000)]
AArch64: combine arm64 & aarch64 cases in switch

There shouldn't be any difference in behaviour here, at least not in
any configurations people care about and possibly not in any reachable
configurations.

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

10 years agoRemove unnecessary test.
Diego Novillo [Fri, 30 May 2014 13:19:28 +0000 (13:19 +0000)]
Remove unnecessary test.

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

10 years agoThis test is no longer relevant. It is covered already by [basic.scope.pdecl]p10...
Aaron Ballman [Fri, 30 May 2014 13:17:17 +0000 (13:17 +0000)]
This test is no longer relevant. It is covered already by [basic.scope.pdecl]p10, and our current test for that is more thorough (though our test is named p9.cpp).

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

10 years agoThis test should no longer be XFAILed; the standard has stabilized, and the test...
Aaron Ballman [Fri, 30 May 2014 13:09:38 +0000 (13:09 +0000)]
This test should no longer be XFAILed; the standard has stabilized, and the test contents are acceptable. No diagnostics expected from this test.

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

10 years agoSetting a heading for the section/allocate attribute so that the attribute documentat...
Aaron Ballman [Fri, 30 May 2014 12:57:13 +0000 (12:57 +0000)]
Setting a heading for the section/allocate attribute so that the attribute documentation can be properly generated.

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

10 years agoclang/test/Frontend/Weverything-and-remarks.cpp: Add explicit -target.
NAKAMURA Takumi [Fri, 30 May 2014 07:03:16 +0000 (07:03 +0000)]
clang/test/Frontend/Weverything-and-remarks.cpp: Add explicit -target.

You could see unexpected result (*.tmp.err) with "-target x86_64-win32".

  Weverything-and-remarks.cpp:11:9: warning: 'char32_t' type specifier is incompatible with C++98 [-Wc++98-compat]
  typedef __char32_t char32_t;
          ^
  Weverything-and-remarks.cpp:12:27: error: typedef redefinition with different types ('unsigned long' vs 'unsigned long long')
  typedef long unsigned int size_t;
                            ^
  Weverything-and-remarks.cpp:19:62: warning: dynamic exception specifications are deprecated [-Wdeprecated]
    static void assign(char_type& __c1, const char_type& __c2) throw() {
                                                               ^~~~~~~
  Weverything-and-remarks.cpp:19:62: note: use 'noexcept' instead
    static void assign(char_type& __c1, const char_type& __c2) throw() {
                                                               ^~~~~~~
                                                               noexcept
  Weverything-and-remarks.cpp:25:46: warning: unused parameter '__n' [-Wunused-parameter]
                                        size_t __n) {
                                               ^
  3 warnings and 1 error generated.

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

10 years ago[OPENMP] Improve debug location codegen for OpenMP runtime library.
Alexey Bataev [Fri, 30 May 2014 05:48:40 +0000 (05:48 +0000)]
[OPENMP] Improve debug location codegen for OpenMP runtime library.

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

10 years agoFix 'this' capturing Generic lambdas used within default initializers (PR19876)
Faisal Vali [Fri, 30 May 2014 04:39:37 +0000 (04:39 +0000)]
Fix 'this' capturing Generic lambdas used within default initializers (PR19876)

http://llvm.org/bugs/show_bug.cgi?id=19876

The following C++1y code results in a crash:

struct X {
  int m = 10;
  int n = [this](auto) { return m; }(20);
};

When implicitly instantiating the generic lambda's call operator specialization body, Sema is unable to determine the current 'this' type when transforming the MemberExpr 'm' - since it looks for the nearest enclosing FunctionDeclDC - which is obviously null.

I considered two ways to fix this:

    1) In InstantiateFunctionDefinition, when the context is saved after the lambda scope info is created, retain the 'this' pointer.
    2) Teach getCurrentThisType() to recognize it is within a generic lambda within an NSDMI/default-initializer and return the appropriate this type.

I chose to implement #2 (though I confess I do not have a compelling reason for choosing it over #1).

Richard Smith accepted the patch:
http://reviews.llvm.org/D3935

Thank you!

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

10 years agoPR11410 - Confusing diagnostic when trailing array element tries to call deleted...
Nikola Smiljanic [Fri, 30 May 2014 01:28:28 +0000 (01:28 +0000)]
PR11410 - Confusing diagnostic when trailing array element tries to call deleted default constructor

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