]> granicus.if.org Git - clang/log
clang
9 years agotest/Driver/cl-outputs.c: tweak some check prefixes; NFC.
Hans Wennborg [Mon, 17 Nov 2014 18:40:45 +0000 (18:40 +0000)]
test/Driver/cl-outputs.c: tweak some check prefixes; NFC.

These tests deal with the /o option; rename to better reflect that.

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

9 years agoBasic: tweak comment
Saleem Abdulrasool [Mon, 17 Nov 2014 18:40:15 +0000 (18:40 +0000)]
Basic: tweak comment

Add a missing surrounding brace for doxygen group.  This messes with pair
jumping in vim and is annoying.  NFC.

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

9 years agoFix the indentation: Nesting level does not match indentation (CID 1254863)
Sylvestre Ledru [Mon, 17 Nov 2014 18:26:39 +0000 (18:26 +0000)]
Fix the indentation: Nesting level does not match indentation (CID 1254863)

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

9 years agoFixing a use of stringstream to use an LLVM helper function. Drive-by fixing header...
Aaron Ballman [Mon, 17 Nov 2014 18:17:19 +0000 (18:17 +0000)]
Fixing a use of stringstream to use an LLVM helper function. Drive-by fixing header include order. NFC.

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

9 years ago[Reassociate] Update test cases due to r222142.
Chad Rosier [Mon, 17 Nov 2014 16:34:47 +0000 (16:34 +0000)]
[Reassociate] Update test cases due to r222142.

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

9 years agoMinor readability tweaks to VFTableBuilder.cpp
Timur Iskhodzhanov [Mon, 17 Nov 2014 15:53:50 +0000 (15:53 +0000)]
Minor readability tweaks to VFTableBuilder.cpp

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

9 years agoAdd a couple more examples illustrating why we need vtordisps and how they work
Timur Iskhodzhanov [Mon, 17 Nov 2014 15:11:05 +0000 (15:11 +0000)]
Add a couple more examples illustrating why we need vtordisps and how they work

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

9 years agoRemove VariadicOperatorMatcherInterface as it is redundant with logic from DynTypedMa...
Samuel Benzaquen [Mon, 17 Nov 2014 14:55:49 +0000 (14:55 +0000)]
Remove VariadicOperatorMatcherInterface as it is redundant with logic from DynTypedMatcher.

Summary:
The generic variadic matcher is faster (one less virtual function call
per match) and doesn't require template instantiations which reduces
compile time and binary size.
Registry.cpp.o generates ~14% less symbols and compiles ~7.5% faster.
The change also speeds up our clang-tidy benchmark by ~2%.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

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

9 years agoA small correction for r221884. No functional changes.
Alexander Kornienko [Mon, 17 Nov 2014 14:46:28 +0000 (14:46 +0000)]
A small correction for r221884. No functional changes.

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

9 years agoclang-format: Fix regression introduced in r221609.
Daniel Jasper [Mon, 17 Nov 2014 13:55:04 +0000 (13:55 +0000)]
clang-format: Fix regression introduced in r221609.

Before:
  void f() { f(a, c *d); }

After:
  void f() { f(a, c * d); }

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

9 years ago[Sanitizer] Parse and produce all sanitizer-relevant arguments in SanitizerArgs.
Alexey Samsonov [Sun, 16 Nov 2014 20:53:53 +0000 (20:53 +0000)]
[Sanitizer] Parse and produce all sanitizer-relevant arguments in SanitizerArgs.

In particular, make SanitizerArgs responsible for parsing
and passing down to frontend -fsanitize-recover and
-fsanitize-undefined-trap-on-error flags.

Simplify parsing -f(no-)sanitize= flags parsing: get rid of
too complex filterUnsupportedKinds function.

No functionality change.

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

9 years agoFix issues missed during the review of r222099.
Richard Trieu [Sat, 15 Nov 2014 06:37:39 +0000 (06:37 +0000)]
Fix issues missed during the review of r222099.

Shift some functions around, make a method in Sema private,
call the correct overloaded function.  No functional change.

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

9 years agoFix IRGen for passing transparent unions
Reid Kleckner [Sat, 15 Nov 2014 01:41:41 +0000 (01:41 +0000)]
Fix IRGen for passing transparent unions

We have had a test for this for a long time with a FIXME saying what we
should be doing. This just does it.

Fixes PR21573.

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

9 years agoCGDebugInfo: Update for DIBuilder API change
Duncan P. N. Exon Smith [Sat, 15 Nov 2014 00:24:50 +0000 (00:24 +0000)]
CGDebugInfo: Update for DIBuilder API change

Tracking LLVM commit r222070.

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

9 years agoThis patch fixes couple of bugs for predefined expression
Fariborz Jahanian [Fri, 14 Nov 2014 23:55:27 +0000 (23:55 +0000)]
This patch fixes couple of bugs for predefined expression
used inside blocks. It fixes a crash in naming code
for __func__ etc. when used in a block declared globally.
It also brings back old naming convention for
predefined expression which was broken. rdar://18961148

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

9 years ago[c++1z] Support [[deprecated]] attributes on namespaces. Note that it only applies...
Aaron Ballman [Fri, 14 Nov 2014 22:34:56 +0000 (22:34 +0000)]
[c++1z] Support [[deprecated]] attributes on namespaces. Note that it only applies to situations where the namespace is mentioned. Thus, use on anonymous namespaces is diagnosed.

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

9 years agoRecommit r222044 with a test fix - it does not make sense to hunt
Anton Korobeynikov [Fri, 14 Nov 2014 22:09:15 +0000 (22:09 +0000)]
Recommit r222044 with a test fix - it does not make sense to hunt
for a typedef before arithmetic conversion in all rare corner cases.

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

9 years agoRemoving an unused variable; NFC.
Aaron Ballman [Fri, 14 Nov 2014 21:57:30 +0000 (21:57 +0000)]
Removing an unused variable; NFC.

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

9 years agoAgain revert r222044 to resolve darwin objc test fails.
Anton Korobeynikov [Fri, 14 Nov 2014 21:54:46 +0000 (21:54 +0000)]
Again revert r222044 to resolve darwin objc test fails.

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

9 years agoFollow-up to D6217
Anton Korobeynikov [Fri, 14 Nov 2014 21:41:07 +0000 (21:41 +0000)]
Follow-up to D6217

Summary:
Ok, here is somewhat addition to D6217 aiming to preserve old darwin behavior wrt the typedefed types. The actual change to SemaChecking turned out to be pretty gross, in particular:
  1. We need to extract the typedef'ed type for proper diagnostics
  2. We need to walk over paren expressions as well

Reviewers: chandlerc, rsmith

Reviewed By: rsmith

Subscribers: cfe-commits

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

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

9 years agoAdd DiagID and Warning Flag to DiagnosticsLog
Steven Wu [Fri, 14 Nov 2014 21:23:56 +0000 (21:23 +0000)]
Add DiagID and Warning Flag to DiagnosticsLog

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

9 years agoMinGW doesn't implement std::to_string; working around it. NFC.
Aaron Ballman [Fri, 14 Nov 2014 20:31:50 +0000 (20:31 +0000)]
MinGW doesn't implement std::to_string; working around it. NFC.

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

9 years agoRemove some redundant virtual specifiers on overriden functions.
David Blaikie [Fri, 14 Nov 2014 19:09:44 +0000 (19:09 +0000)]
Remove some redundant virtual specifiers on overriden functions.

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

9 years agoTypo fix.
Yaron Keren [Fri, 14 Nov 2014 18:33:42 +0000 (18:33 +0000)]
Typo fix.

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

9 years agoclang-cl: Ignore the new /Zo[-] option (PR21571)
Hans Wennborg [Fri, 14 Nov 2014 18:24:08 +0000 (18:24 +0000)]
clang-cl: Ignore the new /Zo[-] option (PR21571)

Also fix the ignored options test which didn't fail properly on
unknown options.

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

9 years agoclang-format: [Java] Further improve generics formatting.
Daniel Jasper [Fri, 14 Nov 2014 17:30:15 +0000 (17:30 +0000)]
clang-format: [Java] Further improve generics formatting.

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

9 years agoclang-format: Correctly detect multiplication in ctor initializer.
Daniel Jasper [Fri, 14 Nov 2014 17:26:49 +0000 (17:26 +0000)]
clang-format: Correctly detect multiplication in ctor initializer.

Before:
  Constructor() : a(a), area(width *height) {}

After:
  Constructor() : a(a), area(width * height) {}

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

9 years ago[Sema]. Warn when logical expression is a pointer
Fariborz Jahanian [Fri, 14 Nov 2014 17:12:50 +0000 (17:12 +0000)]
[Sema]. Warn when logical expression is a pointer
which evaluates to true. rdar://18716393.
Reviewed by Richard Trieu

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

9 years agoSilencing a -Wparentheses warning; NFC.
Aaron Ballman [Fri, 14 Nov 2014 14:40:49 +0000 (14:40 +0000)]
Silencing a -Wparentheses warning; NFC.

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

9 years agoReplace weird whitespace symbols with good old spaces
Timur Iskhodzhanov [Fri, 14 Nov 2014 14:16:34 +0000 (14:16 +0000)]
Replace weird whitespace symbols with good old spaces

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

9 years agoAdd one illustrative class hierarchy as an example in a comment to the VFTableBuilder...
Timur Iskhodzhanov [Fri, 14 Nov 2014 14:10:15 +0000 (14:10 +0000)]
Add one illustrative class hierarchy as an example in a comment to the VFTableBuilder code

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

9 years agoOops, the underline was too short for sphinx to like.
Aaron Ballman [Fri, 14 Nov 2014 14:01:55 +0000 (14:01 +0000)]
Oops, the underline was too short for sphinx to like.

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

9 years agoCorrecting some grammar and typos, and adding CERT as a collaborator.
Aaron Ballman [Fri, 14 Nov 2014 13:48:34 +0000 (13:48 +0000)]
Correcting some grammar and typos, and adding CERT as a collaborator.

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

9 years agoComplete support for the SD-6 standing document (based off N4200) with support for...
Aaron Ballman [Fri, 14 Nov 2014 13:44:02 +0000 (13:44 +0000)]
Complete support for the SD-6 standing document (based off N4200) with support for __has_cpp_attribute.

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

9 years agoclang-format: Give clang-format-diff.py a -v option.
Daniel Jasper [Fri, 14 Nov 2014 13:27:28 +0000 (13:27 +0000)]
clang-format: Give clang-format-diff.py a -v option.

With it, it prints the file being formatted. Apparently people are
formatting thousands of files and some progress indication is helpful.

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

9 years agoclang-format: Improve function parameter packing.
Daniel Jasper [Fri, 14 Nov 2014 13:14:45 +0000 (13:14 +0000)]
clang-format: Improve function parameter packing.

Before:
  void SomeLoooooooooooongFunction(
      std::unique_ptr<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
          aaaaaaaaaaaaaaaaaaaaaaaaaa, int bbbbbbbbbbbbb);

After:
  void SomeLoooooooooooongFunction(
      std::unique_ptr<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
          aaaaaaaaaaaaaaaaaaaaaaaaaa,
      int bbbbbbbbbbbbb);

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

9 years ago[PowerPC] Enable vec_perm for long long and double vector types for VSX
Bill Schmidt [Fri, 14 Nov 2014 13:10:13 +0000 (13:10 +0000)]
[PowerPC] Enable vec_perm for long long and double vector types for VSX

VSX makes the "vector long long" and "vector double" types available.
This patch enables the vec_perm interface for these types.  The same
builtin is generated regardless of the specified type, so no
additional work or testing is needed in the back end.  Tests are added
to ensure this builtin is generated by the front end.

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

9 years agoclang-format: Support assignments as conditional operands.
Daniel Jasper [Fri, 14 Nov 2014 13:03:40 +0000 (13:03 +0000)]
clang-format: Support assignments as conditional operands.

Before:
  return a != b
             // comment
             ? a
             : a = a != b
                   // comment
         ? a =
               b : a;
After:
  return a != b
             // comment
             ? a
             : a = a != b
                       // comment
                       ? a = b
                       : a;

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

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