]> granicus.if.org Git - clang/log
clang
10 years agoRemove this pointer that is converted to bool. In well-defined contexts, the
Richard Trieu [Fri, 1 Aug 2014 01:42:01 +0000 (01:42 +0000)]
Remove this pointer that is converted to bool.  In well-defined contexts, the
this pointer is always non-null.  If the this pointer is null, it is undefined
and the compiler may optimize it away by assuming it is non-null.  The null
checks are pushed into the callers.

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

10 years agoclang-format vs plugin: claim support for VS 14 CTP too
Hans Wennborg [Fri, 1 Aug 2014 00:02:24 +0000 (00:02 +0000)]
clang-format vs plugin: claim support for VS 14 CTP too

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

10 years agoFix buildbot: work around missing GCC C++11 feature.
Richard Smith [Thu, 31 Jul 2014 23:52:38 +0000 (23:52 +0000)]
Fix buildbot: work around missing GCC C++11 feature.

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

10 years ago[modules] Maintain an AST invariant across module load/save: if any declaration
Richard Smith [Thu, 31 Jul 2014 23:46:44 +0000 (23:46 +0000)]
[modules] Maintain an AST invariant across module load/save: if any declaration
of a function has a resolved exception specification, then all declarations of
the function do.

We should probably improve the AST representation to make this implicit (perhaps
only store the exception specification on the canonical declaration), but this
fixes things for now.

The testcase for this (which used to assert) also exposes the actual bug I was
trying to reduce here: we sometimes fail to emit the body of an imported
special member function definition. Fix for that to follow.

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

10 years agoFactor out exception specification information from
Richard Smith [Thu, 31 Jul 2014 21:57:55 +0000 (21:57 +0000)]
Factor out exception specification information from
FunctionProtoType::ExtProtoInfo. Most of the users of these fields don't care
about the other ExtProtoInfo bits and just want to talk about the exception
specification.

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

10 years agoLoop hint pragmas sometimes do not contain an identifier option (such as #pragma...
Aaron Ballman [Thu, 31 Jul 2014 21:24:32 +0000 (21:24 +0000)]
Loop hint pragmas sometimes do not contain an identifier option (such as #pragma unroll(4)). Check explicitly that the token we stored was an identifier.

Amends r214432

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

10 years agoImplemented a diagnostic to handle multiple, distinct ownership_return attributes...
Aaron Ballman [Thu, 31 Jul 2014 20:44:26 +0000 (20:44 +0000)]
Implemented a diagnostic to handle multiple, distinct ownership_return attributes on the same declaration. This removes a FIXME from the code.

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

10 years agoAdd a state variable to the loop hint attribute.
Tyler Nowicki [Thu, 31 Jul 2014 20:15:14 +0000 (20:15 +0000)]
Add a state variable to the loop hint attribute.

This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler.

Resubmit with changes to try to fix the build-bot issue.

Reviewed by Aaron Ballman

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

10 years agoLocal extern redeclarations of dllimport variables stay dllimport even if they don...
Hans Wennborg [Thu, 31 Jul 2014 19:29:39 +0000 (19:29 +0000)]
Local extern redeclarations of dllimport variables stay dllimport even if they don't specify the attribute

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

10 years agoReformat docstring to 80-col
Eli Bendersky [Thu, 31 Jul 2014 18:12:17 +0000 (18:12 +0000)]
Reformat docstring to 80-col

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

10 years agoRemoving an outdated FIXME. No functional changes.
Aaron Ballman [Thu, 31 Jul 2014 18:09:13 +0000 (18:09 +0000)]
Removing an outdated FIXME. No functional changes.

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

10 years agoExposes a C API to name mangling for a given cursor.
Eli Bendersky [Thu, 31 Jul 2014 18:04:56 +0000 (18:04 +0000)]
Exposes a C API to name mangling for a given cursor.

Inspired by https://gist.github.com/tritao/2766291, and was previously discussed
on cfe-dev: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-June/037577.html

Adding testing capability via c-index-test.

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

10 years agoObective-C. Patch to fix the incorrect ObjcMessageExpr argument source ranges,
Fariborz Jahanian [Thu, 31 Jul 2014 17:39:50 +0000 (17:39 +0000)]
Obective-C. Patch to fix the incorrect ObjcMessageExpr argument source ranges,
when arguments are structures or classes. PR16392.
patch by Karlis Senko

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

10 years agoDelay check for prototype on __fastcall functions until after MergeFunctionDecl.
Nico Weber [Thu, 31 Jul 2014 17:19:18 +0000 (17:19 +0000)]
Delay check for prototype on __fastcall functions until after MergeFunctionDecl.

In C, it is only known after merging decls if a function with 0 arguments has
a prototype.  Fixes PR20386, see that for more notes.

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

10 years agoAutomate attribute argument count semantic checking when there are variadic or option...
Aaron Ballman [Thu, 31 Jul 2014 16:37:04 +0000 (16:37 +0000)]
Automate attribute argument count semantic checking when there are variadic or optional arguments present. With this, the only time you should have to manually check attribute argument counts is when HasCustomParsing is set to true, or when you have variadic arguments that aren't really variadic (like ownership_holds and friends).

Updating the diagnostics in the launch_bounds test since they have been improved in that case. Adding a test for nonnull since it has little test coverage, but has truly variadic arguments.

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

10 years agoms-inline-asm: Add a test to ensure that call doesn't clobber eax.
Ehsan Akhgari [Thu, 31 Jul 2014 13:43:17 +0000 (13:43 +0000)]
ms-inline-asm: Add a test to ensure that call doesn't clobber eax.

Note that it's not clear whether this is the right behavior, please see
the review for the discussion.

Reviewers: rnk

Subscribers: cfe-commits

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

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

10 years agoFix parsing of classes where the class name is an absolute nested name specifier.
Manuel Klimek [Thu, 31 Jul 2014 07:19:30 +0000 (07:19 +0000)]
Fix parsing of classes where the class name is an absolute nested name specifier.

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

10 years agoPR18097: Support initializing an _Atomic(T) from an object of C++ class type T
Richard Smith [Thu, 31 Jul 2014 06:31:19 +0000 (06:31 +0000)]
PR18097: Support initializing an _Atomic(T) from an object of C++ class type T
or a class derived from T. We already supported this when initializing
_Atomic(T) from T for most (and maybe all) other reasonable values of T.

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

10 years agoSema: Disallow taking the address of a bitfield coming from preincrement
David Majnemer [Thu, 31 Jul 2014 04:52:13 +0000 (04:52 +0000)]
Sema: Disallow taking the address of a bitfield coming from preincrement

Clang forgot that '++s.m' was a bitfield l-value and permit it's address
to be taken; this would crash at CodeGen-time.

Instead, propagate the object-kind when we see the prefix
increment/decrement.

This fixes PR20496.

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

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

10 years ago[AVX512] Add unaligned FP load intrinsics
Adam Nemet [Thu, 31 Jul 2014 04:00:39 +0000 (04:00 +0000)]
[AVX512] Add unaligned FP load intrinsics

Part of <rdar://problem/17688758>

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

10 years agoRevert r214333, "Add a state variable to the loop hint attribute."
NAKAMURA Takumi [Thu, 31 Jul 2014 01:52:33 +0000 (01:52 +0000)]
Revert r214333, "Add a state variable to the loop hint attribute."

It brought undefined behavior.

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

10 years agoRename this test so that it actually runs, and fix it so that it passes.
Richard Smith [Thu, 31 Jul 2014 00:22:56 +0000 (00:22 +0000)]
Rename this test so that it actually runs, and fix it so that it passes.

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

10 years agoUpdating a comment related to the implementation of -Woverloaded-virtual, and adding...
Aaron Ballman [Wed, 30 Jul 2014 23:50:53 +0000 (23:50 +0000)]
Updating a comment related to the implementation of -Woverloaded-virtual, and adding a FIXME to a test case. (Drive-by removal of trailing whitespace in the test case as well.)

No functional changes.

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

10 years agoUpdate for llvm change.
Rafael Espindola [Wed, 30 Jul 2014 22:52:16 +0000 (22:52 +0000)]
Update for llvm change.

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

10 years agoAdd a state variable to the loop hint attribute.
Tyler Nowicki [Wed, 30 Jul 2014 20:54:33 +0000 (20:54 +0000)]
Add a state variable to the loop hint attribute.

This patch is necessary to support constant expressions which replaces the integer value in the loop hint attribute with an expression. The integer value was also storing the pragma’s state for options like vectorize(enable/disable) and the pragma unroll and nounroll directive. The state variable is introduced to hold the state of those options/pragmas. This moves the validation of the state (keywords) from SemaStmtAttr handler to the loop hint annotation token handler.

Reviewed by Aaron Ballman

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

10 years ago[AVX512] Add intrinsic for knot
Adam Nemet [Wed, 30 Jul 2014 16:51:27 +0000 (16:51 +0000)]
[AVX512] Add intrinsic for knot

Part of <rdar://problem/17688758>

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

10 years ago[AVX512] Add some of the FP cast intrinsics
Adam Nemet [Wed, 30 Jul 2014 16:51:24 +0000 (16:51 +0000)]
[AVX512] Add some of the FP cast intrinsics

Part of <rdar://problem/17688758>

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

10 years ago[AVX512] Add set1 intrinsics
Adam Nemet [Wed, 30 Jul 2014 16:51:22 +0000 (16:51 +0000)]
[AVX512] Add set1 intrinsics

(Dropped the byte and word variants from the patch.  Turns out these are not
part of AVX512F but only AVX512BW/VL.)

Part of <rdar://problem/17688758>

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

10 years agoAdd OpenCL/SPIR kernel_arg_base_type metadata node
Fraser Cormack [Wed, 30 Jul 2014 14:39:53 +0000 (14:39 +0000)]
Add OpenCL/SPIR kernel_arg_base_type metadata node

As defined in the SPIR 1.2 specification, this node behaves similarly to
kernel_arg_type but will print the underlying type name, e.g., without
typedefs.

Example:
  typedef unsigned int myunsignedint;
would report:
  'myunsignedint' in the kernel_arg_type node
  'uint' in the kernel_arg_base_type node

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

10 years ago[SKX] Enabling SKX target (Skylake server chip)
Robert Khasanov [Wed, 30 Jul 2014 13:53:40 +0000 (13:53 +0000)]
[SKX] Enabling SKX target (Skylake server chip)
a) add SKX support to Clang driver;
b) add tests for SKX target and AVX512BW, AVX512DQ, AVX512VL features into clang driver tests

Patch by Zinovy Nis <zinovy.y.nis@intel.com>

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

10 years agoFix OpenCL/SPIR kernel_arg_type metadata node
Fraser Cormack [Wed, 30 Jul 2014 13:41:12 +0000 (13:41 +0000)]
Fix OpenCL/SPIR kernel_arg_type metadata node

This fixes a bug where kernel_arg_type was always changing 'unsigned ' to 'u'
for any parameter type, including non-canonical types.

Example:
  typedef unsigned int myunsignedint;
would report:
  "myunt"

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

10 years agoSuppress clang/test/Sema/struct-packed-align.c also on msvc for investigating.
NAKAMURA Takumi [Wed, 30 Jul 2014 12:17:38 +0000 (12:17 +0000)]
Suppress clang/test/Sema/struct-packed-align.c also on msvc for investigating.

FIXME: This test is incompatible to MS compat mode.
FIXME: Don't suppress this also on mingw. :-p

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

10 years agoclang-format: Understand 'typename' in placement new.
Daniel Jasper [Wed, 30 Jul 2014 12:14:10 +0000 (12:14 +0000)]
clang-format: Understand 'typename' in placement new.

Before:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaa)) typename aaaaaaaaaaaaaaaaaaaaaaaa();

After:
  new (aaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaa))
      typename aaaaaaaaaaaaaaaaaaaaaaaa();

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

10 years agoSuppress clang/test/Sema/struct-packed-align.c for targeting LLP64.
NAKAMURA Takumi [Wed, 30 Jul 2014 10:44:35 +0000 (10:44 +0000)]
Suppress clang/test/Sema/struct-packed-align.c for targeting LLP64.

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

10 years ago[Driver][Mips] Add function-wrapper so simplify creation of `Multilib` objects.
Simon Atanasyan [Wed, 30 Jul 2014 09:15:10 +0000 (09:15 +0000)]
[Driver][Mips] Add function-wrapper so simplify creation of `Multilib` objects.

No functional changes.

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

10 years agoAST: Simplify some code
David Majnemer [Wed, 30 Jul 2014 08:42:33 +0000 (08:42 +0000)]
AST: Simplify some code

Iterator invalidation issues already force us to do one lookup and one
insert.
Don't use the particular bit-pattern of the 'Align' field to determine
whether or not we have already inserted into the TypeInfo DenseMap;
instead ask for an iterator to the TypeInfo entry.

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

10 years agoFix some cases of incorrect handling of lifetime extended temporaries.
Manuel Klimek [Wed, 30 Jul 2014 08:34:42 +0000 (08:34 +0000)]
Fix some cases of incorrect handling of lifetime extended temporaries.

MaterializeTemporaryExpr already contains information about the lifetime
of the temporary; if the lifetime is not the full statement, we do not
want to emit a destructor at the end of the full statement for it.

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

10 years agoMS ABI: Mangle alias templates used as template-template arguments
David Majnemer [Wed, 30 Jul 2014 08:20:03 +0000 (08:20 +0000)]
MS ABI: Mangle alias templates used as template-template arguments

A templated using declaration may be used as a template-template
argument.

Unfortunately, the VS "14" chooses '?' as the sole marker for the
argument.  This is problematic because it presupposes the possibility of
using more than one template-aliases as arguments to the same template.

This fixes PR20047.

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

10 years agoSimplify the code.
Rafael Espindola [Wed, 30 Jul 2014 04:40:23 +0000 (04:40 +0000)]
Simplify the code.

Thanks to David Balkie for the suggestion.

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

10 years agoFix a use after free bug.
Rafael Espindola [Wed, 30 Jul 2014 02:37:26 +0000 (02:37 +0000)]
Fix a use after free bug.

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

10 years agoMS ABI: Consider alignment attributes on typedefs for layout
David Majnemer [Wed, 30 Jul 2014 01:30:47 +0000 (01:30 +0000)]
MS ABI: Consider alignment attributes on typedefs for layout

The MS ABI has a notion of 'required alignment' for fields; this
alignment supercedes pragma pack directives.

MSVC takes into account alignment attributes on typedefs when
determining whether or not a field has a certain required alignment.

Do the same in clang by tracking whether or not we saw such an attribute
when calculating the type's bitwidth and alignment.

This fixes PR20418.

Reviewers: rnk

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

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

10 years agoNot all instantiated variable is odr-used. Do not mark non-odr-used variable template...
Larisse Voufo [Wed, 30 Jul 2014 00:49:55 +0000 (00:49 +0000)]
Not all instantiated variable is odr-used. Do not mark non-odr-used variable template specializations as such.

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

10 years ago[modules] Factor out ODR checking, to avoid unnecessary repeated work in
Richard Smith [Tue, 29 Jul 2014 23:23:27 +0000 (23:23 +0000)]
[modules] Factor out ODR checking, to avoid unnecessary repeated work in
finishPendingActions loop.

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

10 years agoclang-format vs plugin: include the license
Hans Wennborg [Tue, 29 Jul 2014 22:34:53 +0000 (22:34 +0000)]
clang-format vs plugin: include the license

The vsix installer will show the license when it starts, and it
would print an annoying message when there was none.

While we're here, add a MoreInfoUrl.

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

10 years agoPR20473: Don't "deduplicate" string literals with the same value but different
Richard Smith [Tue, 29 Jul 2014 21:20:12 +0000 (21:20 +0000)]
PR20473: Don't "deduplicate" string literals with the same value but different
lengths! In passing, simplify string literal deduplication by relying on LLVM
to deduplicate the underlying constant values.

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

10 years agoSupport LIBRARY_PATH on all Darwin targets.
Bob Wilson [Tue, 29 Jul 2014 20:17:52 +0000 (20:17 +0000)]
Support LIBRARY_PATH on all Darwin targets.

r197490 changed the behavior of LIBRARY_PATH to try to match GCC's behavior
for cross compilers and make clang work better on "bare metal" targets.
Unfortunately that change is breaking a number of MacPorts projects because
the LIBRARY_PATH environment variable is being ignored when compiling on a
64-bit host for a 32-bit target. Because the host and target architectures
differ, isCrossCompiling returns true. This does not make sense for Darwin,
where multiple architectures are supported natively via "fat" Mach-O slices
and where development is generally done against SDKs regardless. This patch
fixes the problem by overriding isCrossCompiling to return false for Darwin
toolchains.

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

10 years agoProvide warning name for property attribute warning
Fariborz Jahanian [Tue, 29 Jul 2014 19:45:49 +0000 (19:45 +0000)]
Provide warning name for property attribute warning
mismatch. //rdar://17845264

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

10 years agoRevert "Fix test case in r214190. (It failed on my end.)"
Larisse Voufo [Tue, 29 Jul 2014 19:28:40 +0000 (19:28 +0000)]
Revert "Fix test case in r214190. (It failed on my end.)"

This was an accident.

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

10 years agoFix test case in r214190. (It failed on my end.)
Larisse Voufo [Tue, 29 Jul 2014 19:15:27 +0000 (19:15 +0000)]
Fix test case in r214190. (It failed on my end.)

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

10 years agoFix typo.
Larisse Voufo [Tue, 29 Jul 2014 18:45:54 +0000 (18:45 +0000)]
Fix typo.

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

10 years agoFix PR10177 where non-type template arguments to alias templates are not marked as...
Larisse Voufo [Tue, 29 Jul 2014 18:44:19 +0000 (18:44 +0000)]
Fix PR10177 where non-type template arguments to alias templates are not marked as used in dependent contexts. The fix actually forces non-dependent names to be checked at template definition time as expected from the standard.

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

10 years ago[Debug Info] update testing case due to change in DIBuilder.
Manman Ren [Tue, 29 Jul 2014 18:21:00 +0000 (18:21 +0000)]
[Debug Info] update testing case due to change in DIBuilder.

This is the paired commit with llvm r214189.

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

10 years agoModify how the loop hint attribute is printed as a lead-up to supporting constant...
Tyler Nowicki [Tue, 29 Jul 2014 17:21:32 +0000 (17:21 +0000)]
Modify how the loop hint attribute is printed as a lead-up to supporting constant expression values.

Reviewed by Aaron Ballman

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

10 years agoDataflowWorklist.h - "We should have a description here of what this code does, not...
Artyom Skrobov [Tue, 29 Jul 2014 16:10:25 +0000 (16:10 +0000)]
DataflowWorklist.h - "We should have a description here of what this code does, not just where it's used."

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

10 years agoAArch64: Resolve some FIXMEs in CGBuiltin left over from backend merge
Yi Kong [Tue, 29 Jul 2014 09:25:17 +0000 (09:25 +0000)]
AArch64: Resolve some FIXMEs in CGBuiltin left over from backend merge

Merge vrshr_n_v and vqshlu_n_v with ARM.

Remove FIXME comments for others as they can't actually be shared.

NFC.

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

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

10 years ago[OPENMP] Additional comments for implicit 'flush' clause + removed unused parameter...
Alexey Bataev [Tue, 29 Jul 2014 09:17:39 +0000 (09:17 +0000)]
[OPENMP] Additional comments for implicit 'flush' clause + removed unused parameter from method classof().

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

10 years ago3.5 => 3.6
Sylvestre Ledru [Tue, 29 Jul 2014 07:07:31 +0000 (07:07 +0000)]
3.5 => 3.6

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

10 years agoRevert "Emit column debug information for loads"
Tobias Grosser [Tue, 29 Jul 2014 06:53:14 +0000 (06:53 +0000)]
Revert "Emit column debug information for loads"

This broke the following gdb tests:

gdb.base__annota1.exp
gdb.base__consecutive.exp
gdb.python__py-symtab.exp
gdb.reverse__consecutive-precsave.exp
gdb.reverse__consecutive-reverse.exp

I will look into this.

This reverts commit 214162.

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

10 years agoEmit column debug information for loads
Tobias Grosser [Tue, 29 Jul 2014 06:10:47 +0000 (06:10 +0000)]
Emit column debug information for loads

This allows us to give more precise diagnostics.

Diego kindly tested the impact on debug info size: "The increase on average
debug sizes is 0.1%. The total file size increase is ~0%."

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

10 years ago[modules] Add testcase for a bug reduced from a selfhost issue. This bug was
Richard Smith [Tue, 29 Jul 2014 00:58:01 +0000 (00:58 +0000)]
[modules] Add testcase for a bug reduced from a selfhost issue. This bug was
never present in Clang trunk, but was present in some of my development work,
and it seems like a useful test to have.

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

10 years agoRevert accidentally-committed files in r214151.
Richard Smith [Tue, 29 Jul 2014 00:54:09 +0000 (00:54 +0000)]
Revert accidentally-committed files in r214151.

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

10 years ago[modules] Add missing #include, found by modules build. We need a class
Richard Smith [Tue, 29 Jul 2014 00:51:47 +0000 (00:51 +0000)]
[modules] Add missing #include, found by modules build. We need a class
definition in order to apply isa<...>.

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

10 years agoFix up handling of ARM options for controlling strict alignment.
Bob Wilson [Tue, 29 Jul 2014 00:23:18 +0000 (00:23 +0000)]
Fix up handling of ARM options for controlling strict alignment.

The -mstrict-align option was originally added in r167619 as a target-
independent option. It was then changed in r167623 to be implemented with an
ARM-specific backend option, even though the code remained in the
target-independent Clang::ConstructJob function. This means that if you used
the -mstrict-align option with a non-ARM target, you would still get the
-arm-strict-align option getting passed to the backend, which was harmless
but gross. The driver option was then replaced by the GCC-compatible
-m[no-]unaligned-access option (r189175) and modified to work with AArch64
(r208075). However, in the process, the help text for -mstrict-align was
incorrectly changed to show it as only being supported for AArch64. Even worse,
the logic for handling these options together with -mkernel was wrong for
AArch64, where -mkernel does not currently imply strict alignment.

This patch fixes up all of those things. Besides the obvious change to the
option help text, it moves the logic into the ARM and AArch64-specific parts
of the driver, so that the option will be correctly ignored for non-ARM
targets. <rdar://problem/17823697>

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

10 years agoAdd a location to MS inline asm blobs
Reid Kleckner [Mon, 28 Jul 2014 23:12:59 +0000 (23:12 +0000)]
Add a location to MS inline asm blobs

This isn't nearly as elaborate as the GCC inline asm which emits an
array of source locations, but it's very, very hard to trigger backend
diagnostics in MS inline asm because we parse it up front with good
source information, unlike GCC inline asm.

Currently I can trigger a "inline assembly requires more registers than
available" diagnostic with this code:

  void foo();
  void bar() {
    __asm pusha
    __asm call foo
    __asm popa
  }

However, if I committed that as a test case, I would have to remove it
once I fix PR20052.

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

10 years agoRemove a nonsense friend declaration.
Richard Smith [Mon, 28 Jul 2014 22:42:21 +0000 (22:42 +0000)]
Remove a nonsense friend declaration.

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

10 years ago[Debug Info] add DISubroutineType and its creation takes DITypeArray.
Manman Ren [Mon, 28 Jul 2014 22:24:34 +0000 (22:24 +0000)]
[Debug Info] add DISubroutineType and its creation takes DITypeArray.

This is the last patch to unique the type array of a subroutine type.
This is the paired commit with llvm r214132.

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

10 years ago[modules] PR20475: merging support for alias template declarations.
Richard Smith [Mon, 28 Jul 2014 21:16:37 +0000 (21:16 +0000)]
[modules] PR20475: merging support for alias template declarations.

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

10 years agoChange __INTx_TYPE__ to be always signed. This changes the value for
Joerg Sonnenberger [Mon, 28 Jul 2014 21:06:22 +0000 (21:06 +0000)]
Change __INTx_TYPE__ to be always signed. This changes the value for
char-based types from "char" to "signed char". Adjust stdint.h to use
__INTx_TYPE__ directly without prefixing it with signed and to use
__UINTx_TYPE__ for unsigned ones.

The value of __INTx_TYPE__ now matches GCC.

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

10 years ago[Debug Info] rename getTypeArray to getElements, setTypeArray to setArrays.
Manman Ren [Mon, 28 Jul 2014 19:14:41 +0000 (19:14 +0000)]
[Debug Info] rename getTypeArray to getElements, setTypeArray to setArrays.

This is the paired commit with llvm r214112.

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

10 years agoAdd another keyword-selection flag to CorrectionCandidateCallback.
Kaelyn Takata [Mon, 28 Jul 2014 18:14:02 +0000 (18:14 +0000)]
Add another keyword-selection flag to CorrectionCandidateCallback.

The new flag, WantFunctionLikeCasts, covers a subset of the keywords
covered by WantTypeSpecifiers that can be used in casts that look like
function calls, e.g. "return long(5);", while excluding the keywords
like "enum" and "const" that would be included when WantTypeSpecifiers
is true but cannot be used in something that looks like a function call.

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

10 years agoFix MSVC warnings about falling off the end of a non-void function
Reid Kleckner [Mon, 28 Jul 2014 17:48:12 +0000 (17:48 +0000)]
Fix MSVC warnings about falling off the end of a non-void function

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

10 years ago[AVX512] Add non-masking FP store intrinsics
Adam Nemet [Mon, 28 Jul 2014 17:14:45 +0000 (17:14 +0000)]
[AVX512] Add non-masking FP store intrinsics

Part of <rdar://problem/17688758>

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

10 years ago[AVX512] Add FP add/sub/mul intrinsics
Adam Nemet [Mon, 28 Jul 2014 17:14:42 +0000 (17:14 +0000)]
[AVX512] Add FP add/sub/mul intrinsics

Part of <rdar://problem/17688758>

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

10 years ago[AVX512] Reorder functions in avx512fintrin.h
Adam Nemet [Mon, 28 Jul 2014 17:14:40 +0000 (17:14 +0000)]
[AVX512] Reorder functions in avx512fintrin.h

There is no functional change here.

The idea is to have a similar order and categories of functions that we have
in avxintrin.h.

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

10 years ago[AVX512] Bring the formatting of avx512fintrin.h closer to avxintrin.h
Adam Nemet [Mon, 28 Jul 2014 17:14:38 +0000 (17:14 +0000)]
[AVX512] Bring the formatting of avx512fintrin.h closer to avxintrin.h

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

10 years ago[AVX512] Add CHECK-LABELs to test/CodeGen/avx512f-builtins.c
Adam Nemet [Mon, 28 Jul 2014 17:14:36 +0000 (17:14 +0000)]
[AVX512] Add CHECK-LABELs to test/CodeGen/avx512f-builtins.c

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

10 years agoObjective-C. Improve diagnostic when property is
Fariborz Jahanian [Mon, 28 Jul 2014 16:35:45 +0000 (16:35 +0000)]
Objective-C. Improve diagnostic when property is
not auto synthesized in current implementation.
rdar://17774815

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

10 years agoThread Safety Analysis: Replace the old and broken SExpr with the new
DeLesley Hutchins [Mon, 28 Jul 2014 15:57:27 +0000 (15:57 +0000)]
Thread Safety Analysis:  Replace the old and broken SExpr with the new
til::SExpr.  This is a large patch, with many small changes to pretty printing
and expression lowering to make the new SExpr representation equivalent in
functionality to the old.

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

10 years ago[TEST] Improve tests for #pragma clang optimize off/on
Dario Domizioli [Mon, 28 Jul 2014 14:33:17 +0000 (14:33 +0000)]
[TEST] Improve tests for #pragma clang optimize off/on

Added coverage for:
* More than one "off region" in the same file
* An "off region" falling off the end of an included file

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

10 years agoclang-format: [proto] Improve formatting of text-proto options.
Daniel Jasper [Mon, 28 Jul 2014 14:08:09 +0000 (14:08 +0000)]
clang-format: [proto] Improve formatting of text-proto options.

Initial patch and tests by Kaushik Sridharan, thank you!

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

10 years agoclang-format: Improve operator and template recognition.
Daniel Jasper [Mon, 28 Jul 2014 13:19:58 +0000 (13:19 +0000)]
clang-format: Improve operator and template recognition.

Before:
  static_assert(is_convertible < A &&, B > ::value, "AAA");

After:
  static_assert(is_convertible<A &&, B>::value, "AAA");

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

10 years ago[PowerPC] Support ELFv1/ELFv2 ABI selection via -mabi= option
Ulrich Weigand [Mon, 28 Jul 2014 13:17:52 +0000 (13:17 +0000)]
[PowerPC] Support ELFv1/ELFv2 ABI selection via -mabi= option

While Clang now supports both ELFv1 and ELFv2 ABIs, their use is currently
hard-coded via the target triple: powerpc64-linux is always ELFv1, while
powerpc64le-linux is always ELFv2.

These are of course the most common scenarios, but in principle it is
possible to support the ELFv2 ABI on big-endian or the ELFv1 ABI on
little-endian systems (and GCC does support that), and there are some
special use cases for that (e.g. certain Linux kernel versions could
only be built using ELFv1 on LE).

This patch implements the Clang side of supporting this, based on the
LLVM commit 214072.  The command line options -mabi=elfv1 or -mabi=elfv2
select the desired ABI if present.  (If not, Clang uses the same default
rules as now.)

Specifically, the patch implements the following changes based on the
presence of the -mabi= option:

In the driver:
- Pass the appropiate -target-abi flag to the back-end
- Select the correct dynamic loader version (/lib64/ld64.so.[12])

In the preprocessor:
- Define _CALL_ELF to the appropriate value (1 or 2)

In the compiler back-end:
- Select the correct ABI in TargetInfo.cpp
- Select the desired ABI for LLVM via feature (elfv1/elfv2)

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

10 years agoclang-format: Improve pointer/reference detection.
Daniel Jasper [Mon, 28 Jul 2014 12:24:21 +0000 (12:24 +0000)]
clang-format: Improve pointer/reference detection.

Before (with left pointer alignment):
  void f(int i = 0, SomeType* *temps = NULL);

After:
  void f(int i = 0, SomeType** temps = NULL);

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

10 years agoclang-format: Fix unary operator recognition.
Daniel Jasper [Mon, 28 Jul 2014 12:08:16 +0000 (12:08 +0000)]
clang-format: Fix unary operator recognition.

Before:
  int x = ~ * p;

After:
  int x = ~*p;

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

10 years agoclang-format: Fix formatting of lock annotations in lambda definitions.
Daniel Jasper [Mon, 28 Jul 2014 12:08:06 +0000 (12:08 +0000)]
clang-format: Fix formatting of lock annotations in lambda definitions.

Before:
  SomeFunction([](int i)LOCKS_EXCLUDED(a) {});

After:
  SomeFunction([](int i) LOCKS_EXCLUDED(a) {});

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

10 years agoDataflowWorklist.h: Appease msc17 -- Split a private constructor to DataflowWorklistBase.
NAKAMURA Takumi [Mon, 28 Jul 2014 11:33:49 +0000 (11:33 +0000)]
DataflowWorklist.h: Appease msc17 -- Split a private constructor to DataflowWorklistBase.

MSC17 isn't capable to invoke other constructors in its scope.

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

10 years agoFactoring DataflowWorklist out of LiveVariables and UninitializedValues analyses
Artyom Skrobov [Mon, 28 Jul 2014 08:47:38 +0000 (08:47 +0000)]
Factoring DataflowWorklist out of LiveVariables and UninitializedValues analyses

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

10 years agoAdd missing override keyword to OpenBSD IsIntegratedAssemblerDefault().
Brad Smith [Mon, 28 Jul 2014 01:57:32 +0000 (01:57 +0000)]
Add missing override keyword to OpenBSD IsIntegratedAssemblerDefault().

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

10 years agoWrap to 80 columns. No behavior change.
Nico Weber [Mon, 28 Jul 2014 00:02:09 +0000 (00:02 +0000)]
Wrap to 80 columns. No behavior change.

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

10 years agoFix default argument comma disambiguation bug following the 'template' keyword.
Richard Smith [Sun, 27 Jul 2014 05:38:12 +0000 (05:38 +0000)]
Fix default argument comma disambiguation bug following the 'template' keyword.

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

10 years agoWhen looking for temporary dtors while building the CFG, do not walk into
Richard Smith [Sun, 27 Jul 2014 05:12:49 +0000 (05:12 +0000)]
When looking for temporary dtors while building the CFG, do not walk into
lambda expressions (other than their capture initializers) nor blocks. Do walk
into default argument expressions and default initializer expressions.

These bugs were causing us to produce broken CFGs whenever a lambda expression
was used to initialize a libstdc++ std::function object!

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

10 years ago[modules] Add some missing record names. We really should be generating this from...
Richard Smith [Sun, 27 Jul 2014 04:29:04 +0000 (04:29 +0000)]
[modules] Add some missing record names. We really should be generating this from a .def file or similar...

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

10 years ago[modules] Add abbreviation for ImplicitCastExpr. This is the most common
Richard Smith [Sun, 27 Jul 2014 04:19:32 +0000 (04:19 +0000)]
[modules] Add abbreviation for ImplicitCastExpr. This is the most common
record type in LLVM's IR module.

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

10 years agoWrap to 80 columns. No behavior change.
Nico Weber [Sun, 27 Jul 2014 04:09:29 +0000 (04:09 +0000)]
Wrap to 80 columns. No behavior change.

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

10 years agoWrap to 80 columns. No behavior change.
Nico Weber [Sat, 26 Jul 2014 23:20:08 +0000 (23:20 +0000)]
Wrap to 80 columns. No behavior change.

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

10 years agoWrap to 80 columns, no functionality change.
Nico Weber [Sat, 26 Jul 2014 22:15:25 +0000 (22:15 +0000)]
Wrap to 80 columns, no functionality change.

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

10 years agoObjective-C. Issue more warning diagnostic when certain
Fariborz Jahanian [Sat, 26 Jul 2014 20:52:26 +0000 (20:52 +0000)]
Objective-C. Issue more warning diagnostic when certain
properties are not synthesized in property auto-synthesis,
as it can potentiall lead to runtime errors.
rdar://17774815

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

10 years ago[Driver][Mips] Check output of -dynamic-linker arguments by the Clang driver
Simon Atanasyan [Sat, 26 Jul 2014 09:52:21 +0000 (09:52 +0000)]
[Driver][Mips] Check output of -dynamic-linker arguments by the Clang driver
for a couple of MIPS toolchains.

No functional changes.

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

10 years ago[modules] Improve abbreviations for C++:
Richard Smith [Sat, 26 Jul 2014 06:37:51 +0000 (06:37 +0000)]
[modules] Improve abbreviations for C++:

 * Add abbreviation for CXXMethodDecl and for FunctionProtoType. These come up
   a *lot* in C++ modules.
 * Allow typedef declarations to use the abbreviation if they're class members,
   or if they're used.

In passing, add more record name records for Clang AST node kinds.

The downside is that we had already used up our allotment of 12 abbreviations,
so this pushes us to an extra bit on each record to support the extra abbrev
kinds, which increases file size by ~1%. This patch *barely* pays for that
through the other improvements, but we've got room for another 18 abbrevs,
so we should be able to make it much more profitable with future changes.

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

10 years agoParse: Don't crash on trailing whitespace before EOF
David Majnemer [Sat, 26 Jul 2014 05:41:31 +0000 (05:41 +0000)]
Parse: Don't crash on trailing whitespace before EOF

Parser::ParseDeclarationSpecifiers eagerly updates the source range of
the DeclSpec with the current token position.  However, it might not
consume any more tokens.

Fix this by only setting the start of the range, not the end.  This way
the SourceRange will be invalid if we don't consume any more tokens.

This fixes PR20413.

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

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