]> granicus.if.org Git - clang/log
clang
11 years agoReplace compLocDecl with less_first.
Benjamin Kramer [Sat, 24 Aug 2013 13:12:34 +0000 (13:12 +0000)]
Replace compLocDecl with less_first.

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

11 years agoFix test, make the template type a const pointer.
David Majnemer [Sat, 24 Aug 2013 09:24:26 +0000 (09:24 +0000)]
Fix test, make the template type a const pointer.

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

11 years agoDebugInfo: Emit info for constant expressions in template arguments
David Majnemer [Sat, 24 Aug 2013 08:21:10 +0000 (08:21 +0000)]
DebugInfo: Emit info for constant expressions in template arguments

Summary:
This allows us to handle the general case where a non-type template
argument evaluates to a constant expression which isn't integral or a
declaration.

This fixes PR16939.

Reviewers: dblaikie, rsmith

Reviewed By: dblaikie

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1453

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

11 years agoCMake: support the LLVM_INSTALL_TOOLCHAIN_ONLY flag
Hans Wennborg [Sat, 24 Aug 2013 00:22:23 +0000 (00:22 +0000)]
CMake: support the LLVM_INSTALL_TOOLCHAIN_ONLY flag

Differential Revision: http://llvm-reviews.chandlerc.com/D1498

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

11 years agoAdd a FIXME.
Richard Smith [Fri, 23 Aug 2013 22:49:47 +0000 (22:49 +0000)]
Add a FIXME.

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

11 years agoA clean-up pass, exploring the unification of traversals of class, variable and funct...
Larisse Voufo [Fri, 23 Aug 2013 22:21:36 +0000 (22:21 +0000)]
A clean-up pass, exploring the unification of traversals of class, variable and function templates.

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

11 years agoAdd note about following two commands are no longer equivalent.
Shuxin Yang [Fri, 23 Aug 2013 22:01:03 +0000 (22:01 +0000)]
Add note about following two commands are no longer equivalent.
 - "clang -O3 -flto a.c -c", and
 - "clang -emit-llvm a.c -c"

Thank Rafael for tips.

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

11 years agoDon't imply -flto with -O4.
Rafael Espindola [Fri, 23 Aug 2013 21:49:00 +0000 (21:49 +0000)]
Don't imply -flto with -O4.

We now saturate at -O3.

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

11 years agoDriver::IsUsingLTO() no longer return true when seeing -emit-llvm.
Shuxin Yang [Fri, 23 Aug 2013 21:34:57 +0000 (21:34 +0000)]
Driver::IsUsingLTO() no longer return true when seeing -emit-llvm.

One step toward differentiating following two commands:
   clang -O3 -flto a.c -c, and
   clang -O3 -emit-llvm a.c

Thanks many awesome folks for clarifying things.

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

11 years agoUpdate now that llvm uses the same feature names as the driver.
Rafael Espindola [Fri, 23 Aug 2013 20:21:37 +0000 (20:21 +0000)]
Update now that llvm uses the same feature names as the driver.

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

11 years agoConsumed analysis: change class name in test cases.
DeLesley Hutchins [Fri, 23 Aug 2013 18:40:39 +0000 (18:40 +0000)]
Consumed analysis: change class name in test cases.

The name of a class used in the testing files was updated to actually
be descriptive.  Patch by chris.wailes@gmail.com.

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

11 years agoRename CMake variable; this fell out of r189127 somehow.
Hans Wennborg [Fri, 23 Aug 2013 18:20:47 +0000 (18:20 +0000)]
Rename CMake variable; this fell out of r189127 somehow.

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

11 years agoCMake: Don't look for llvm-tblgen when building outside LLVM tree
Hans Wennborg [Fri, 23 Aug 2013 18:05:24 +0000 (18:05 +0000)]
CMake: Don't look for llvm-tblgen when building outside LLVM tree

Previously, the CMake build would look for llvm-tblgen to determine
if a directory is an LLVM build or install directory. Since we don't
want to include llvm-tblgen in the install, look for llvm-config instead,
and use that to find llvm-tblgen.

Differential Revision: http://llvm-reviews.chandlerc.com/D1483

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

11 years agoComment parsing: fix a bug where a line with whitespace between two paragraphs
Dmitri Gribenko [Fri, 23 Aug 2013 18:03:40 +0000 (18:03 +0000)]
Comment parsing: fix a bug where a line with whitespace between two paragraphs
would cause us to concatenate these paragraphs into a single one.

The no-op whitespace churn in test/Index test happened because these tests
don't use the correct approach for testing and are more strict than required
for they are testing.

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

11 years agoFix indentation
Dmitri Gribenko [Fri, 23 Aug 2013 17:48:41 +0000 (17:48 +0000)]
Fix indentation

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

11 years agoUse CharInfo.h routines in TextComment::isWhitespaceNoCache
Dmitri Gribenko [Fri, 23 Aug 2013 17:45:43 +0000 (17:45 +0000)]
Use CharInfo.h routines in TextComment::isWhitespaceNoCache

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

11 years agoRevise -Wnewline-eof test per feedback from Dmitri.
Jordan Rose [Fri, 23 Aug 2013 16:12:49 +0000 (16:12 +0000)]
Revise -Wnewline-eof test per feedback from Dmitri.

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

11 years agoUse pop_back_val() instead of both back() and pop_back().
Robert Wilhelm [Fri, 23 Aug 2013 16:11:15 +0000 (16:11 +0000)]
Use pop_back_val() instead of both back() and pop_back().
No functionality change intended.

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

11 years agoRespect -Wnewline-eof even in C++11 mode.
Jordan Rose [Fri, 23 Aug 2013 15:42:01 +0000 (15:42 +0000)]
Respect -Wnewline-eof even in C++11 mode.

If the user has requested this warning, we should emit it, even if it's not
an extension in the current language mode. However, being an extension is
more important, so prefer the pedantic warning or the pedantic-compatibility
warning if those are enabled.

<rdar://problem/12922063>

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

11 years agoclang-format: Fix indentation relative to unary expressions.
Daniel Jasper [Fri, 23 Aug 2013 15:14:03 +0000 (15:14 +0000)]
clang-format: Fix indentation relative to unary expressions.

This should be done, only if we are still in the unary expression's
scope.

Before:
  bool aaaa = !aaaaaaaa(  // break
                   aaaaaaaaaaa);
  *aaaaaa = aaaaaaa( // break
       aaaaaaaaaaaaaaaa);

After:
  bool aaaa = !aaaaaaaa(  // break
                   aaaaaaaaaaa); // <- (unchanged)
  *aaaaaa = aaaaaaa( // break
      aaaaaaaaaaaaaaaa); // <- (no longer indented relative to "*")

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

11 years agoclang-format: Fix corner case for string splitting ..
Daniel Jasper [Fri, 23 Aug 2013 11:57:34 +0000 (11:57 +0000)]
clang-format: Fix corner case for string splitting ..

.. in conjunction with Style.AlwaysBreakBeforeMultilineStrings. Also,
simplify the implementation by handling newly split strings and already
split strings by the same code.

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

11 years agoclang-format: Handle trailing commas in column layout of braced list.
Daniel Jasper [Fri, 23 Aug 2013 10:05:49 +0000 (10:05 +0000)]
clang-format: Handle trailing commas in column layout of braced list.

Before, this was causing errors.

Also exit early in breakProtrudingToken() (before the expensive call to
SourceManager::getSpellingColumnNumber()). This makes formatting huge
(100k+-item) braced lists possible.

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

11 years agocorrect test RUN parameters
Robert Lytton [Fri, 23 Aug 2013 09:27:44 +0000 (09:27 +0000)]
correct test RUN parameters

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

11 years ago[analyzer] Refactor conditional expression evaluating code
Pavel Labath [Fri, 23 Aug 2013 07:19:22 +0000 (07:19 +0000)]
[analyzer] Refactor conditional expression evaluating code

Summary:
Instead of digging through the ExplodedGraph, to figure out which edge brought
us here, I compute the value of conditional expression by looking at the
sub-expression values.

To do this, I needed to change the liveness algorithm a bit -- now, the full
conditional expression also depends on all atomic sub-expressions, not only the
outermost ones.

Reviewers: jordan_rose

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1340

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

11 years agoarc commit didn't add this because it wasn't in the patch...
David Majnemer [Fri, 23 Aug 2013 05:42:19 +0000 (05:42 +0000)]
arc commit didn't add this because it wasn't in the patch...

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

11 years agoSema: Properly support Microsoft-mode template arguments
David Majnemer [Fri, 23 Aug 2013 05:39:39 +0000 (05:39 +0000)]
Sema: Properly support Microsoft-mode template arguments

Summary:
There were two things known to be wrong with our implementation of MSVC
mode template arguments:

- We didn't properly handle __uuidof/CXXUuidofExpr and skipped all type
  checking completely.
- We didn't allow for MSVC's extension of allowing certain constant
  "foldable" expressions from showing up in template arguments.
  They allow various casts dereference and address-of operations.
  We can make it more general as we find further peculiarities but this
  is the known extent.

Reviewers: rsmith, doug.gregor, rjmccall

Reviewed By: doug.gregor

CC: cfe-commits, rnk
Differential Revision: http://llvm-reviews.chandlerc.com/D1444

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

11 years agoReword a diagnostic to avoid a confusing implication that it might be talking
Richard Smith [Fri, 23 Aug 2013 02:16:48 +0000 (02:16 +0000)]
Reword a diagnostic to avoid a confusing implication that it might be talking
about a declaration within a return type.

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

11 years agoRemove SequenceNumber from class/variable template partial specializations.
Richard Smith [Thu, 22 Aug 2013 23:27:37 +0000 (23:27 +0000)]
Remove SequenceNumber from class/variable template partial specializations.
This was only used to ensure that the traversal order was the same as the
insertion order, but that guarantee was already being provided by the use
of a FoldingSetVector.

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

11 years agoObjectiveC migrator: builtin ObjectiveC types are not
Fariborz Jahanian [Thu, 22 Aug 2013 22:27:36 +0000 (22:27 +0000)]
ObjectiveC migrator: builtin ObjectiveC types are not
audited types.

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

11 years agoObjectiveC migrator: some refactoring to reduce
Fariborz Jahanian [Thu, 22 Aug 2013 21:40:15 +0000 (21:40 +0000)]
ObjectiveC migrator: some refactoring to reduce
code size.

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

11 years agoCheck for absence of the flag.
Bill Wendling [Thu, 22 Aug 2013 21:30:21 +0000 (21:30 +0000)]
Check for absence of the flag.

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

11 years agoOnly add this attribute when it's set. If it's not there, the assumption is that...
Bill Wendling [Thu, 22 Aug 2013 21:16:51 +0000 (21:16 +0000)]
Only add this attribute when it's set. If it's not there, the assumption is that it's off.

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

11 years agoUpdate to consumed analysis.
DeLesley Hutchins [Thu, 22 Aug 2013 20:44:47 +0000 (20:44 +0000)]
Update to consumed analysis.

Patch by chris.wailes@gmail.com.  The following functionality was added:

* The same functionality is now supported for both CXXOperatorCallExprs and CXXMemberCallExprs.
* Factored out some code in StmtVisitor.
* Removed variables from the state map when their destructors are encountered.
* Started adding documentation for the consumed analysis attributes.

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

11 years agoDataFlowSanitizer: Add a design doc paragraph on checking ABI consistency.
Peter Collingbourne [Thu, 22 Aug 2013 20:08:20 +0000 (20:08 +0000)]
DataFlowSanitizer: Add a design doc paragraph on checking ABI consistency.

Differential Revision: http://llvm-reviews.chandlerc.com/D1443

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

11 years agoAdd a separate llvm.global_ctors entry for linkonce_odr data initializers
Reid Kleckner [Thu, 22 Aug 2013 20:07:45 +0000 (20:07 +0000)]
Add a separate llvm.global_ctors entry for linkonce_odr data initializers

Summary:
These typically come from static data members of class template
specializations.  This accomplishes two things:

1. May expose GlobalOpt optimizations for Itanium C++ ABI code.
2. Works toward fixing double initialization in the Microsoft C++ ABI.

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1475

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

11 years agoFileCheckify a grep test.
Reid Kleckner [Thu, 22 Aug 2013 18:45:40 +0000 (18:45 +0000)]
FileCheckify a grep test.

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

11 years agoObjectiveC migrator: Provide ARC annotations for
Fariborz Jahanian [Thu, 22 Aug 2013 18:35:27 +0000 (18:35 +0000)]
ObjectiveC migrator: Provide ARC annotations for
CF methods too.

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

11 years agoRefactor VariantMatcher to use an interface underneath.
Samuel Benzaquen [Thu, 22 Aug 2013 16:38:33 +0000 (16:38 +0000)]
Refactor VariantMatcher to use an interface underneath.

Summary:
Refactor VariantMatcher to use an interface underneath.
It supports "Single" and "Polymorphic". Will support more in the future.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1446

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

11 years agoRe-add clang-check to the Makefile build.
Jordan Rose [Thu, 22 Aug 2013 16:12:04 +0000 (16:12 +0000)]
Re-add clang-check to the Makefile build.

I was bound to screw this up somehow.

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

11 years agoWork around unused variable warning in release builds.
Daniel Jasper [Thu, 22 Aug 2013 16:11:46 +0000 (16:11 +0000)]
Work around unused variable warning in release builds.

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

11 years agoFix dependencies now that the ARC migrator depends on the static analyzer.
Jordan Rose [Thu, 22 Aug 2013 15:50:02 +0000 (15:50 +0000)]
Fix dependencies now that the ARC migrator depends on the static analyzer.

Thanks for pointing this out, Stephen. I think this is right now -- I
attempted to try all four valid combinations with both the autoconf and
CMake builds.

See also LLVM changes to the configure script.

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

11 years agoDebugInfo: emit the definition of types when construction vtables are required as...
David Blaikie [Thu, 22 Aug 2013 15:23:05 +0000 (15:23 +0000)]
DebugInfo: emit the definition of types when construction vtables are required as these types may never end up emitting the full class data

This might be able to be optimized further by only doing this in the
absence of a key function, but it doesn't look like GCC is doing that so
I'm not rushing to do it just yet.

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

11 years agoclang-format: Add column layout formatting for braced lists
Daniel Jasper [Thu, 22 Aug 2013 15:00:41 +0000 (15:00 +0000)]
clang-format: Add column layout formatting for braced lists

With this patch, braced lists (with more than 3 elements are formatted in a
column layout if possible). E.g.:

  static const uint16_t CallerSavedRegs64Bit[] = {
    X86::RAX, X86::RDX, X86::RCX, X86::RSI, X86::RDI,
    X86::R8,  X86::R9,  X86::R10, X86::R11, 0
  };

Required other changes:
- FormatTokens can now have a special role that contains extra data and can do
  special formattings. A comma separated list is currently the only
  implementation.
- Move penalty calculation entirely into ContinuationIndenter (there was a last
  piece still in UnwrappedLineFormatter).

Review: http://llvm-reviews.chandlerc.com/D1457

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

11 years agoDebugInfo: Remove explicit declaration-emissiong handling now that we have a more...
David Blaikie [Thu, 22 Aug 2013 13:36:01 +0000 (13:36 +0000)]
DebugInfo: Remove explicit declaration-emissiong handling now that we have a more principled approach (the 'requires complete type' callback)

No functionality change intended.

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

11 years agoRevert "Implement a rudimentary form of generic lambdas."
Manuel Klimek [Thu, 22 Aug 2013 12:12:24 +0000 (12:12 +0000)]
Revert "Implement a rudimentary form of generic lambdas."

This reverts commit 606f5d7a99b11957e057e4cd1f55f931f66a42c7.

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

11 years agoRevert "Remove some unused variables identified by Juergen Ributzka *I need to turn...
Manuel Klimek [Thu, 22 Aug 2013 12:12:05 +0000 (12:12 +0000)]
Revert "Remove some unused variables identified by Juergen Ributzka *I need to turn on this warning in Visual C++ - sorry!*"

This reverts commit d01d0b63d87ac465f15ce1d6b56bf3faf4525769.

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

11 years agoTypo.
David Majnemer [Thu, 22 Aug 2013 10:04:41 +0000 (10:04 +0000)]
Typo.

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

11 years agoconst'ify Sema::ActOnCXXTryBlock by
Robert Wilhelm [Thu, 22 Aug 2013 09:20:03 +0000 (09:20 +0000)]
const'ify Sema::ActOnCXXTryBlock by
changing Parameter from MutableArrayRef to
ArrayRef.
No functionality change intended.

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

11 years agognu-flags.c test: relax the check a bit
Dmitri Gribenko [Thu, 22 Aug 2013 08:13:43 +0000 (08:13 +0000)]
gnu-flags.c test: relax the check a bit

This tests warning flags, so no need to test for specific alignment which is
platform-dependent.

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

11 years agoAnalysis: Make %I in printf more reasonable, add more tests
David Majnemer [Thu, 22 Aug 2013 07:53:21 +0000 (07:53 +0000)]
Analysis: Make %I in printf more reasonable, add more tests

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

11 years agoConstify more uses of ASTContext&. No functional change.
Craig Topper [Thu, 22 Aug 2013 07:09:37 +0000 (07:09 +0000)]
Constify more uses of ASTContext&. No functional change.

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

11 years agoConstify some more ASTContext& uses.
Craig Topper [Thu, 22 Aug 2013 06:02:26 +0000 (06:02 +0000)]
Constify some more ASTContext& uses.

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

11 years agoConstify the ASTContext& passed to Stmt creation functions. Also constify the context...
Craig Topper [Thu, 22 Aug 2013 05:28:54 +0000 (05:28 +0000)]
Constify the ASTContext& passed to Stmt creation functions. Also constify the context in couple other functions that are called from creation functions.

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

11 years agoConstify the ASTContext& passed to Expr creation functions. Also constify the context...
Craig Topper [Thu, 22 Aug 2013 04:58:56 +0000 (04:58 +0000)]
Constify the ASTContext& passed to Expr creation functions. Also constify the context in couple other functions that are called from creation functions.

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

11 years agoAdd test cases for avx512 feature flags. Fix typo in avx512pf options.
Craig Topper [Thu, 22 Aug 2013 04:32:55 +0000 (04:32 +0000)]
Add test cases for avx512 feature flags. Fix typo in avx512pf options.

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

11 years agoRemove some unused variables identified by Juergen Ributzka *I need to turn on this...
Faisal Vali [Thu, 22 Aug 2013 02:13:38 +0000 (02:13 +0000)]
Remove some unused variables identified by Juergen Ributzka *I need to turn on this warning in Visual C++ - sorry!*

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

11 years agoImplement a rudimentary form of generic lambdas.
Faisal Vali [Thu, 22 Aug 2013 01:49:11 +0000 (01:49 +0000)]
Implement a rudimentary form of generic lambdas.

Specifically, the following features are not included in this commit:
  - any sort of capturing within generic lambdas
  - nested lambdas
  - conversion operator for captureless lambdas
  - ensuring all visitors are generic lambda aware

As an example of what compiles:

template <class F1, class F2>
struct overload : F1, F2 {
    using F1::operator();
    using F2::operator();
    overload(F1 f1, F2 f2) : F1(f1), F2(f2) { }
  };

  auto Recursive = [](auto Self, auto h, auto ... rest) {
    return 1 + Self(Self, rest...);
  };
  auto Base = [](auto Self, auto h) {
      return 1;
  };
  overload<decltype(Base), decltype(Recursive)> O(Base, Recursive);
  int num_params =  O(O, 5, 3, "abc", 3.14, 'a');

Please see attached tests for more examples.

Some implementation notes:

  - Add a new Declarator context => LambdaExprParameterContext to
    clang::Declarator to allow the use of 'auto' in declaring generic
    lambda parameters

  - Augment AutoType's constructor (similar to how variadic
    template-type-parameters ala TemplateTypeParmDecl are implemented) to
    accept an IsParameterPack to encode a generic lambda parameter pack.

  - Add various helpers to CXXRecordDecl to facilitate identifying
    and querying a closure class

  - LambdaScopeInfo (which maintains the current lambda's Sema state)
    was augmented to house the current depth of the template being
    parsed (id est the Parser calls Sema::RecordParsingTemplateParameterDepth)
    so that Sema::ActOnLambdaAutoParameter may use it to create the
    appropriate list of corresponding TemplateTypeParmDecl for each
    auto parameter identified within the generic lambda (also stored
    within the current LambdaScopeInfo).  Additionally,
    a TemplateParameterList data-member was added to hold the invented
    TemplateParameterList AST node which will be much more useful
    once we teach TreeTransform how to transform generic lambdas.

  - SemaLambda.h was added to hold some common lambda utility
    functions (this file is likely to grow ...)

  - Teach Sema::ActOnStartOfFunctionDef to check whether it
    is being called to instantiate a generic lambda's call
    operator, and if so, push an appropriately prepared
    LambdaScopeInfo object on the stack.

  - Teach Sema::ActOnStartOfLambdaDefinition to set the
    return type of a lambda without a trailing return type
    to 'auto' in C++1y mode, and teach the return type
    deduction machinery in SemaStmt.cpp to process either
    C++11 and C++14 lambda's correctly depending on the flag.

  - various tests were added - but much more will be needed.

A greatful thanks to all reviewers including Eli Friedman,
James Dennett and the ever illuminating Richard Smith.  And
yet I am certain that I have allowed unidentified bugs to creep in;
bugs, that I will do my best to slay, once identified!

Thanks!

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

11 years agoAdd a constexpr functionality test for static data member templates.
Larisse Voufo [Thu, 22 Aug 2013 01:05:27 +0000 (01:05 +0000)]
Add a constexpr functionality test for static data member templates.

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

11 years agoRefactor for clarity and simplicity.
Larisse Voufo [Thu, 22 Aug 2013 00:59:14 +0000 (00:59 +0000)]
Refactor for clarity and simplicity.

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

11 years agoImprove support for static data member templates. This revision still has at least...
Larisse Voufo [Thu, 22 Aug 2013 00:28:27 +0000 (00:28 +0000)]
Improve support for static data member templates. This revision still has at least one bug, as it does not respect the variable template specialization hierarchy well.

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

11 years agoSplit isFromMainFile into two functions.
Eli Friedman [Thu, 22 Aug 2013 00:27:10 +0000 (00:27 +0000)]
Split isFromMainFile into two functions.

Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't.  Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).

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

11 years agoDebugInfo: Require only the declaration of types only used as parameter and return...
David Blaikie [Wed, 21 Aug 2013 23:23:07 +0000 (23:23 +0000)]
DebugInfo: Require only the declaration of types only used as parameter and return types

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

11 years agoReduce sizeof(TemplateArgument) from 32 to 24.
Eli Friedman [Wed, 21 Aug 2013 23:05:56 +0000 (23:05 +0000)]
Reduce sizeof(TemplateArgument) from 32 to 24.

No intended functionality change.

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

11 years agoUpdated the consumed analysis warnings to use a more standardized diagnostic.
Aaron Ballman [Wed, 21 Aug 2013 22:07:20 +0000 (22:07 +0000)]
Updated the consumed analysis warnings to use a more standardized diagnostic.

Patch thanks to Christian Wailes!

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

11 years agoMove -mfpmath handling to -cc1 and implement it for x86.
Rafael Espindola [Wed, 21 Aug 2013 21:59:03 +0000 (21:59 +0000)]
Move -mfpmath handling to -cc1 and implement it for x86.

The original idea was to implement it all on the driver, but to do that the
driver needs to know the sse level and to do that it has to know the default
features of a cpu.

Benjamin Kramer pointed out that if one day we decide to implement support for
' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to
keep its knowledge of default features of a cpu.

To avoid duplicating which part of clang handles default cpu features,
it is probably better to handle -mfpmath in the frontend.

For ARM this patch is just a small improvement. Instead of a cpu list, we
check if neon is enabled, which allows us to reject things like

-mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon

For X86, since LLVM doesn't support an independent ssefp feature, we just
make sure the selected -mfpmath matches the sse level.

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

11 years agoAnalysis: Add support for MS specific printf format specifiers
David Majnemer [Wed, 21 Aug 2013 21:54:46 +0000 (21:54 +0000)]
Analysis: Add support for MS specific printf format specifiers

Summary: Adds support for %I, %I32 and %I64.

Reviewers: hans, jordan_rose, rnk, majnemer

Reviewed By: majnemer

CC: cfe-commits, cdavis5x
Differential Revision: http://llvm-reviews.chandlerc.com/D1456

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

11 years agoRemoved unnecessary asserts.
Aaron Ballman [Wed, 21 Aug 2013 21:38:46 +0000 (21:38 +0000)]
Removed unnecessary asserts.

Patch thanks to Christian Wailes!

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

11 years agoTBAA: add testing case to check typedef can alias.
Manman Ren [Wed, 21 Aug 2013 21:00:10 +0000 (21:00 +0000)]
TBAA: add testing case to check typedef can alias.

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

11 years agoDon't use mangleCXXRTTIName in TBAA for C code.
Manman Ren [Wed, 21 Aug 2013 20:58:45 +0000 (20:58 +0000)]
Don't use mangleCXXRTTIName in TBAA for C code.

With r185721, calling mangleCXXRTTIName on C code will cause crashes.
This commit fixes crashes on C testing cases when turning on struct-path TBAA.

For C code, we simply use the Decl name without the context. This can
cause two different structs having the same name, and may cause inaccurate but
conservative alias results.

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

11 years agoUpdate testing case to use FileCheck instead of grep.
Manman Ren [Wed, 21 Aug 2013 20:53:05 +0000 (20:53 +0000)]
Update testing case to use FileCheck instead of grep.

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

11 years agoObjectibeC migrator. Annotate cf_consumed arguments,
Fariborz Jahanian [Wed, 21 Aug 2013 19:37:47 +0000 (19:37 +0000)]
ObjectibeC migrator. Annotate cf_consumed arguments,
as reported by static analyer API with CF_CONSUMED.

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

11 years agoFix the end sourcelocation of the call expression in a member access when
Nick Lewycky [Wed, 21 Aug 2013 19:09:44 +0000 (19:09 +0000)]
Fix the end sourcelocation of the call expression in a member access when
recovering by adding empty parenthesis. Fixes PR16676!

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

11 years agoRevert r188863 which could propose wrong fixits for multibyte character literals.
Nick Lewycky [Wed, 21 Aug 2013 18:57:51 +0000 (18:57 +0000)]
Revert r188863 which could propose wrong fixits for multibyte character literals.

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

11 years agoObjectiveC migrator: until we have beter understanding of
Fariborz Jahanian [Wed, 21 Aug 2013 18:49:03 +0000 (18:49 +0000)]
ObjectiveC migrator: until we have beter understanding of
setter/getter implementations, migrate them to
nonatomic properties.

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

11 years agoRemove dead code.
Rafael Espindola [Wed, 21 Aug 2013 18:13:43 +0000 (18:13 +0000)]
Remove dead code.

setFeatureEnabled is never called with "32" or "64". The driver never passes it
and mips' getDefaultFeatures sets the Features map directly.

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

11 years agoMove the logic for selecting the last feature in the command line to the driver.
Rafael Espindola [Wed, 21 Aug 2013 17:34:32 +0000 (17:34 +0000)]
Move the logic for selecting the last feature in the command line to the driver.

This is a partial revert of r188817 now that the driver handles -target-feature
in a single place.

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

11 years ago[CGF] Get rid of passing redundant VTable pointer around in CodeGenFunction::Initiali...
Timur Iskhodzhanov [Wed, 21 Aug 2013 17:33:16 +0000 (17:33 +0000)]
[CGF] Get rid of passing redundant VTable pointer around in CodeGenFunction::InitializeVTablePointer[s]

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

11 years agoCentralize the handling of -target-feature.
Rafael Espindola [Wed, 21 Aug 2013 16:39:20 +0000 (16:39 +0000)]
Centralize the handling of -target-feature.

No functionality change other than changing the order of -target-feature
relative to other -cc1 command line arguments.

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

11 years agoTweak gnu-flags.c test for z, where globals have 2-byte alignment by default
Richard Sandiford [Wed, 21 Aug 2013 16:37:37 +0000 (16:37 +0000)]
Tweak gnu-flags.c test for z, where globals have 2-byte alignment by default

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

11 years agoDon't disable SSE4A when disabling AVX.
Rafael Espindola [Wed, 21 Aug 2013 13:28:02 +0000 (13:28 +0000)]
Don't disable SSE4A when disabling AVX.

Thanks for Craig Topper for noticing it.

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

11 years agoSema: Use the right type for PredefinedExpr when it's in a lambda.
Benjamin Kramer [Wed, 21 Aug 2013 11:45:27 +0000 (11:45 +0000)]
Sema: Use the right type for PredefinedExpr when it's in a lambda.

1. We now print the return type of lambdas and return type deduced functions
as "auto". Trailing return types with decltype print the underlying type.
2. Use the lambda or block scope for the PredefinedExpr type instead of the
parent function. This fixes PR16946, a strange mismatch between type of the
expression and the actual result.
3. Verify the type in CodeGen.
4. The type for blocks is still wrong. They are numbered and the name is not
known until CodeGen.

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

11 years agoclang-format: Indent relative to unary operators.
Daniel Jasper [Wed, 21 Aug 2013 08:39:01 +0000 (08:39 +0000)]
clang-format: Indent relative to unary operators.

Before:
  if (!aaaaaaaaaa(  // break
          aaaaa)) {
  }

After:
  if (!aaaaaaaaaa(  // break
           aaaaa)) {
  }

Also cleaned up formatting using clang-format.

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

11 years agoAbstract out virtual calls and virtual function prologue code generation; implement...
Timur Iskhodzhanov [Wed, 21 Aug 2013 06:25:03 +0000 (06:25 +0000)]
Abstract out virtual calls and virtual function prologue code generation; implement them for -cxx-abi microsoft

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

11 years agoAdd avx512cd, avx512er, avx512pf feature flags and enable them on KNL CPU.
Craig Topper [Wed, 21 Aug 2013 05:29:10 +0000 (05:29 +0000)]
Add avx512cd, avx512er, avx512pf feature flags and enable them on KNL CPU.

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

11 years agoIssue fixits replacing invalid character literals with the equivalent \xNN
Nick Lewycky [Wed, 21 Aug 2013 04:10:58 +0000 (04:10 +0000)]
Issue fixits replacing invalid character literals with the equivalent \xNN
escape code.

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

11 years agoRevert accidental commit.
Craig Topper [Wed, 21 Aug 2013 04:01:01 +0000 (04:01 +0000)]
Revert accidental commit.

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

11 years agoRevert accidental commit.
Craig Topper [Wed, 21 Aug 2013 04:00:44 +0000 (04:00 +0000)]
Revert accidental commit.

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

11 years agoReplace avx-512 with avx512f to match llvm side and what gcc patches appear to be...
Craig Topper [Wed, 21 Aug 2013 03:59:22 +0000 (03:59 +0000)]
Replace avx-512 with avx512f to match llvm side and what gcc patches appear to be using.

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

11 years agoNo functionality change. Adjust a bunch of formatting issues in this code and
Nick Lewycky [Wed, 21 Aug 2013 02:40:19 +0000 (02:40 +0000)]
No functionality change. Adjust a bunch of formatting issues in this code and
fix a typo in a comment.

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

11 years agoRemove more uses of 'index' as namespace scope.
Argyrios Kyrtzidis [Wed, 21 Aug 2013 01:51:19 +0000 (01:51 +0000)]
Remove more uses of 'index' as namespace scope.

Follow up to r188850.

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

11 years agoIf we find an error in the range expression in a range-based for loop, and the
Richard Smith [Wed, 21 Aug 2013 01:40:36 +0000 (01:40 +0000)]
If we find an error in the range expression in a range-based for loop, and the
loop variable has a type containing 'auto', set the declaration to be invalid
(because we couldn't deduce its type) to prevent follow-on errors.

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

11 years agoAvoid using the 'index' namespace as scope.
Argyrios Kyrtzidis [Wed, 21 Aug 2013 00:49:25 +0000 (00:49 +0000)]
Avoid using the 'index' namespace as scope.

This should fix the bogus ambiguous reference errors reported by gcc 4.2.1 that the FreeBSD bot is using.

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

11 years agoObjectiveC migrator. make sure to embed audited
Fariborz Jahanian [Tue, 20 Aug 2013 23:35:26 +0000 (23:35 +0000)]
ObjectiveC migrator. make sure to embed audited
candidate functions in their CF_IMPLICIT_BRIDGING_ENABLED
pragma before exiting the header file.

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

11 years agoRemove Extension warning for GNU local labels.
Eli Friedman [Tue, 20 Aug 2013 22:44:32 +0000 (22:44 +0000)]
Remove Extension warning for GNU local labels.

We generally don't warn about extensions involving keywords reserved
for the implementation, so we shouldn't warn here either: the
standard doesn't require it, and it doesn't provide useful information
to the user.

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

11 years agoAdd more specific flags for misc GNU extensions.
Eli Friedman [Tue, 20 Aug 2013 22:44:28 +0000 (22:44 +0000)]
Add more specific flags for misc GNU extensions.

This adds the following as subgroups of -Wgnu: -Wgnu-alignof-expression,
-Wgnu-case-range, -Wgnu-complex-integer, -Wgnu-conditional-omitted-operand,
-Wgnu-empty-initializer, -Wgnu-label-as-value, -Wgnu-local-label,
and -Wgnu-statement-expression,

Patch by Peter Lewis.

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

11 years agoObjectiveC migrator: make sure audited pragams are
Fariborz Jahanian [Tue, 20 Aug 2013 22:42:13 +0000 (22:42 +0000)]
ObjectiveC migrator: make sure audited pragams are
dumped for last declarations in the current TU. wip.

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

11 years agoCentralize the handling of -target-cpu (-cc1, -cc1as) and -mcpu (gold plugin).
Rafael Espindola [Tue, 20 Aug 2013 22:12:08 +0000 (22:12 +0000)]
Centralize the handling of -target-cpu (-cc1, -cc1as) and -mcpu (gold plugin).

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

11 years agoTest case for PR16933/r188707.
David Blaikie [Tue, 20 Aug 2013 22:01:44 +0000 (22:01 +0000)]
Test case for PR16933/r188707.

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

11 years agoFix iterator invalidation. PR16935.
Eli Friedman [Tue, 20 Aug 2013 22:01:43 +0000 (22:01 +0000)]
Fix iterator invalidation. PR16935.

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

11 years agoDebugInfo: comment/inlining based on feedback from Eric & Adrian
David Blaikie [Tue, 20 Aug 2013 21:49:21 +0000 (21:49 +0000)]
DebugInfo: comment/inlining based on feedback from Eric & Adrian

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