]> granicus.if.org Git - clang/log
clang
9 years agoReplace the broken LambdaCapture::isInitCapture API.
James Dennett [Thu, 7 May 2015 18:48:18 +0000 (18:48 +0000)]
Replace the broken LambdaCapture::isInitCapture API.

A LambdaCapture does not have sufficient information
to correctly determine whether it is an init-capture or not.
Doing so requires knowledge held in the LambdaExpr itself.

It the case of a nested capture of an init-capture it is not
sufficient to check (as LambdaCapture::isInitCapture did)
whether the associated VarDecl was from an init-capture.

This patch moves isInitCapture to LambdaExpr and updates
Capture->isInitCapture() to Lambda->isInitCapture(Capture).

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

9 years ago[SanitizerCoverage] Give clang-cc1 the power to precisly specify needed sanitizier...
Alexey Samsonov [Thu, 7 May 2015 18:31:29 +0000 (18:31 +0000)]
[SanitizerCoverage] Give clang-cc1 the power to precisly specify needed sanitizier coverage mode.

Summary:
The next step is to add user-friendly control over these options
to driver via -fsanitize-coverage= option.

Test Plan: regression test suite

Reviewers: kcc

Subscribers: cfe-commits

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

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

9 years ago[opaque pointer type] Correctly pass the pointee type when creating a GEP constant...
David Blaikie [Thu, 7 May 2015 17:27:56 +0000 (17:27 +0000)]
[opaque pointer type] Correctly pass the pointee type when creating a GEP constant expression

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

9 years agoUpdate the subversion link to http://subversion.apache.org/packages.html.
Yaron Keren [Thu, 7 May 2015 15:15:16 +0000 (15:15 +0000)]
Update the subversion link to http://subversion.apache.org/packages.html.

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

9 years agoFix clang getting started guide to require VC2013 instead of VS2012.
Yaron Keren [Thu, 7 May 2015 15:12:30 +0000 (15:12 +0000)]
Fix clang getting started guide to require VC2013 instead of VS2012.

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

9 years agoAdding new AST matcher: gnuNullExpr
Szabolcs Sipos [Thu, 7 May 2015 14:24:22 +0000 (14:24 +0000)]
Adding new AST matcher: gnuNullExpr

It matches GNU __null expression.

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

9 years agoclang-format: Improve r236597, Properly indent method calls without inputs.
Daniel Jasper [Thu, 7 May 2015 14:19:59 +0000 (14:19 +0000)]
clang-format: Improve r236597, Properly indent method calls without inputs.

Before:
  [aaaaaaaaaaaa(aaaaaa)
          aaaaaaaaaaaaaaaaaaaa];

After:
  [aaaaaaaaaaaa(aaaaaa)
      aaaaaaaaaaaaaaaaaaaa];

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

9 years agoImplements a way to retrieve information about whether some lines were not formatted...
Manuel Klimek [Thu, 7 May 2015 12:26:30 +0000 (12:26 +0000)]
Implements a way to retrieve information about whether some lines were not formatted due to syntax errors.

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

9 years agoAVX-512: FP compare intrinsics - changed type of CC parameter from i8 to i32 accordin...
Elena Demikhovsky [Thu, 7 May 2015 11:26:36 +0000 (11:26 +0000)]
AVX-512: FP compare intrinsics - changed type of CC parameter from i8 to i32 according to the spec.
Added FP compare intrinsics for SKX.

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

9 years agoMark clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp as REQUIRES:asserts...
NAKAMURA Takumi [Thu, 7 May 2015 10:11:27 +0000 (10:11 +0000)]
Mark clang/test/CodeGenCXX/microsoft-abi-thread-safe-statics.cpp as REQUIRES:asserts. It relies on label names.

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

9 years agoFix some glitches in the MSVCCompatibility document
David Majnemer [Thu, 7 May 2015 07:48:16 +0000 (07:48 +0000)]
Fix some glitches in the MSVCCompatibility document

- Fix the formatting of the "Exceptions and SEH" section.
- Make the "Complete" text for "Thread-safe initialization of local
  statics" green.

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

9 years agoFix for http://llvm.org/PR23392: magick/feature.c from ImageMagick-6.9.1-2 ICEs.
Alexey Bataev [Thu, 7 May 2015 06:28:46 +0000 (06:28 +0000)]
Fix for http://llvm.org/PR23392: magick/feature.c from ImageMagick-6.9.1-2 ICEs.
Fix for codegen of static variables declared inside of captured statements. Captured statements are actually a transparent DeclContexts, so we have to skip them when trying to get a mangled name for statics.
Differential Revision: http://reviews.llvm.org/D9522

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

9 years agoNote that we support 'throw' for the MS ABI.
David Majnemer [Thu, 7 May 2015 06:16:03 +0000 (06:16 +0000)]
Note that we support 'throw' for the MS ABI.

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

9 years ago[MS ABI] Implement thread-safe initialization using the MSVC 2015 ABI
David Majnemer [Thu, 7 May 2015 06:15:46 +0000 (06:15 +0000)]
[MS ABI] Implement thread-safe initialization using the MSVC 2015 ABI

The MSVC 2015 ABI utilizes a rather straightforward adaptation of the
algorithm found in the appendix of N2382.  While we are here, implement
support for emitting cleanups if an exception is thrown while we are
intitializing a static local variable.

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

9 years ago[OPENMP] Generate !llvm.mem.loop_parallel_access metadata for loops with dynamic...
Alexey Bataev [Thu, 7 May 2015 04:25:17 +0000 (04:25 +0000)]
[OPENMP] Generate !llvm.mem.loop_parallel_access metadata for loops with dynamic/guided scheduling.

Inner bodies of OpenMP worksharing loop-based constructs with dynamic or guided scheduling are allowed to be marked with !llvm.mem.parallel_loop_access metadata for better optimization. Worksharing constructs with static scheduling cannot be marked this way (according to OpenMP standard "A data dependence between the same logical iterations in two such loops is guaranteed").
Constructs with auto and runtime scheduling are also not marked because automatically chosen scheduling may be static also.
Differential Revision: http://reviews.llvm.org/D9518

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

9 years ago[OPENMP] Fixed test for reduction on 'sections' directive.
Alexey Bataev [Thu, 7 May 2015 04:09:41 +0000 (04:09 +0000)]
[OPENMP] Fixed test for reduction on 'sections' directive.

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

9 years agofix clang-fuzzer and clang-format-fuzzer
Kostya Serebryany [Thu, 7 May 2015 04:01:39 +0000 (04:01 +0000)]
fix clang-fuzzer and clang-format-fuzzer

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

9 years ago[modules] Suport for merging a parsed enum definition into an existing imported but...
Richard Smith [Thu, 7 May 2015 03:54:19 +0000 (03:54 +0000)]
[modules] Suport for merging a parsed enum definition into an existing imported but not visible definition.

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

9 years ago[OPENMP] Fixed codegen for 'reduction' clause.
Alexey Bataev [Thu, 7 May 2015 03:54:03 +0000 (03:54 +0000)]
[OPENMP] Fixed codegen for 'reduction' clause.

Fixed codegen for reduction operations min, max, && and ||. Codegen for them is quite similar and I was confused by this similarity.
Also added a call to kmpc_end_reduce() in atomic part of reduction codegen (call to kmpc_end_reduce_nowait() is not required).
Differential Revision: http://reviews.llvm.org/D9513

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

9 years agoWhen performing delayed typo correction in a for-range loop's variable
Kaelyn Takata [Thu, 7 May 2015 00:11:02 +0000 (00:11 +0000)]
When performing delayed typo correction in a for-range loop's variable
declaration, ensure the loop variable is properly marked as invalid when
it is an "auto" variable.

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

9 years agoFix public-private.modulemap test case to clear the cache on every run.
Peter Collingbourne [Wed, 6 May 2015 22:31:13 +0000 (22:31 +0000)]
Fix public-private.modulemap test case to clear the cache on every run.

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

9 years agoCGCXX: Use cast in getAddrOfCXXStructor()
Duncan P. N. Exon Smith [Wed, 6 May 2015 22:18:39 +0000 (22:18 +0000)]
CGCXX: Use cast in getAddrOfCXXStructor()

All callers should be passing `CXXConstructorDecl` or
`CXXDestructorDecl` here, so use `cast<>` instead of `dyn_cast<>` when
setting up the `GlobalDecl`.

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

9 years ago[docs] Update SanitizerCoverage docs.
Sergey Matveev [Wed, 6 May 2015 21:09:00 +0000 (21:09 +0000)]
[docs] Update SanitizerCoverage docs.

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

9 years agoclang-format: Don't indent 'signals' as access specifier if it isn't one
Daniel Jasper [Wed, 6 May 2015 19:21:23 +0000 (19:21 +0000)]
clang-format: Don't indent 'signals' as access specifier if it isn't one

Before:
  {
  signals.set(0);
  }

After:
  {
    signals.set(0);
  }

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

9 years ago[driver] Cosmetic change to use Input instead of Inputs[0].
Artem Belevich [Wed, 6 May 2015 18:20:23 +0000 (18:20 +0000)]
[driver] Cosmetic change to use Input instead of Inputs[0].

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

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

9 years ago[AArch64] Advertise that the __sync_*_compare_and_swap_1/2/4/8 builtins work
Reid Kleckner [Wed, 6 May 2015 15:31:46 +0000 (15:31 +0000)]
[AArch64] Advertise that the __sync_*_compare_and_swap_1/2/4/8 builtins work

Fixes PR23428, where std::thread in libstdc++ would go haywire without
these defines.

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

9 years agoclang-format: Merge labels and subsequent semicolons.
Daniel Jasper [Wed, 6 May 2015 15:19:47 +0000 (15:19 +0000)]
clang-format: Merge labels and subsequent semicolons.

E.g.:

  default:;

This can be used to get around restrictions as to what can follow a
label. It fixes llvm.org/PR19648.

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

9 years agoclang-format: Allow ternary expressions inside template parameters if
Daniel Jasper [Wed, 6 May 2015 14:53:50 +0000 (14:53 +0000)]
clang-format: Allow ternary expressions inside template parameters if
the template parameters aren't inside an expression context.

This fixes llvm.org/PR23270.

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

9 years agoclang-format: Consider operator precedence as penalty when breaking
Daniel Jasper [Wed, 6 May 2015 14:23:38 +0000 (14:23 +0000)]
clang-format: Consider operator precedence as penalty when breaking
before operators.

This fixes llvm.org/23382.

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

9 years agoclang-format: Accept slightly more record declarations.
Daniel Jasper [Wed, 6 May 2015 14:03:02 +0000 (14:03 +0000)]
clang-format: Accept slightly more record declarations.

This fixes llvm.org/PR23397.

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

9 years agoclang-format: Fix bad wrapping of ObjC method exprs.
Daniel Jasper [Wed, 6 May 2015 13:13:03 +0000 (13:13 +0000)]
clang-format: Fix bad wrapping of ObjC method exprs.

Before:
  [aaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaa:
      aaaaaaaa aaa:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];

After:
  [aaaaaaaaaaaaaaaaaaaaaaaaa
      aaaaaaaaaaaaaaaaa:aaaaaaaa
                    aaa:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];

Note that this might now violate the column limit and we probably need an
alternative way of indenting these then. However, that is still strictly better
than the messy formatting that clang-format did before.

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

9 years agoclang-format: Properly indent method calls without inputs.
Daniel Jasper [Wed, 6 May 2015 12:48:06 +0000 (12:48 +0000)]
clang-format: Properly indent method calls without inputs.

Before:
  [aaaaaaaaaaa
          aaaaaaa];

After:
  [aaaaaaaaaaa
      aaaaaaa];

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

9 years agoRemove deprecated version of reformat.
Manuel Klimek [Wed, 6 May 2015 12:12:22 +0000 (12:12 +0000)]
Remove deprecated version of reformat.

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

9 years agoclang-format: Don't allow -i when reading from stdin.
Daniel Jasper [Wed, 6 May 2015 11:56:54 +0000 (11:56 +0000)]
clang-format: Don't allow -i when reading from stdin.

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

9 years agoRemove all computation of structural errors in clang-format's line parser.
Manuel Klimek [Wed, 6 May 2015 11:56:29 +0000 (11:56 +0000)]
Remove all computation of structural errors in clang-format's line parser.

We were already ignoring those already.

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

9 years agoclang-format: Fix another assertion discovered by the fuzzer.
Daniel Jasper [Wed, 6 May 2015 11:16:43 +0000 (11:16 +0000)]
clang-format: Fix another assertion discovered by the fuzzer.

In the process, fix an old todo that I don't really know how to write
tests for. The problem is that Clang's lexer creates very strange token
sequences for these. However, the new approach seems generally better
and easier to read so I am submitting it nonetheless.

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

9 years agoclang-format: Prevent assertion discovered by fuzzer.
Daniel Jasper [Wed, 6 May 2015 08:58:57 +0000 (08:58 +0000)]
clang-format: Prevent assertion discovered by fuzzer.

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

9 years agoclang-format: Prevent exponential runtime in token annotator.
Daniel Jasper [Wed, 6 May 2015 08:38:24 +0000 (08:38 +0000)]
clang-format: Prevent exponential runtime in token annotator.

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

9 years ago[OPENMP] Fixed messages about predetermined DSA for loop control variables.
Alexey Bataev [Wed, 6 May 2015 07:25:08 +0000 (07:25 +0000)]
[OPENMP] Fixed messages about predetermined DSA for loop control variables.

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

9 years agoclang-format: Fix bug in multiline comment wrapping.
Daniel Jasper [Wed, 6 May 2015 07:17:22 +0000 (07:17 +0000)]
clang-format: Fix bug in multiline comment wrapping.

Splitting:
  /**
   * multiline block comment
   *
   */

Before:
  /**
   * multiline block
   *comment
   *
   */

After:
  /**
   * multiline block
   * comment
   *
   */

The reason was that the empty line inside the comment (with just the "*") was
confusing the comment breaking logic.

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

9 years ago[OPENMP] Fix for http://llvm.org/PR23387: clang fails to compile magick/attribute.c
Alexey Bataev [Wed, 6 May 2015 06:34:55 +0000 (06:34 +0000)]
[OPENMP] Fix for http://llvm.org/PR23387: clang fails to compile magick/attribute.c

Allow to use variables with 'register' storage class as loop control variables in OpenMP loop based constructs.

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

9 years agoRevert "[analyzer] scan-build: support spaces in compiler path and arguments."
Ahmed Bougacha [Wed, 6 May 2015 02:08:27 +0000 (02:08 +0000)]
Revert "[analyzer] scan-build: support spaces in compiler path and arguments."

This reverts commit r236423 and its followup r236533, as indiscriminate
quoting makes for too much quoting (and clang doesn't like both '"-c"'
and -D"FOO=bar").

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

9 years agoInstrProf: Don't start or end coverage regions inside of system macros
Justin Bogner [Tue, 5 May 2015 21:46:14 +0000 (21:46 +0000)]
InstrProf: Don't start or end coverage regions inside of system macros

It doesn't make much sense to try to show coverage inside system
macros, and source locations in builtins confuses the coverage
mapping. Just avoid doing this.

Fixes an assert that fired when a __block storage specifier starts a
region.

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

9 years agoUpdate testcase to match r236539
David Majnemer [Tue, 5 May 2015 20:34:29 +0000 (20:34 +0000)]
Update testcase to match r236539

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

9 years ago[analyzer] This eliminates regression caused by r236423.
Anton Yartsev [Tue, 5 May 2015 19:43:37 +0000 (19:43 +0000)]
[analyzer] This eliminates regression caused by r236423.

Wrap an argument with quotes only if it has spaces.

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

9 years ago[SystemZ] Add support for z13 low-level vector builtins
Ulrich Weigand [Tue, 5 May 2015 19:36:42 +0000 (19:36 +0000)]
[SystemZ] Add support for z13 low-level vector builtins

This adds low-level builtins to allow access to all of the z13 vector
instructions.  Note that instructions whose semantics can be described
by standard C (including clang extensions) do not get any builtins.

For each instructions whose semantics *cannot* (fully) be described, we
define a builtin named __builtin_s390_<insn> that directly maps to this
instruction.  These are intended to be compatible with GCC.

For instructions that also set the condition code, the builtin will take
an extra argument of type "int *" at the end.  The integer pointed to by
this argument will be set to the post-instruction CC value.

For many instructions, the low-level builtin is mapped to the corresponding
LLVM IR intrinsic.  However, a number of instructions can be represented
in standard LLVM IR without requiring use of a target intrinsic.

Some instructions require immediate integer operands within a certain
range.  Those are verified at the Sema level.

Based on a patch by Richard Sandiford.

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

9 years ago[SystemZ] Add support for z13 and its vector facility
Ulrich Weigand [Tue, 5 May 2015 19:35:52 +0000 (19:35 +0000)]
[SystemZ] Add support for z13 and its vector facility

This patch adds support for the z13 architecture type.  For compatibility
with GCC, a pair of options -mvx / -mno-vx can be used to selectively
enable/disable use of the vector facility.

When the vector facility is present, we default to the new vector ABI.
This is characterized by two major differences:
- Vector types are passed/returned in vector registers
  (except for unnamed arguments of a variable-argument list function).
- Vector types are at most 8-byte aligned.

The reason for the choice of 8-byte vector alignment is that the hardware
is able to efficiently load vectors at 8-byte alignment, and the ABI only
guarantees 8-byte alignment of the stack pointer, so requiring any higher
alignment for vectors would require dynamic stack re-alignment code.

However, for compatibility with old code that may use vector types, when
*not* using the vector facility, the old alignment rules (vector types
are naturally aligned) remain in use.

These alignment rules are not only implemented at the C language level,
but also at the LLVM IR level.  This is done by selecting a different
DataLayout string depending on whether the vector ABI is in effect or not.

Based on a patch by Richard Sandiford.

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

9 years agoAllow TransformTypos to ignore corrections to a specified VarDecl.
Kaelyn Takata [Tue, 5 May 2015 19:17:03 +0000 (19:17 +0000)]
Allow TransformTypos to ignore corrections to a specified VarDecl.

This is needed to prevent a TypoExpr from being corrected to a variable
when the TypoExpr is a subexpression of that variable's initializer.

Also exclude more keywords from the correction candidate pool when the
subsequent token is .* or ->* since keywords like "new" or "return"
aren't valid on the left side of those operators.

Fixes PR23140.

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

9 years ago[OPENMP] Allow use of macros in OpenMP directives/clauses.
Alexey Bataev [Tue, 5 May 2015 09:53:25 +0000 (09:53 +0000)]
[OPENMP] Allow use of macros in OpenMP directives/clauses.

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

9 years ago[OPENMP] Fixed incorrect work with cleanups, NFC.
Alexey Bataev [Tue, 5 May 2015 09:24:37 +0000 (09:24 +0000)]
[OPENMP] Fixed incorrect work with cleanups, NFC.

Destructors are never called for cleanups, so we can't use SmallVector as a member.
Differential Revision: http://reviews.llvm.org/D9399

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

9 years agoRevert revision 236487: [OPENMP] Fixed incorrect work with cleanups, NFC.
Alexey Bataev [Tue, 5 May 2015 08:48:39 +0000 (08:48 +0000)]
Revert revision 236487: [OPENMP] Fixed incorrect work with cleanups, NFC.

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

9 years agoclang-format: [JS] support optional methods.
Daniel Jasper [Tue, 5 May 2015 08:40:32 +0000 (08:40 +0000)]
clang-format: [JS] support optional methods.

Optional methods use ? tokens like this:

  interface X { y?(): z; }

It seems easiest to detect and disambiguate these from ternary
expressions by checking if the code is in a declaration context. Turns
out that that didn't quite work properly for interfaces in Java and JS,
and for JS file root contexts.

Patch by Martin Probst, thank you.

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

9 years ago[OPENMP] Fixed incorrect work with cleanups, NFC.
Alexey Bataev [Tue, 5 May 2015 08:38:22 +0000 (08:38 +0000)]
[OPENMP] Fixed incorrect work with cleanups, NFC.

Destructors are never called for cleanups, so we can't use SmallVector as a member.
Differential Revision: http://reviews.llvm.org/D9399

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

9 years agoclang-format: [JS] Do not collapse short interfaces.
Daniel Jasper [Tue, 5 May 2015 08:12:50 +0000 (08:12 +0000)]
clang-format: [JS] Do not collapse short interfaces.

Patch by Martin Probst.

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

9 years agoRevert revision 236482: [OPENMP] Fixed incorrect work with cleanups, NFC.
Alexey Bataev [Tue, 5 May 2015 06:32:45 +0000 (06:32 +0000)]
Revert revision 236482: [OPENMP] Fixed incorrect work with cleanups, NFC.

Due to some incompatibilities with Windows.

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

9 years ago[OPENMP] Fixed incorrect work with cleanups, NFC.
Alexey Bataev [Tue, 5 May 2015 06:21:01 +0000 (06:21 +0000)]
[OPENMP] Fixed incorrect work with cleanups, NFC.

Destructors are never called for cleanups, so we can't use SmallVector as a member.
Differential Revision: http://reviews.llvm.org/D9399

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

9 years agoRevert revision 236480: [OPENMP] Fixed incorrect work with cleanups, NFC.
Alexey Bataev [Tue, 5 May 2015 04:56:26 +0000 (04:56 +0000)]
Revert revision 236480: [OPENMP] Fixed incorrect work with cleanups, NFC.

Due to some incompatibilities with Windows.

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

9 years ago[OPENMP] Fixed incorrect work with cleanups, NFC.
Alexey Bataev [Tue, 5 May 2015 04:42:07 +0000 (04:42 +0000)]
[OPENMP] Fixed incorrect work with cleanups, NFC.

Destructors are never called for cleanups, so we can't use SmallVector as a member.
Differential Revision: http://reviews.llvm.org/D9399

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

9 years ago[OPENMP] Codegen for 'firstprivate' clause in 'task' directive.
Alexey Bataev [Tue, 5 May 2015 04:05:12 +0000 (04:05 +0000)]
[OPENMP] Codegen for 'firstprivate' clause in 'task' directive.

For tasks codegen for private/firstprivate variables are different rather than for other directives.

1. Build an internal structure of privates for each private variable:
struct .kmp_privates_t. {
  Ty1 var1;
  ...
  Tyn varn;
};
2. Add a new field to kmp_task_t type with list of privates.
struct kmp_task_t {
  void *              shareds;
  kmp_routine_entry_t routine;
  kmp_int32           part_id;
  kmp_routine_entry_t destructors;
  .kmp_privates_t.    privates;
};
3. Create a function with destructors calls for all privates after end of task region.
kmp_int32 .omp_task_destructor.(kmp_int32 gtid, kmp_task_t *tt) {
  ~Destructor(&tt->privates.var1);
  ...
  ~Destructor(&tt->privates.varn);
  return 0;
}
4. Perform initialization of all firstprivate fields (by simple copying for POD data, copy constructor calls for classes) + provide address of a destructor function after kmpc_omp_task_alloc() and before kmpc_omp_task() calls.
kmp_task_t *new_task = __kmpc_omp_task_alloc(ident_t *, kmp_int32 gtid, kmp_int32 flags, size_t sizeof_kmp_task_t, size_t sizeof_shareds, kmp_routine_entry_t *task_entry);

CopyConstructor(new_task->privates.var1, *new_task->shareds.var1_ref);
new_task->shareds.var1_ref = &new_task->privates.var1;
...
CopyConstructor(new_task->privates.varn, *new_task->shareds.varn_ref);
new_task->shareds.varn_ref = &new_task->privates.varn;

new_task->destructors = .omp_task_destructor.;
kmp_int32 __kmpc_omp_task(ident_t *, kmp_int32 gtid, kmp_task_t *new_task)
Differential Revision: http://reviews.llvm.org/D9370

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

9 years ago[MS ABI] Cleanup selectBasePath
David Majnemer [Tue, 5 May 2015 01:39:20 +0000 (01:39 +0000)]
[MS ABI] Cleanup selectBasePath

Handle some common cases quickly when deeper introspection into the path
has no effect on the final result.

No functional change intended.

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

9 years agoFix buffer overflow in Lexer
Kostya Serebryany [Mon, 4 May 2015 22:30:29 +0000 (22:30 +0000)]
Fix buffer overflow in Lexer

Summary:
Fix PR22407, where the Lexer overflows the buffer when parsing
 #include<\
(end of file after slash)

Test Plan:
Added a test that will trigger in asan build.
This case is also covered by the clang-fuzzer bot.

Reviewers: rnk

Reviewed By: rnk

Subscribers: cfe-commits

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

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

9 years ago[clang-fuzzer] make clang-fuzzer slightly faster by removing one redundant directory...
Kostya Serebryany [Mon, 4 May 2015 21:14:45 +0000 (21:14 +0000)]
[clang-fuzzer] make clang-fuzzer slightly faster by removing one redundant directory scan

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

9 years agoUpdate MSVC compatibility doc note about exceptions
Reid Kleckner [Mon, 4 May 2015 20:53:51 +0000 (20:53 +0000)]
Update MSVC compatibility doc note about exceptions

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

9 years ago[modules] Don't bother registering loaded macros if there are none.
Richard Smith [Mon, 4 May 2015 19:58:00 +0000 (19:58 +0000)]
[modules] Don't bother registering loaded macros if there are none.

We don't yet have a reduced testcase for this.

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

9 years agoR600: Add fma and ldexp asic specific feature macros
Jan Vesely [Mon, 4 May 2015 19:53:36 +0000 (19:53 +0000)]
R600: Add fma and ldexp asic specific feature macros

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236453 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MS ABI] Fix a crash in vptr path calculation
David Majnemer [Mon, 4 May 2015 18:47:54 +0000 (18:47 +0000)]
[MS ABI] Fix a crash in vptr path calculation

I discovered a case where the old algorithm would crash.  Instead of
trying to patch the algorithm, rewrite it.  The new algorithm operates
in three phases:
1. Find all paths to the subobject with the vptr.
2. Remove paths which are subsets of other paths.
3. Select the best path where 'best' is defined as introducing the most
   covariant overriders.  If two paths introduce different overriders,
   raise a diagnostic.

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

9 years agoGet rid of compiler warning.
Serge Pavlov [Mon, 4 May 2015 17:39:55 +0000 (17:39 +0000)]
Get rid of compiler warning.

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

9 years agoInstantiate incomplete class used in template method.
Serge Pavlov [Mon, 4 May 2015 16:44:39 +0000 (16:44 +0000)]
Instantiate incomplete class used in template method.

If a class is absent from instantiation and is incomplete, instantiate it as
an incomplete class thus avoiding compiler crash.

This change fixes PR18653.

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

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

9 years agoReapply "Frontend: Stop leaking when not -disable-free"
Duncan P. N. Exon Smith [Mon, 4 May 2015 14:59:20 +0000 (14:59 +0000)]
Reapply "Frontend: Stop leaking when not -disable-free"

This reverts commit r236422, effectively reapplying r236419.  ASan
helped me diagnose the problem: the non-leaking logic would free the
ASTConsumer before freeing Sema whenever `isCurrentASTFile()`, causing a
use-after-free in `Sema::~Sema()`.

This version unconditionally frees Sema and the ASTContext before
freeing the ASTConsumer.  Without the fix, these were either being freed
before the ASTConsumer was freed or leaked after, but they were always
spiritually released so this isn't really a functionality change.

I ran all of check-clang with ASan locally this time, so I'm hoping
there aren't any more problems lurking.

Original commit message:

    Try again to plug a leak that's been around since at least r128011
    after coming across the FIXME.  Nico Weber tried something similar
    in r207065 but had to revert in r207070 due to a bot failure.

    The build failure isn't visible anymore so I'm not sure what went
    wrong.  I'm doing this slightly differently -- when not
    -disable-free I'm still resetting the members (just not leaking
    them) -- so maybe it will work out this time?  Tests pass locally,
    anyway.

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

9 years ago[analyzer] scan-build: support spaces in compiler path and arguments.
Anton Yartsev [Mon, 4 May 2015 13:37:36 +0000 (13:37 +0000)]
[analyzer] scan-build: support spaces in compiler path and arguments.

This fixes errors that occur if a path to the default compiler has spaces or if an argument with spaces is given to compiler (e.g. via -I). (http://reviews.llvm.org/D9357)

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

9 years agoRevert "Frontend: Stop leaking when not -disable-free"
Duncan P. N. Exon Smith [Mon, 4 May 2015 13:01:42 +0000 (13:01 +0000)]
Revert "Frontend: Stop leaking when not -disable-free"

This reverts commit r236419, since it caused some bots to fail.  On:

http://lab.llvm.org:8011/builders/clang-hexagon-elf/builds/26124
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/35086

these tests:

FAIL: Clang::import-decl.cpp
FAIL: Clang::floating-literal.c
FAIL: Clang::x86_64-linux-android.c

fail with this output:

Command Output (stderr):
--
Stack dump:
0.  Program arguments: /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/clang -cc1 -internal-isystem /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/../lib/clang/3.7.0/include -nostdsysteminc -ast-print -x ast -
/var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/tools/clang/test/Modules/Output/import-decl.cpp.script: line 3:  9665 Segmentation fault      (core dumped) /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/clang -cc1 -internal-isystem /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/../lib/clang/3.7.0/include -nostdsysteminc -ast-print -x ast - < /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/tools/clang/test/Modules/Output/import-decl.cpp.tmp.ast
      9666 Done                    | /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.obj/Release+Asserts/bin/FileCheck /var/lib/buildbot/slaves/hexagon-build-03/clang-hexagon-elf/llvm.src/tools/clang/test/Modules/import-decl.cpp

--

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

9 years agoFrontend: Stop leaking when not -disable-free
Duncan P. N. Exon Smith [Mon, 4 May 2015 12:36:56 +0000 (12:36 +0000)]
Frontend: Stop leaking when not -disable-free

Try again to plug a leak that's been around since at least r128011 after
coming across the FIXME.  Nico Weber tried something similar in r207065
but had to revert in r207070 due to a bot failure.

The build failure isn't visible anymore so I'm not sure what went wrong.
I'm doing this slightly differently -- when not -disable-free I'm still
resetting the members (just not leaking them) -- so maybe it will work
out this time?  Tests pass locally, anyway.

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

9 years agoclang-format: NFC: Delete FormatToken::IsForEachMacro. Use a TokenType instead.
Daniel Jasper [Mon, 4 May 2015 09:22:29 +0000 (09:22 +0000)]
clang-format: NFC: Delete FormatToken::IsForEachMacro. Use a TokenType instead.

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

9 years agoclang-format: NFC: Use default member initializers and other cleanups.
Daniel Jasper [Mon, 4 May 2015 08:51:40 +0000 (08:51 +0000)]
clang-format: NFC: Use default member initializers and other cleanups.

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

9 years agoclang-format: Force aligning different brackets relative to each other.
Daniel Jasper [Mon, 4 May 2015 07:39:00 +0000 (07:39 +0000)]
clang-format: Force aligning different brackets relative to each other.

Before:
  void SomeFunction(vector< // break
      int> v);

After:
  void SomeFunction(vector< // break
                        int> v);

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

9 years agoMention PPCallbacks interface change in release notes.
Richard Smith [Mon, 4 May 2015 03:18:47 +0000 (03:18 +0000)]
Mention PPCallbacks interface change in release notes.

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

9 years agoSwitch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in...
Richard Smith [Mon, 4 May 2015 03:15:40 +0000 (03:15 +0000)]
Switch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in order to preserve full information on module macro expansion.

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

9 years agoRename MacroDefinition -> MacroDefinitionRecord, Preprocessor::MacroDefinition -...
Richard Smith [Mon, 4 May 2015 02:25:31 +0000 (02:25 +0000)]
Rename MacroDefinition -> MacroDefinitionRecord, Preprocessor::MacroDefinition -> MacroDefinition.

clang::MacroDefinition now models the currently-defined value of a macro. The
previous MacroDefinition type, which represented a record of a macro definition
directive for a detailed preprocessing record, is now called MacroDefinitionRecord.

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

9 years agoclang-format function definition header. NFC.
Yaron Keren [Sat, 2 May 2015 19:29:29 +0000 (19:29 +0000)]
clang-format function definition header. NFC.

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

9 years agoReplace GetNumBytesInBuffer() in MicrosoftCXXNameMangler::mangleArgumentType by tell().
Yaron Keren [Sat, 2 May 2015 15:31:08 +0000 (15:31 +0000)]
Replace GetNumBytesInBuffer() in MicrosoftCXXNameMangler::mangleArgumentType by tell().

Using GetNumBytesInBuffer() assumes that the stream was not flushed between
the GetNumBytesInBuffer() calls, which may happen to be true or not,
depending on stream policy. tell() always reports the correct stream location.

Do note there are only two more uses of GetNumBytesInBuffer() in LLVM+clang, in
lib/MC/MCAsmStreamer.cpp and lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp.
The former may be replacable by tell (needs testing) but while the later can
not be immediatly replaced by tell() as it uses the absolute value of
GetNumBytesInBuffer() rather than the real stream position. Both uses seems
to depend upon flush policy and thus may not work correctly depending upon the
stream behaviour.

Going forward, GetNumBytesInBuffer() should probably be protected, non-accessible
to raw_ostream clients.

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

9 years agoclang-format: [JS] Fix calculation of template string width.
Daniel Jasper [Sat, 2 May 2015 08:05:38 +0000 (08:05 +0000)]
clang-format: [JS] Fix calculation of template string width.

OriginalColumn might not be set, so fall back to Location and SourceMgr
in case it is missing. Also initialize end column in case the token is
multi line, but it's the ` token itself that starts the multi line.

Patch by Martin Probst, thank you!

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

9 years agoclang-format: [JS] Fix templated parameter default values.
Daniel Jasper [Sat, 2 May 2015 07:54:58 +0000 (07:54 +0000)]
clang-format: [JS] Fix templated parameter default values.

Parameters can have templated types and default values (= ...), which is
another location in which a template closer should be followed by
whitespace.

Patch by Martin Probst, thank you.

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

9 years ago[MS ABI] Add testcase which was missing from r236354
David Majnemer [Sat, 2 May 2015 05:12:53 +0000 (05:12 +0000)]
[MS ABI] Add testcase which was missing from r236354

This test verifies that we can detect when the inheritance paths are
ambiguous due to covariant thunks, ensuring we don't regress PR16759.

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

9 years agoInstrProf: Cede ownership of createProfileWeights to CGF
Justin Bogner [Sat, 2 May 2015 05:00:55 +0000 (05:00 +0000)]
InstrProf: Cede ownership of createProfileWeights to CGF

The fact that PGO has a say in how these branch weights are determined
isn't interesting to most of CodeGen, so it makes more sense for this
API to be accessible via CodeGenFunction rather than CodeGenPGO.

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

9 years ago[modules] Remove dead code from Module for tracking macro import locations.
Richard Smith [Sat, 2 May 2015 02:08:26 +0000 (02:08 +0000)]
[modules] Remove dead code from Module for tracking macro import locations.

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

9 years ago[modules] Don't bother creating a ModuleMacro representing a #undef that overrides...
Richard Smith [Sat, 2 May 2015 01:14:40 +0000 (01:14 +0000)]
[modules] Don't bother creating a ModuleMacro representing a #undef that overrides nothing.

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

9 years agoFix -fobjc-arc doesn't work with -save-temps
Steven Wu [Sat, 2 May 2015 00:56:15 +0000 (00:56 +0000)]
Fix -fobjc-arc doesn't work with -save-temps

The underlying problem is that there is currently no way to run
ObjCARCContract from llvm bitcode which is required by ObjC ARC.
This fix the problem by always enable ObjCARCContract pass if
optimization is enabled. The ObjCARC Contract pass has almost no
overhead on code that is not using ARC.

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

9 years agoDiagnose delayed typos when parsing a postfix expression with an
Kaelyn Takata [Sat, 2 May 2015 00:49:18 +0000 (00:49 +0000)]
Diagnose delayed typos when parsing a postfix expression with an
unmatched l_paren before setting the LHS to ExprError().

Fixes PR23285.

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

9 years agoInstrProf: Use a locally tracked current count in ComputeRegionCounts
Justin Bogner [Sat, 2 May 2015 00:48:27 +0000 (00:48 +0000)]
InstrProf: Use a locally tracked current count in ComputeRegionCounts

No functional change. This just makes it more obvious that the logic
in ComputeRegionCounts only depends on the counter map and local
state.

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

9 years ago[modules] If a module #includes a modular header that #undef's its macro, it
Richard Smith [Sat, 2 May 2015 00:45:56 +0000 (00:45 +0000)]
[modules] If a module #includes a modular header that #undef's its macro, it
should not export the macro.

... at least, not unless we have local submodule visibility enabled.

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

9 years agoInstrProf: Replace the RegionCounter class with a simpler direct approach
Justin Bogner [Fri, 1 May 2015 23:41:09 +0000 (23:41 +0000)]
InstrProf: Replace the RegionCounter class with a simpler direct approach

This removes the RegionCounter class, which is only used as a helper
in teh ComputeRegionCounts stmt visitor. This class is just an extra
layer of abstraction that makes the code harder to follow at this
point, and removing it makes the logic quite a bit more direct.

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

9 years agoInstrProf: Add a couple of checks to this test
Justin Bogner [Fri, 1 May 2015 22:52:48 +0000 (22:52 +0000)]
InstrProf: Add a couple of checks to this test

"Don't crash" tests are silly, we might as well check that the
counters are consistent here.

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

9 years agoRemove some code left around for debugging purposes
David Majnemer [Fri, 1 May 2015 21:42:19 +0000 (21:42 +0000)]
Remove some code left around for debugging purposes

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

9 years ago[MS ABI] Detect and diagnose vftables which cannot be created
David Majnemer [Fri, 1 May 2015 21:35:45 +0000 (21:35 +0000)]
[MS ABI] Detect and diagnose vftables which cannot be created

The MSVC ABI has a bug introduced by appending to the end of vftables
which come from virtual bases: covariant thunks introduces via
non-overlapping regions of the inheritance lattice both append to the
same slot in the vftable.

It is possible to generate correct vftables in cases where one node in
the lattice completely dominates the other on the way to the base with
the vfptr; in all other cases, we must raise a diagnostic in order to
prevent the illusion that we succeeded in laying out the vftable.

This fixes PR16759.

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

9 years ago[MS ABI] NV bases may indirectly contain covariant thunks from V Bases
David Majnemer [Fri, 1 May 2015 21:35:41 +0000 (21:35 +0000)]
[MS ABI] NV bases may indirectly contain covariant thunks from V Bases

A class might contain multiple ways of getting to a vbase, some of which
are virtual and other non-virtual.  It may be the case that a
non-virtual base contains an override of a method in a vbase.  This
means that we must carefully pick between a set of nvbases to determine
which is the best.

As a consequence, the findPathForVPtr algorithm is considerably simpler.

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

9 years ago[modules] Add -fmodules-local-submodule-visibility flag.
Richard Smith [Fri, 1 May 2015 21:22:17 +0000 (21:22 +0000)]
[modules] Add -fmodules-local-submodule-visibility flag.

This flag specifies that the normal visibility rules should be used even for
local submodules (submodules of the currently-being-built module). Thus names
will only be visible if a header / module that declares them has actually been
included / imported, and not merely because a submodule that happened to be
built earlier declared those names. This also removes the need to modularize
bottom-up: textually-included headers will be included into every submodule
that includes them, since their include guards will not leak between modules.

So far, this only governs visibility of macros, not of declarations, so is not
ready for real use yet.

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

9 years agoARM: merge Cyclone into other ARMv8 CPUs and add tests for features.
Tim Northover [Fri, 1 May 2015 21:17:25 +0000 (21:17 +0000)]
ARM: merge Cyclone into other ARMv8 CPUs and add tests for features.

Cyclone actually supports all the goodies you'd expect to come with an AArch64
CPU, so it doesn't need its own clause. Also we should probably be testing
these clauses.

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

9 years agoAlso correct typos in the middle of a ternary expression when the RHS is invalid.
Kaelyn Takata [Fri, 1 May 2015 20:59:18 +0000 (20:59 +0000)]
Also correct typos in the middle of a ternary expression when the RHS is invalid.

The LHS was already being corrected before being set to ExprError when
the RHS is invalid, but when it was present the middle of a ternary
expression would be dropped in the error paths.

Fixes PR23350.

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

9 years agoAdjust the wording of the "brackets go after the unqualified-id" error message. It...
Nick Lewycky [Fri, 1 May 2015 20:47:19 +0000 (20:47 +0000)]
Adjust the wording of the "brackets go after the unqualified-id" error message. It applies in cases that aren't unqualified-ids.

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

9 years agoSuppress clang/test/OpenMP/task_private_codegen.cpp on win32 for now. Investigating.
NAKAMURA Takumi [Fri, 1 May 2015 19:44:13 +0000 (19:44 +0000)]
Suppress clang/test/OpenMP/task_private_codegen.cpp on win32 for now. Investigating.

I'm dubious in weird behavior with CHECK-DAG.

Also, it won't "REQUIRE non-ms-sdk". All of RUNs have "-triple darwin".

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