]> granicus.if.org Git - clang/log
clang
9 years agoclang-format: Improve indentation of comments in expressions.
Daniel Jasper [Fri, 14 Nov 2014 12:31:14 +0000 (12:31 +0000)]
clang-format: Improve indentation of comments in expressions.

Before:
  int i = (a)
              // comment
          + b;
  return aaaa == bbbb
                 // comment
             ? aaaa
             : bbbb;
After:
  int i = (a)
          // comment
          + b;
  return aaaa == bbbb
             // comment
             ? aaaa
             : bbbb;

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

9 years ago[PowerPC] Add VSX builtins for vec_div
Bill Schmidt [Fri, 14 Nov 2014 12:10:51 +0000 (12:10 +0000)]
[PowerPC] Add VSX builtins for vec_div

This patch adds builtin support for xvdivdp and xvdivsp, along with a
new test case.  The builtins are accessed using vec_div in altivec.h.
Builtins are listed (mostly) alphabetically there, so inserting these
changed the line numbers for deprecation warnings tested in
test/Headers/altivec-intrin.c.

There is a companion patch for LLVM.

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

9 years agoclang-format: [Java] Fix line break behavior of class declarations.
Daniel Jasper [Fri, 14 Nov 2014 10:15:56 +0000 (10:15 +0000)]
clang-format: [Java] Fix line break behavior of class declarations.

Change breaking preferences:
1. Break before "extends"
2. Break before "implements"
3. Break within the implements list.

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

9 years agoclang-format: [Java] Improve generic return type formatting.
Daniel Jasper [Fri, 14 Nov 2014 09:05:32 +0000 (09:05 +0000)]
clang-format: [Java] Improve generic return type formatting.

Before:
  public<R> ArrayList<R> get() {

After:
  public <R> ArrayList<R> get() {

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

9 years agoclang-format: [Java] No altnerative operator names in Java.
Daniel Jasper [Fri, 14 Nov 2014 09:02:28 +0000 (09:02 +0000)]
clang-format: [Java] No altnerative operator names in Java.

Before:
  someObject.and ();

After:
  someObject.and();

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

9 years agoclang-format: [Java] Improve formatting of generics.
Daniel Jasper [Fri, 14 Nov 2014 08:22:46 +0000 (08:22 +0000)]
clang-format: [Java] Improve formatting of generics.

Before:
  Function < F, ? extends T > function;

After:
  Function<F, ? extends T> function;

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

9 years ago[OPENMP] Temporary fix for processing of global variables in loops.
Alexey Bataev [Fri, 14 Nov 2014 04:08:45 +0000 (04:08 +0000)]
[OPENMP] Temporary fix for processing of global variables in loops.
Currently there is a bug in processing of global variables used as loop control variables in 'omp for/simd' constructs: these globals must be captured as private variables, but currently they are nor. This is a temporary bug fix for this problem until the correct solution is prepared. If a global var used as lcv without explicit mark as a private/linear/lastprivate the error message is emitted.

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

9 years ago[Sanitizer] Refactor SanitizerArgs parsing in Driver.
Alexey Samsonov [Fri, 14 Nov 2014 02:59:20 +0000 (02:59 +0000)]
[Sanitizer] Refactor SanitizerArgs parsing in Driver.

Remove flag parsing details from the public header.
Use SanitizerSet to represent the set of enabled sanitizers.
Cleanup the implementation: update the comments to
reflect reality, remove dead code.

No functionality change.

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

9 years agoRemove -fseh-exceptions in favor of checking the triple
Reid Kleckner [Fri, 14 Nov 2014 02:01:10 +0000 (02:01 +0000)]
Remove -fseh-exceptions in favor of checking the triple

This option was misleading because it looked like it enabled the
language feature of SEH (__try / __except), when this option was really
controlling which EH personality function to use. Mingw only supports
SEH and SjLj EH on x86_64, so we can simply do away with this flag.

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

9 years agoCleanup SanitizerArgs: get rid of unused variable, make one method non-static. NFC.
Alexey Samsonov [Fri, 14 Nov 2014 00:46:39 +0000 (00:46 +0000)]
Cleanup SanitizerArgs: get rid of unused variable, make one method non-static. NFC.

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

9 years agoPR21565 Add an egregious hack to support broken libstdc++ headers that declare
Richard Smith [Fri, 14 Nov 2014 00:37:55 +0000 (00:37 +0000)]
PR21565 Add an egregious hack to support broken libstdc++ headers that declare
a member named 'swap' and then expect unqualified lookup for the name 'swap' in
its exception specification to find anything else.

Without delay-parsed exception specifications, this was ill-formed (NDR) by
[basic.scope.class]p1, rule 2. With delay-parsed exception specifications, the
call to 'swap' unambiguously finds the function being declared, which then
fails because the arguments don't work for that function.

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

9 years ago[Profile] Always build profile runtime library with -fPIC.
Alexey Samsonov [Fri, 14 Nov 2014 00:16:26 +0000 (00:16 +0000)]
[Profile] Always build profile runtime library with -fPIC.

This change removes libclang_rt.profile-pic-<arch>.a version of
profile runtime. Instead, it's sufficient to always build
libclang_rt.profile-<arch>.a with -fPIC, as it can be linked into
both executables and shared objects.

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

9 years ago-Wsentinel: Suggest nullptr in C++11 instead of NULL
Reid Kleckner [Thu, 13 Nov 2014 23:19:36 +0000 (23:19 +0000)]
-Wsentinel: Suggest nullptr in C++11 instead of NULL

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

9 years agoFix assert/crash on invalid with __builtin_constant_p conditionals in constant expres...
Richard Smith [Thu, 13 Nov 2014 23:03:19 +0000 (23:03 +0000)]
Fix assert/crash on invalid with __builtin_constant_p conditionals in constant expressions.

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

9 years agoObjective-C. Fixes a regression caused by implementation
Fariborz Jahanian [Thu, 13 Nov 2014 22:27:05 +0000 (22:27 +0000)]
Objective-C. Fixes a regression caused by implementation
of new warning for deprecated method call for receiver
of type 'id'. This addresses rdar://18960378 where
unintended warnings being issued.

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

9 years agoPR21437, final part of DR1330: delay-parsing of exception-specifications. This
Richard Smith [Thu, 13 Nov 2014 20:01:57 +0000 (20:01 +0000)]
PR21437, final part of DR1330: delay-parsing of exception-specifications. This
is a re-commit of Doug's r154844 (modernized and updated to fit into current
Clang).

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

9 years agoRemove -Wcast-qual as it's inherited from llvm since r221913.
Roman Divacky [Thu, 13 Nov 2014 19:47:31 +0000 (19:47 +0000)]
Remove -Wcast-qual as it's inherited from llvm since r221913.

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

9 years agoHook up FreeBSD AArch64 support
Ed Maste [Thu, 13 Nov 2014 16:55:42 +0000 (16:55 +0000)]
Hook up FreeBSD AArch64 support

Patch from Andrew Turner.

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

9 years agoclang-format: Format extern "C" blocks like namespace blocks.
Nico Weber [Thu, 13 Nov 2014 16:25:37 +0000 (16:25 +0000)]
clang-format: Format extern "C" blocks like namespace blocks.

namespace blocks act as if KeepEmptyLinesAtTheStartOfBlocks is always true,
and aren't collapsed to a single line even if they would fit. Do the same
for extern "C" blocks.

Before,

  extern "C" {

  void ExternCFunction();

  }

was collapsed into `extern "C" { void ExternCFunction(); }`. Now it stays like
it was.

Fixes http://crbug.com/432640 and part of PR21419.

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

9 years agoclang-format: [Java] Support Java enums.
Daniel Jasper [Thu, 13 Nov 2014 15:56:28 +0000 (15:56 +0000)]
clang-format: [Java] Support Java enums.

In Java, enums can contain a class body and enum constants can have
arguments as well as class bodies. Support most of that.

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

9 years agoSupport non-owned DiagnosticConsumer in SetupSerializedDiagnostics
Alexander Kornienko [Thu, 13 Nov 2014 13:08:27 +0000 (13:08 +0000)]
Support non-owned DiagnosticConsumer in SetupSerializedDiagnostics

This fixes an assertion when running clang-tidy on a file having
--serialize-diagnostics in compiler options. Committing a regression test
for clang-tidy separately.

Patch by Aaron Wishnick!

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

9 years ago[libclang] Make sure to visit the body of a CXXForRangeStmt.
Argyrios Kyrtzidis [Thu, 13 Nov 2014 09:50:19 +0000 (09:50 +0000)]
[libclang] Make sure to visit the body of a CXXForRangeStmt.

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

9 years ago[liblang] Handle CXXForRangeStmt during AST visitation.
Argyrios Kyrtzidis [Thu, 13 Nov 2014 09:03:21 +0000 (09:03 +0000)]
[liblang] Handle CXXForRangeStmt during AST visitation.

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

9 years agoCMake: Set HOST_LINK_VERSION on Darwin (PR21268)
Hans Wennborg [Thu, 13 Nov 2014 00:35:23 +0000 (00:35 +0000)]
CMake: Set HOST_LINK_VERSION on Darwin (PR21268)

The Autoconf build already does this, but it was never ported to
CMake. The host linker version affects the flags that Clang pass
to the linker, notably whether it passes -demangle or not.

http://reviews.llvm.org/D6239

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

9 years agoFixes test.
Fariborz Jahanian [Thu, 13 Nov 2014 00:19:30 +0000 (00:19 +0000)]
Fixes test.

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

9 years agoAnother test for PR19372, showing why we need to keep checking arguments after a...
Richard Smith [Wed, 12 Nov 2014 23:50:13 +0000 (23:50 +0000)]
Another test for PR19372, showing why we need to keep checking arguments after a pack expansion.

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

9 years agoAdd another testcase.
Richard Smith [Wed, 12 Nov 2014 23:43:08 +0000 (23:43 +0000)]
Add another testcase.

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

9 years agoPR19372: Keep checking template arguments after we see an argument pack
Richard Smith [Wed, 12 Nov 2014 23:38:38 +0000 (23:38 +0000)]
PR19372: Keep checking template arguments after we see an argument pack
expansion into a parameter pack; we know that we're still filling in that
parameter's arguments. Previously, if we hit this case for an alias template,
we'd try to substitute using non-canonical template arguments.

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

9 years agoTemporary revert r221818 until all the problems
Anton Korobeynikov [Wed, 12 Nov 2014 23:15:38 +0000 (23:15 +0000)]
Temporary revert r221818 until all the problems
with objc stuff will be resolved.

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

9 years agoNow really fix the typo in the test
Anton Korobeynikov [Wed, 12 Nov 2014 22:58:08 +0000 (22:58 +0000)]
Now really fix the typo in the test

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

9 years agoUpdate the tests to handle proper result type of (?:)
Anton Korobeynikov [Wed, 12 Nov 2014 22:48:38 +0000 (22:48 +0000)]
Update the tests to handle proper result type of (?:)

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

9 years ago[Objective-C++ IRGen] do not generate .cxx_construct
Fariborz Jahanian [Wed, 12 Nov 2014 22:37:43 +0000 (22:37 +0000)]
[Objective-C++ IRGen] do not generate .cxx_construct
for class that contains trivially-constructible struct ivar.
rdar://18950072

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

9 years agoFix fallout from r219557
Anton Korobeynikov [Wed, 12 Nov 2014 22:19:06 +0000 (22:19 +0000)]
Fix fallout from r219557

Summary:
Consider the following nifty 1 liner: (0 ? csqrtl(2.0f) : sqrtl(2.0f)). One can easily obtain such code from e.g. tgmath. Right now it produces an assertion because we fail to do the promotion real => _Complex real.

The case was properly handled previously (old handleOtherComplexFloatConversion routine), but was forgotten in the current version. This seems to be about fallout from r219557

Reviewers: chandlerc, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

9 years agoFix brace init of unions with unnamed struct members
Reid Kleckner [Wed, 12 Nov 2014 21:30:23 +0000 (21:30 +0000)]
Fix brace init of unions with unnamed struct members

The check for unnamed members was intended to skip unnamed bitfields,
but it ended up skipping unnamed structs. This lead to an assertion in
IRGen.

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

9 years agoUpdate Clang's SD-6 support to match N4200 (except for __has_cpp_attribute,
Richard Smith [Wed, 12 Nov 2014 21:16:38 +0000 (21:16 +0000)]
Update Clang's SD-6 support to match N4200 (except for __has_cpp_attribute,
which we don't yet implement).

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

9 years agoPass the filter function_ref by value now that r221753 fixes the bug
Kaelyn Takata [Wed, 12 Nov 2014 18:34:08 +0000 (18:34 +0000)]
Pass the filter function_ref by value now that r221753 fixes the bug
that was preventing pass-by-value from working correctly.

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

9 years agoCheck for IRGen output when varag is used
Fariborz Jahanian [Wed, 12 Nov 2014 17:54:11 +0000 (17:54 +0000)]
Check for IRGen output when varag is used
in -funknown-anytype  mode (in lldb use).

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

9 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 12 Nov 2014 14:48:44 +0000 (14:48 +0000)]
Update for llvm api change.

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

9 years agoSimplify code a bit by passing StreamFile to the BitstreamCursor constructor.
Rafael Espindola [Wed, 12 Nov 2014 14:42:25 +0000 (14:42 +0000)]
Simplify code a bit by passing StreamFile to the BitstreamCursor constructor.

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

9 years agoMark TypeDecls used in explicit destructor calls as referenced.
Nico Weber [Wed, 12 Nov 2014 04:33:52 +0000 (04:33 +0000)]
Mark TypeDecls used in explicit destructor calls as referenced.

Fixes PR21221. Patch by Axel Naumann, test by me.

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

9 years ago[PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsics
Bill Schmidt [Wed, 12 Nov 2014 04:19:56 +0000 (04:19 +0000)]
[PowerPC] Add vec_vsx_ld and vec_vsx_st intrinsics

This patch enables the vec_vsx_ld and vec_vsx_st intrinsics for
PowerPC, which provide programmer access to the lxvd2x, lxvw4x,
stxvd2x, and stxvw4x instructions.

New code in altivec.h defines these in terms of new builtins, which
are themselves defined in BuiltinsPPC.def.  The builtins are converted
to LLVM intrinsics in CGBuiltin.cpp.  Additional code is added to
builtins-ppc-vsx.c to verify the correct generation of the intrinsics.

Note that I moved the other VSX builtins so all VSX builtins will be
alphabetical in their own section in BuiltinsPPC.def.

There is a companion patch for LLVM.

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

9 years agoMark TypeDecls used in member initializers as referenced.
Nico Weber [Wed, 12 Nov 2014 03:52:25 +0000 (03:52 +0000)]
Mark TypeDecls used in member initializers as referenced.

Without this, -Wunused-local-typedef would incorrectly warn on the two typedefs
in this program:

void foo() {
  struct A {};
  struct B : public A {
    typedef A INHERITED;
    B() : INHERITED() {}

    typedef B SELF;
    B(int) : SELF() {}
  };
}

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

9 years agoclang-format a few lines, fixes one 80col violation. nfc.
Nico Weber [Wed, 12 Nov 2014 03:44:43 +0000 (03:44 +0000)]
clang-format a few lines, fixes one 80col violation. nfc.

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

9 years agoTry a different workaround for GCC 4.7.2 lambda capture bug. The previous
Richard Smith [Wed, 12 Nov 2014 02:09:03 +0000 (02:09 +0000)]
Try a different workaround for GCC 4.7.2 lambda capture bug. The previous
workaround took us from wrong-code to ICE.

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

9 years agoInstantiate exception specifications when instantiating function types (other
Richard Smith [Wed, 12 Nov 2014 02:00:47 +0000 (02:00 +0000)]
Instantiate exception specifications when instantiating function types (other
than the type of a function declaration). We previously didn't instantiate
these at all! This also covers the pathological case where the only mention of
a parameter pack is within the exception specification; this gives us a second
way (other than alias templates) to reach the horrible state where a type
contains an unexpanded pack, but its canonical type does not.

This is a re-commit of r219977:

r219977 was reverted in r220038 because it hit a wrong-code bug in GCC 4.7.2.
(That's gcc.gnu.org/PR56135, and affects any implicit lambda-capture of
'this' within a template.)

r219977 was a re-commit of r217995, r218011, and r218053:

r217995 was reverted in r218058 because it hit a rejects-valid bug in MSVC.
(Incorrect overload resolution in the presence of using-declarations.)
It was re-committed in r219977 with a workaround for the MSVC rejects-valid.

r218011 was a workaround for an MSVC parser bug. (Incorrect desugaring of
unbraced range-based for loop).

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

9 years agoPR21536: Fix a corner case where we'd get confused by a pack expanding into the
Richard Smith [Wed, 12 Nov 2014 01:43:45 +0000 (01:43 +0000)]
PR21536: Fix a corner case where we'd get confused by a pack expanding into the
penultimate parameter of a template parameter list, where the last parameter is
itself a pack, and build a bogus empty final pack argument.

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

9 years agoFix this code to follow the coding style regarding anonymous namespaces and
Richard Smith [Wed, 12 Nov 2014 01:24:00 +0000 (01:24 +0000)]
Fix this code to follow the coding style regarding anonymous namespaces and
static functions. Make a bunch of file-local functions static. Remove one
unused static function revealed by this.

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

9 years agoMake Sema::CollectMultipleMethodsInGlobalPool() public.
Douglas Gregor [Wed, 12 Nov 2014 01:12:47 +0000 (01:12 +0000)]
Make Sema::CollectMultipleMethodsInGlobalPool() public.

It's useful for out-of-tree clients to be able to query the global
Objective-C method pool, and only Sema can do that right now.

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

9 years agoclang/test/CodeGenCXX/debug-info-cxx1y.cpp: Add %itanium_abi_triple for incompatible...
NAKAMURA Takumi [Tue, 11 Nov 2014 23:51:53 +0000 (23:51 +0000)]
clang/test/CodeGenCXX/debug-info-cxx1y.cpp: Add %itanium_abi_triple for incompatible MS targets.

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

9 years ago[clang/asan] Do not emit memcpy for trivial operator= when -fsanitize-address-field...
Kostya Serebryany [Tue, 11 Nov 2014 23:38:13 +0000 (23:38 +0000)]
[clang/asan] Do not emit memcpy for trivial operator= when -fsanitize-address-field-padding >= 1

Summary: If we've added poisoned paddings to a type do not emit memcpy for operator=.

Test Plan: regression tests.

Reviewers: majnemer, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

9 years agoHave LookupMemberExprInRecord only call CorrectTypoDelayed, dropping the
Kaelyn Takata [Tue, 11 Nov 2014 23:26:58 +0000 (23:26 +0000)]
Have LookupMemberExprInRecord only call CorrectTypoDelayed, dropping the
code for calling CorrectTypo.

Includes a needed fix for non-C++ code to not choke on TypoExprs (which
also resolves a TODO from r220698).

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

9 years agoCreate two helpers for running the typo-correction tree transform.
Kaelyn Takata [Tue, 11 Nov 2014 23:26:56 +0000 (23:26 +0000)]
Create two helpers for running the typo-correction tree transform.

One takes an Expr* and the other is a simple wrapper that takes an
ExprResult instead, and handles checking whether the ExprResult is
invalid.

Additionally, allow an optional callback that is run on the full result
of the tree transform, for filtering potential corrections based on the
characteristics of the resulting expression once all of the typos have
been replaced.

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

9 years agoReplace MemberTypoDiags and MemberExprTypoRecovery with lambdas.
Kaelyn Takata [Tue, 11 Nov 2014 23:26:54 +0000 (23:26 +0000)]
Replace MemberTypoDiags and MemberExprTypoRecovery with lambdas.

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

9 years agoRemove unnecessary semicolon.
Kaelyn Takata [Tue, 11 Nov 2014 23:17:30 +0000 (23:17 +0000)]
Remove unnecessary semicolon.

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

9 years agoclang-format: Improve handling of comments in binary expressions.
Daniel Jasper [Tue, 11 Nov 2014 23:04:51 +0000 (23:04 +0000)]
clang-format: Improve handling of comments in binary expressions.

Before:
  b = a &&
      // Comment
      b.c &&
      d;

After:
  b = a &&
      // Comment
      b.c && d;

This fixes llvm.org/PR21535.

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

9 years agoMake LookupResult be copyable to avoid decomposing an existing one and
Kaelyn Takata [Tue, 11 Nov 2014 23:00:42 +0000 (23:00 +0000)]
Make LookupResult be copyable to avoid decomposing an existing one and
initializing a new one every time a copy is needed.

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

9 years agoExplicitly exclude keywords from the member validator.
Kaelyn Takata [Tue, 11 Nov 2014 23:00:40 +0000 (23:00 +0000)]
Explicitly exclude keywords from the member validator.

Also simply and remove dead code from MemberExprTypoRecovery.

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

9 years agoFix some formatting prior to refactoring the code.
Kaelyn Takata [Tue, 11 Nov 2014 23:00:38 +0000 (23:00 +0000)]
Fix some formatting prior to refactoring the code.

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

9 years agoIntroduce -fsanitize-coverage=N flag
Kostya Serebryany [Tue, 11 Nov 2014 22:15:07 +0000 (22:15 +0000)]
Introduce -fsanitize-coverage=N flag

Summary:
This change makes the asan-coverge (formerly -mllvm -asan-coverge)
accessible via a clang flag.
Companion patch to LLVM is http://reviews.llvm.org/D6152

Test Plan: regression tests, chromium

Reviewers: samsonov

Reviewed By: samsonov

Subscribers: cfe-commits

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

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

9 years agoBundle conditions checked by UBSan with sanitizer kinds they implement.
Alexey Samsonov [Tue, 11 Nov 2014 22:03:54 +0000 (22:03 +0000)]
Bundle conditions checked by UBSan with sanitizer kinds they implement.

Summary:
This change makes CodeGenFunction::EmitCheck() take several
conditions that needs to be checked (all of them need to be true),
together with sanitizer kinds these checks are for. This would allow
to split one call into UBSan runtime into several calls in case
different sanitizer kinds would have different recoverability
settings.

Tests should be fixed accordingly, I'm working on it.

Test Plan: regression test suite.

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

9 years agoRemove this test too.
Fariborz Jahanian [Tue, 11 Nov 2014 21:54:53 +0000 (21:54 +0000)]
Remove this test too.

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

9 years agoRevert r221702 until I address Richard Trieu's
Fariborz Jahanian [Tue, 11 Nov 2014 21:54:19 +0000 (21:54 +0000)]
Revert r221702 until I address Richard Trieu's
comments.

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

9 years agoSimplify the test by using multiple --check-prefix arguments
Alexey Samsonov [Tue, 11 Nov 2014 21:50:44 +0000 (21:50 +0000)]
Simplify the test by using multiple --check-prefix arguments

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

9 years agoRevert "IR: MDNode => Value: Update for LLVM API change in r221375"
Duncan P. N. Exon Smith [Tue, 11 Nov 2014 21:31:03 +0000 (21:31 +0000)]
Revert "IR: MDNode => Value: Update for LLVM API change in r221375"

This reverts commit r221376.

The API change was reverted in r221711.

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

9 years agoPR16091 continued: Debug Info for member functions with undeduced return types.
David Blaikie [Tue, 11 Nov 2014 20:44:45 +0000 (20:44 +0000)]
PR16091 continued: Debug Info for member functions with undeduced return types.

So DWARF5 specs out auto deduced return types as DW_TAG_unspecified_type
with DW_AT_name "auto", and GCC implements this somewhat, but it
presents a few problems to do this with Clang.

GCC's implementation only applies to member functions where the auto
return type isn't deduced immediately (ie: member functions of templates
or member functions defined out of line). In the common case of an
inline deduced return type function, GCC emits the DW_AT_type as the
deduced return type.

Currently GDB doesn't seem to behave too well with this debug info - it
treats the return type as 'void', even though the definition of the
function has the correctly deduced return type (I guess it sees the
return type the declaration has, doesn't understand it, and assumes
void). This means the function's ABI might be broken (non-trivial return
types, etc), etc.

Clang, on the other hand doesn't track this particular case of a
deducable return type that is deduced immediately versus one that is
deduced 'later'. So if we implement the DWARF5 representation, all
deducible return type functions would get adverse GDB behavior
(including deduced return type lambda functions, inline deduced return
type functions, etc).

Also, we can't just do this for auto types that are not deduced -
because Clang marks even the declaration's return type as deduced (&
provides the underlying type) once a definition is seen that allows the
deduction. So we have to ignore even deduced types - but we can't do
that for auto variables (because this representation only applies to
function declarations - variables and function definitions need the real
type so the function can be called, etc) so we'd need to add an extra
flag to the type unwrapping/creation code to indicate when we want to
see through deduced types and when we don't. It's also not as simple as
just checking at the top level when building a function type (for one
thing, we reuse the function type building for building function pointer
types which might also have 'auto' in them - but be the type of a
variable instead) because the auto might be arbitrarily deeply nested
("auto &", "auto (*)()", etc...)

So, with all that said, let's do the simple thing that works in existing
debuggers for now and treat these functions the same way we do function
templates and implicit special members: omit them from the member list,
since they can't be correctly called anyway (without knowing the return
type the ABI isn't know and a function call could put the arguments in
the wrong place) so they're not much use to the user.

At some point in the future, when GDB understands the DWARF5
representation better it might be worth plumbing through the extra type
builder handling to avoid looking through AutoType for some callers,
etc...

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

9 years agoPatch to warn when logical evaluation of operand evalutes to a true value;
Fariborz Jahanian [Tue, 11 Nov 2014 19:59:16 +0000 (19:59 +0000)]
Patch to warn when logical evaluation of operand evalutes to a true value;
That this is a c-only patch. c++ already has this warning.
This addresses rdar://18716393

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

9 years agoclang-format: Preserve trailing-comma logic even with comments.
Daniel Jasper [Tue, 11 Nov 2014 19:34:57 +0000 (19:34 +0000)]
clang-format: Preserve trailing-comma logic even with comments.

Before:
  vector<int> SomeVector = {// aaa
                            1, 2,
  };

After:
  vector<int> SomeVector = {
      // aaa
      1, 2,
  };

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

9 years agoFirst half of CWG1962: decltype(__func__) should not be a reference type,
Richard Smith [Tue, 11 Nov 2014 19:30:41 +0000 (19:30 +0000)]
First half of CWG1962: decltype(__func__) should not be a reference type,
because __func__ is supposed to act like a local static variable.

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

9 years agoThis patch fixes a crash after rebuilding call AST of
Fariborz Jahanian [Tue, 11 Nov 2014 16:56:21 +0000 (16:56 +0000)]
This patch fixes a crash after rebuilding call AST of
an __unknown_anytype(...). In this case, we rebuild the
vararg function type specially to convert the call expression
to  something that IRGen can handle. However, FunctionDecl
as rebuilt in RebuildUnknownAnyExpr::resolveDecl is bogus and
results in crash when accessing its params later on. This
patch fixes the crash by rebuilding the FunctionDecl to match
its new resolved type. rdar://15297105.
(patch reapplied after lldb issue was fixed in r221660).

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

9 years agoDiagnosticParseKinds is close to running into DiagnosticASTKinds.
Manuel Klimek [Tue, 11 Nov 2014 15:45:49 +0000 (15:45 +0000)]
DiagnosticParseKinds is close to running into DiagnosticASTKinds.

$ grep "def " include/clang/Basic/DiagnosticParseKinds.td |wc -l
396

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

9 years agoCGOpenMPRuntime.h: Fix a couple of \param(s) introduced in r221663. [-Wdocumentation]
NAKAMURA Takumi [Tue, 11 Nov 2014 07:58:06 +0000 (07:58 +0000)]
CGOpenMPRuntime.h: Fix a couple of \param(s) introduced in r221663. [-Wdocumentation]

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

9 years ago[OPENMP] Codegen for threadprivate variables
Alexey Bataev [Tue, 11 Nov 2014 04:05:39 +0000 (04:05 +0000)]
[OPENMP] Codegen for threadprivate variables
For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Original Global Addr>, kmpc_ctor <Constructor>, kmpc_cctor NULL, kmpc_dtor <Destructor>);
In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *<Current Location>, kmp_int32 <Current Thread Id>, void *<Original Global Addr>, size_t <Size of Data>, void ***<Pointer to autogenerated cache – array of private copies of threadprivate variable>);
Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info.
Differential Revision: http://reviews.llvm.org/D4002

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

9 years agoFix parsing of fold-expressions within a cast expression. We parse the
Richard Smith [Tue, 11 Nov 2014 03:28:50 +0000 (03:28 +0000)]
Fix parsing of fold-expressions within a cast expression. We parse the
parenthesized expression a bit differently in this case, just in case the
commas have special meaning.

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

9 years agoInstrProf: Remove an unnecessary helper function (NFC)
Justin Bogner [Tue, 11 Nov 2014 02:47:05 +0000 (02:47 +0000)]
InstrProf: Remove an unnecessary helper function (NFC)

VisitSubStmtRBraceState is really just Visit, as long as
VisitCompoundStatement handles braces correctly.

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

9 years agoCGExpr.cpp: Suppress a warning. [-Wunused-variable]
NAKAMURA Takumi [Tue, 11 Nov 2014 01:36:11 +0000 (01:36 +0000)]
CGExpr.cpp: Suppress a warning. [-Wunused-variable]

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

9 years ago[Sanitizer] Refactor sanitizer options in LangOptions.
Alexey Samsonov [Tue, 11 Nov 2014 01:26:14 +0000 (01:26 +0000)]
[Sanitizer] Refactor sanitizer options in LangOptions.

Get rid of ugly SanitizerOptions class thrust into LangOptions:
* Make SanitizeAddressFieldPadding a regular language option,
  and rely on default behavior to initialize/reset it.
* Make SanitizerBlacklistFile a regular member LangOptions.
* Introduce the helper class "SanitizerSet" to represent the
  set of enabled sanitizers and make it a member of LangOptions.
  It is exactly the entity we want to cache and modify in CodeGenFunction,
  for instance. We'd also be able to reuse SanitizerSet in
  CodeGenOptions for storing the set of recoverable sanitizers,
  and in the Driver to represent the set of sanitizers
  turned on/off by the commandline flags.

No functionality change.

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

9 years agoMove CodeGenOptions constructor out-of-line and add missing headers. NFC.
Alexey Samsonov [Tue, 11 Nov 2014 00:22:12 +0000 (00:22 +0000)]
Move CodeGenOptions constructor out-of-line and add missing headers. NFC.

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

9 years agoMove SanitizerKind class to a separate header. NFC.
Alexey Samsonov [Tue, 11 Nov 2014 00:19:46 +0000 (00:19 +0000)]
Move SanitizerKind class to a separate header. NFC.

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

9 years ago[libclang] When initializing an ObjC object via the "[[ClassName alloc] init*]" pattern,
Argyrios Kyrtzidis [Mon, 10 Nov 2014 23:21:35 +0000 (23:21 +0000)]
[libclang] When initializing an ObjC object via the "[[ClassName alloc] init*]" pattern,
report the 'init*' invocation as non-dynamic via clang_Cursor_isDynamicCall.

Of course it is dynamic at runtime, but for purposes of indexing we can treat as an invocation to ClassName's init*.

Addresses rdar://18916871.

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

9 years agoPropagate SanitizerKind into CodeGenFunction::EmitCheck() call.
Alexey Samsonov [Mon, 10 Nov 2014 22:27:30 +0000 (22:27 +0000)]
Propagate SanitizerKind into CodeGenFunction::EmitCheck() call.

Make sure CodeGenFunction::EmitCheck() knows which sanitizer
it emits check for. Make CheckRecoverableKind enum an
implementation detail and move it away from header.

Currently CheckRecoverableKind is determined by the type of
sanitizer ("unreachable" and "return" are unrecoverable,
"vptr" is always-recoverable, all the rest are recoverable).
This will change in future if we allow to specify which sanitizers
are recoverable, and which are not by -fsanitize-recover= flag.

No functionality change.

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

9 years agoValidate user headers even if -fmodules-validate-once-per-build-session
Ben Langmuir [Mon, 10 Nov 2014 22:13:10 +0000 (22:13 +0000)]
Validate user headers even if -fmodules-validate-once-per-build-session

is enabled. Unlike system headers, we want to be more careful about
modifications to user headers, because it's still easy to edit a header
while you're building.

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

9 years agoAArch64: set all processor features from -arch if nothing else present
Tim Northover [Mon, 10 Nov 2014 21:17:23 +0000 (21:17 +0000)]
AArch64: set all processor features from -arch if nothing else present

Darwin's "-arch arm64" option implies full Cyclone CPU, for both architectural
and tuning purposes. So if neither of the explicit options have been given,
forward that on to the proper invocation.

rdar://problem/18906227

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

9 years agoImprove diagnostics if _Noreturn is placed after a function declarator. (This sometim...
Richard Smith [Mon, 10 Nov 2014 21:10:32 +0000 (21:10 +0000)]
Improve diagnostics if _Noreturn is placed after a function declarator. (This sometimes happens when a macro is used that expands to either the GNU noreturn attribute or _Noreturn.)

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

9 years agoRemove change to set SDKROOT when building compiler-rt on Darwin.
Bob Wilson [Mon, 10 Nov 2014 20:01:19 +0000 (20:01 +0000)]
Remove change to set SDKROOT when building compiler-rt on Darwin.

This reverts the runtime library portion of r194168. As of r221621,
the libclang_rt libraries for Darwin build with explicit SDK options
so there is no need to set SDKROOT here.

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

9 years agoUpdate fold-expression mangling to match cxx-abi-dev discussion.
Richard Smith [Mon, 10 Nov 2014 19:44:15 +0000 (19:44 +0000)]
Update fold-expression mangling to match cxx-abi-dev discussion.

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

9 years agoOnly build iOS runtime libraries when the iOS SDKs are available.
Bob Wilson [Mon, 10 Nov 2014 17:46:55 +0000 (17:46 +0000)]
Only build iOS runtime libraries when the iOS SDKs are available.

This was already set up for the iOS simulator ASan dylib simulator,
and this change extends that to the other iOS runtime libraries.
This is in preparation for building all those iOS libraries against
the real SDKs instead of the fake SDKs in compiler-rt.

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

9 years agoclang-format: Fix pointer formatting.
Daniel Jasper [Mon, 10 Nov 2014 16:57:30 +0000 (16:57 +0000)]
clang-format: Fix pointer formatting.

Before:
  void f(Bar* a = nullptr, Bar * b);
After:
  void f(Bar* a = nullptr, Bar* b);

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

9 years agoclang-format: [Java] Never treat @interface as annotation.
Nico Weber [Mon, 10 Nov 2014 16:30:02 +0000 (16:30 +0000)]
clang-format: [Java] Never treat @interface as annotation.

'@' followed by any keyword can't be an annotation, but @interface is currently
the only combination of '@' and a keyword that's allowed, so limit it to this
case. `@interface Foo` without a leading `public` was misformatted prior to
this patch.

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

9 years agoclang-format: Document that --assume-filename affects the language.
Nico Weber [Mon, 10 Nov 2014 16:14:54 +0000 (16:14 +0000)]
clang-format: Document that --assume-filename affects the language.

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

9 years agoRemove unused diagnostic.
Benjamin Kramer [Mon, 10 Nov 2014 16:07:58 +0000 (16:07 +0000)]
Remove unused diagnostic.

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

9 years ago[Tooling] Restore current directory after processing each file.
Alexander Kornienko [Mon, 10 Nov 2014 15:42:31 +0000 (15:42 +0000)]
[Tooling] Restore current directory after processing each file.

Summary:
If we actually change directory before processing a file, we need to
restore it afterwards. This was broken in r216620.

Added a comment for the changes in r216620.

Reviewers: klimek

Reviewed By: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agoMissing testcase from r221581.
Aaron Ballman [Sat, 8 Nov 2014 17:09:50 +0000 (17:09 +0000)]
Missing testcase from r221581.

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

9 years agoUpdated the wording for a diagnostic to be more grammatically correct, and use a...
Aaron Ballman [Sat, 8 Nov 2014 17:07:15 +0000 (17:07 +0000)]
Updated the wording for a diagnostic to be more grammatically correct, and use a %select. Also ensure that nested namespace definitions are diagnosed properly. Both changes are motivated by post-commit feedback from r221580.

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

9 years ago[c++1z] Support for attributes on namespaces and enumerators.
Aaron Ballman [Sat, 8 Nov 2014 15:33:35 +0000 (15:33 +0000)]
[c++1z] Support for attributes on namespaces and enumerators.

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

9 years ago[c++1z] Support for u8 character literals.
Richard Smith [Sat, 8 Nov 2014 06:08:42 +0000 (06:08 +0000)]
[c++1z] Support for u8 character literals.

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

9 years ago[c++1z] Implement nested-namespace-definitions.
Richard Smith [Sat, 8 Nov 2014 05:37:34 +0000 (05:37 +0000)]
[c++1z] Implement nested-namespace-definitions.

This allows 'namespace A::B { ... }' as a shorthand for 'namespace A {
namespace B { ... } }'. We already supported this correctly for error recovery;
promote that support to a full implementation.

This is not the right implementation: we do not maintain source fidelity
because we desugar the nested namespace definition in the parser. This is
tricky to avoid, since the definition genuinely does inject one named
entity per level in the namespace name.

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

9 years ago[c++1z] N4295: fold-expressions.
Richard Smith [Sat, 8 Nov 2014 05:07:16 +0000 (05:07 +0000)]
[c++1z] N4295: fold-expressions.

This is a new form of expression of the form:

  (expr op ... op expr)

where one of the exprs is a parameter pack. It expands into

  (expr1 op (expr2onwards op ... op expr))

(and likewise if the pack is on the right). The non-pack operand can be
omitted; in that case, an empty pack gives a fallback value or an error,
depending on the operator.

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

9 years agoCheck module signature when the module has already been loaded
Ben Langmuir [Sat, 8 Nov 2014 00:34:30 +0000 (00:34 +0000)]
Check module signature when the module has already been loaded

We may need to verify the signature on subsequent imports as well, just
like we verify the size/modtime:
@import A;
@import B; // imports A
@import C; // imports A

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

9 years agoFixed a buildbot failure.
Fariborz Jahanian [Sat, 8 Nov 2014 00:23:55 +0000 (00:23 +0000)]
Fixed a buildbot failure.

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

9 years agoFix unintended fallthrough in ASTReader
Ben Langmuir [Sat, 8 Nov 2014 00:06:39 +0000 (00:06 +0000)]
Fix unintended fallthrough in ASTReader

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