]> granicus.if.org Git - clang/log
clang
11 years agoIn C++11, promote access declaration diagnostic from warning to error. There
Richard Smith [Thu, 13 Jun 2013 02:12:17 +0000 (02:12 +0000)]
In C++11, promote access declaration diagnostic from warning to error. There
doesn't seem to be any value in even adding a -W flag for this.

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

11 years agoAdd -Wdeprecated warnings and fixits for things deprecated in C++11:
Richard Smith [Thu, 13 Jun 2013 02:02:51 +0000 (02:02 +0000)]
Add -Wdeprecated warnings and fixits for things deprecated in C++11:
 - 'register' storage class
 - dynamic exception specifications

Only the former check is enabled by default for now (the latter might be quite noisy).

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

11 years agoWhen copy-initializing a temporary for a reference binding, don't allow use of
Richard Smith [Thu, 13 Jun 2013 00:57:57 +0000 (00:57 +0000)]
When copy-initializing a temporary for a reference binding, don't allow use of
explicit constructors.

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

11 years agoInclude the unexpanded packs in the initializer expression when checking a
Nick Lewycky [Thu, 13 Jun 2013 00:45:47 +0000 (00:45 +0000)]
Include the unexpanded packs in the initializer expression when checking a
pack expanded constructor initializer list. Fixes PR16303!

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

11 years agoSimplify: we don't need any special-case lifetime extension when initializing
Richard Smith [Wed, 12 Jun 2013 23:38:09 +0000 (23:38 +0000)]
Simplify: we don't need any special-case lifetime extension when initializing
declarations of reference type; they're handled by the general case handling of
MaterializeTemporaryExpr.

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

11 years agoDon't suggest putting 'operator new' or 'operator delete' in a namespace to fix a...
Richard Smith [Wed, 12 Jun 2013 22:56:54 +0000 (22:56 +0000)]
Don't suggest putting 'operator new' or 'operator delete' in a namespace to fix a two-phase lookup issue. That's not permitted.

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

11 years agoPR12086, PR15117
Richard Smith [Wed, 12 Jun 2013 22:31:48 +0000 (22:31 +0000)]
PR12086, PR15117

Introduce CXXStdInitializerListExpr node, representing the implicit
construction of a std::initializer_list<T> object from its underlying array.
The AST representation of such an expression goes from an InitListExpr with a
flag set, to a CXXStdInitializerListExpr containing a MaterializeTemporaryExpr
containing an InitListExpr (possibly wrapped in a CXXBindTemporaryExpr).

This more detailed representation has several advantages, the most important of
which is that the new MaterializeTemporaryExpr allows us to directly model
lifetime extension of the underlying temporary array. Using that, this patch
*drastically* simplifies the IR generation of this construct, provides IR
generation support for nested global initializer_list objects, fixes several
bugs where the destructors for the underlying array would accidentally not get
invoked, and provides constant expression evaluation support for
std::initializer_list objects.

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

11 years agoMove detection of reference members binding to temporaries from building of
Richard Smith [Wed, 12 Jun 2013 21:51:50 +0000 (21:51 +0000)]
Move detection of reference members binding to temporaries from building of
CXXCtorInitializers to the point where we perform the questionable lifetime
extension. This exposed a selection of false negatives in the warning.

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

11 years agoIntroducing -Wheader-guard, a warning that checks header guards actually work
Richard Trieu [Wed, 12 Jun 2013 21:20:57 +0000 (21:20 +0000)]
Introducing -Wheader-guard, a warning that checks header guards actually work
properly.  This warning checks that the #ifndef and #define directives at
the beginning of a header refer to the same macro name.  Includes a fix-it
hint to correct the header guard.

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

11 years agoUse the global functions instead of the Program methods.
Rafael Espindola [Wed, 12 Jun 2013 20:44:26 +0000 (20:44 +0000)]
Use the global functions instead of the Program methods.

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

11 years agoReapply r183721, reverted in r183776, with a fix for a bug in the former (we
Richard Smith [Wed, 12 Jun 2013 20:42:33 +0000 (20:42 +0000)]
Reapply r183721, reverted in r183776, with a fix for a bug in the former (we
were lacking ExprWithCleanups nodes in some cases where the new approach to
lifetime extension needed them).

Original commit message:

Rework IR emission for lifetime-extended temporaries. Instead of trying to walk
into the expression and dig out a single lifetime-extended entity and manually
pull its cleanup outside the expression, instead keep a list of the cleanups
which we'll need to emit when we get to the end of the full-expression. Also
emit those cleanups early, as EH-only cleanups, to cover the case that the
full-expression does not terminate normally. This allows IR generation to
properly model temporary lifetime when multiple temporaries are extended by the
same declaration.

We have a pre-existing bug where an exception thrown from a temporary's
destructor does not clean up lifetime-extended temporaries created in the same
expression and extended to automatic storage duration; that is not fixed by
this patch.

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

11 years agoRetain linker flags specified on cmake command line.
Andy Gibbs [Wed, 12 Jun 2013 20:02:59 +0000 (20:02 +0000)]
Retain linker flags specified on cmake command line.

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

11 years agoPreserve newlines before block comments in static initializers.
Alexander Kornienko [Wed, 12 Jun 2013 19:04:12 +0000 (19:04 +0000)]
Preserve newlines before block comments in static initializers.

Summary:
Basically, don't special-case line comments in this regard. And fixed
an incorrect test, that relied on the wrong behavior.

Reviewers: klimek

Reviewed By: klimek

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

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

11 years agoPort HTMLDiagnostics to PathV2. No intended functionality change.
Benjamin Kramer [Wed, 12 Jun 2013 18:13:05 +0000 (18:13 +0000)]
Port HTMLDiagnostics to PathV2. No intended functionality change.

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

11 years agoFix buildbot breakage on PPC64.
Eli Friedman [Wed, 12 Jun 2013 17:31:32 +0000 (17:31 +0000)]
Fix buildbot breakage on PPC64.

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

11 years agoSilencing a signed vs unsigned comparison mismatch in MSVC.
Aaron Ballman [Wed, 12 Jun 2013 15:03:45 +0000 (15:03 +0000)]
Silencing a signed vs unsigned comparison mismatch in MSVC.

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

11 years agoFix memory corruption in CStringChecker
Pavel Labath [Wed, 12 Jun 2013 07:45:04 +0000 (07:45 +0000)]
Fix memory corruption in CStringChecker

Summary:
"register" functions for the checker were caching the checker objects in a
static variable. This caused problems when the function is called with a
different CheckerManager.

Reviewers: klimek

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

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

11 years agoAdd support for complex compound assignments where the LHS is a scalar.
Eli Friedman [Wed, 12 Jun 2013 01:40:06 +0000 (01:40 +0000)]
Add support for complex compound assignments where the LHS is a scalar.

Fixes <rdar://problem/11224126> and PR12790.

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

11 years agoMake va_arg and argument passing to varargs functions work correctly with
Eli Friedman [Wed, 12 Jun 2013 00:13:45 +0000 (00:13 +0000)]
Make va_arg and argument passing to varargs functions work correctly with
AVX vectors when AVX is turned on.

Fixes <rdar://problem/10513611>.

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

11 years agoTweak r183791 so we don't print a note without a source location.
Eli Friedman [Tue, 11 Jun 2013 22:26:34 +0000 (22:26 +0000)]
Tweak r183791 so we don't print a note without a source location.

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

11 years agoInclude Path.h instead of PathV2.h.
Rafael Espindola [Tue, 11 Jun 2013 22:15:02 +0000 (22:15 +0000)]
Include Path.h instead of PathV2.h.

I am about to move PathV2.h to Path.h.

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

11 years agoCorrectly handle designated initializers which modify an array initialized
Eli Friedman [Tue, 11 Jun 2013 21:48:11 +0000 (21:48 +0000)]
Correctly handle designated initializers which modify an array initialized
with a string.  This case is sort of tricky because we can't modify the
StringLiteral used to represent such initializers.
We are forced to decompose the string into individual characters.

Fixes <rdar://problem/10465114>.

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

11 years agoAdd a testcase for PR7434, which is a bug we no longer appear to have.
Richard Smith [Tue, 11 Jun 2013 20:38:45 +0000 (20:38 +0000)]
Add a testcase for PR7434, which is a bug we no longer appear to have.

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

11 years agoInclude PathV1.h in a file that uses it.
Rafael Espindola [Tue, 11 Jun 2013 20:31:32 +0000 (20:31 +0000)]
Include PathV1.h in a file that uses it.

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

11 years agoTry to fix the windows build.
Rafael Espindola [Tue, 11 Jun 2013 20:06:05 +0000 (20:06 +0000)]
Try to fix the windows build.

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

11 years agoInclude PathV1.h in files that use it.
Rafael Espindola [Tue, 11 Jun 2013 19:59:07 +0000 (19:59 +0000)]
Include PathV1.h in files that use it.

This is preparation for replacing Path.h with PathV2.h.

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

11 years agoRevert r183721. It caused cleanups to be delayed too long in some cases.
Richard Smith [Tue, 11 Jun 2013 19:14:25 +0000 (19:14 +0000)]
Revert r183721. It caused cleanups to be delayed too long in some cases.
Testcase to follow.

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

11 years agoReduce the number of symbols on the object file.
Samuel Benzaquen [Tue, 11 Jun 2013 18:51:07 +0000 (18:51 +0000)]
Reduce the number of symbols on the object file.

Summary:
Some compilers where failing with this file because the number of symbols was above 2**15.
- Replace std::list<> and std::vector<> with plain arrays.
- Change VariadicMatcherCreateCallback to be a function template, and a
  single class that wraps the instantiations.
- Remove some more unnecessary template arguments and function calls.

Reviewers: klimek

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

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

11 years ago[libclang/python] Add a few "cursor kinds" that were missing in the python binding...
Argyrios Kyrtzidis [Tue, 11 Jun 2013 18:05:42 +0000 (18:05 +0000)]
[libclang/python] Add a few "cursor kinds" that were missing in the python binding for libclang.

Patch by Mathieu Baudet!

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

11 years agoMake ASTContext::Allocate use size_t for the size argument.
Eli Friedman [Tue, 11 Jun 2013 17:58:38 +0000 (17:58 +0000)]
Make ASTContext::Allocate use size_t for the size argument.

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

11 years agoModify a comment to reflect changes of r183717.
Argyrios Kyrtzidis [Tue, 11 Jun 2013 16:42:34 +0000 (16:42 +0000)]
Modify a comment to reflect changes of r183717.

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

11 years agoInsert a space at the start of a line comment in case it starts with an alphanumeric...
Alexander Kornienko [Tue, 11 Jun 2013 16:01:49 +0000 (16:01 +0000)]
Insert a space at the start of a line comment in case it starts with an alphanumeric character.

Summary:
"//Test" becomes "// Test". This change is aimed to improve code
readability and conformance to certain coding styles. If a comment starts with a
non-alphanumeric character, the space isn't added, e.g. "//-*-c++-*-" stays
unchanged.

Reviewers: klimek

Reviewed By: klimek

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

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

11 years agoSilence GCC warning.
Benjamin Kramer [Tue, 11 Jun 2013 13:13:47 +0000 (13:13 +0000)]
Silence GCC warning.

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

11 years agoASTUnit: Invert the dependency of PrecompilePreambleAction on PrecompilePreambleConsumer.
Benjamin Kramer [Tue, 11 Jun 2013 13:07:19 +0000 (13:07 +0000)]
ASTUnit: Invert the dependency of PrecompilePreambleAction on PrecompilePreambleConsumer.

Actions outlive consumers. PR16295. Found by AddressSanitizer.

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

11 years agoMake it possible to assign clang-format-buffer to a keybinding.
Manuel Klimek [Tue, 11 Jun 2013 12:00:24 +0000 (12:00 +0000)]
Make it possible to assign clang-format-buffer to a keybinding.

Patch by Chris Gray.

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

11 years agoRemove some unicode that sneaked in.
David Majnemer [Tue, 11 Jun 2013 06:19:45 +0000 (06:19 +0000)]
Remove some unicode that sneaked in.

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

11 years agoImplement DR61: Address of ambiguous bound methods should be disallowed
David Majnemer [Tue, 11 Jun 2013 03:56:29 +0000 (03:56 +0000)]
Implement DR61: Address of ambiguous bound methods should be disallowed

DR61 affirms that expressions containing unresolved member access should
be disallowed when performing "address of" operations.

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

11 years agoImplement DR85: Redeclaration of member is forbidden
David Majnemer [Tue, 11 Jun 2013 03:51:23 +0000 (03:51 +0000)]
Implement DR85: Redeclaration of member is forbidden

Disallow the existence of a declaration of a member class that isn't a
forward declaration before it's definition.

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

11 years agoRework IR emission for lifetime-extended temporaries. Instead of trying to walk
Richard Smith [Tue, 11 Jun 2013 02:41:00 +0000 (02:41 +0000)]
Rework IR emission for lifetime-extended temporaries. Instead of trying to walk
into the expression and dig out a single lifetime-extended entity and manually
pull its cleanup outside the expression, instead keep a list of the cleanups
which we'll need to emit when we get to the end of the full-expression. Also
emit those cleanups early, as EH-only cleanups, to cover the case that the
full-expression does not terminate normally. This allows IR generation to
properly model temporary lifetime when multiple temporaries are extended by the
same declaration.

We have a pre-existing bug where an exception thrown from a temporary's
destructor does not clean up lifetime-extended temporaries created in the same
expression and extended to automatic storage duration; that is not fixed by
this patch.

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

11 years agoFix a very silly mistake in r183590.
Eli Friedman [Tue, 11 Jun 2013 01:59:28 +0000 (01:59 +0000)]
Fix a very silly mistake in r183590.

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

11 years agoFix a FIXME in a testcase about packed structs and calls I left around
Eli Friedman [Tue, 11 Jun 2013 01:08:22 +0000 (01:08 +0000)]
Fix a FIXME in a testcase about packed structs and calls I left around
while fixing a related bug.  The fix here was simpler than I thought it
would be.

Fixes <rdar://problem/10530444>.

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

11 years ago[libclang] Allow building a precompiled preamble with compiler errors
Argyrios Kyrtzidis [Tue, 11 Jun 2013 00:36:55 +0000 (00:36 +0000)]
[libclang] Allow building a precompiled preamble with compiler errors

A while ago we allowed libclang to build a PCH that had compiler errors; this was to retain the performance
afforded by a PCH even if the user's code is in an intermediate state.

Extend this for the precompiled preamble as well.

rdar://14109828

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

11 years agoRemove mis-grouping of an objc diagostic in my last
Fariborz Jahanian [Tue, 11 Jun 2013 00:08:48 +0000 (00:08 +0000)]
Remove mis-grouping of an objc diagostic in my last
patch.

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

11 years agoObjective-C [qoi]: Issue better warning when nsstring literal is missing
Fariborz Jahanian [Mon, 10 Jun 2013 23:51:51 +0000 (23:51 +0000)]
Objective-C [qoi]: Issue better warning when nsstring literal is missing
the '@'. PR16287 and // rdar://14106083

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

11 years agoMake sure we don't emit invalid IR for StmtExprs with complex cleanups.
Eli Friedman [Mon, 10 Jun 2013 22:04:49 +0000 (22:04 +0000)]
Make sure we don't emit invalid IR for StmtExprs with complex cleanups.

Fixes <rdar://problem/14074868>.

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

11 years agocleanup (address some more review comments for r183474):
Adrian Prantl [Mon, 10 Jun 2013 21:36:55 +0000 (21:36 +0000)]
cleanup (address some more review comments for r183474):
- reduce default buffer size to 64, which will still be large enough to
  hold any property names found in the wild.
- get rid of the /*static*/ comments.

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

11 years agoUse FPT::getArgTypes() instead of manually building ArrayRefs
Reid Kleckner [Mon, 10 Jun 2013 20:51:09 +0000 (20:51 +0000)]
Use FPT::getArgTypes() instead of manually building ArrayRefs

Made significantly easier with git-clang-format.

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

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

11 years ago[analyzer] SATestBuild: Don't require reference results to have logs.
Jordan Rose [Mon, 10 Jun 2013 19:34:30 +0000 (19:34 +0000)]
[analyzer] SATestBuild: Don't require reference results to have logs.

The Logs directory isn't used for testing, so it's filtered out ahead of
time. However, there's then no reason to include it in version control at
all. Don't error if it's not present.

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

11 years agoAdd a new warning, -Wlogical-not-parentheses, to -Wparentheses.
Richard Trieu [Mon, 10 Jun 2013 18:52:07 +0000 (18:52 +0000)]
Add a new warning, -Wlogical-not-parentheses, to -Wparentheses.

This warning triggers on the logical not of a non-boolean expression on the
left hand side of comparison.  Often, the user meant to negate the comparison,
not just the left hand side of the comparison.  Two notes are also emitted,
the first with a fix-it to add parentheses around the comparison, and the other
to put parenthesis around the not expression to silence the warning.

bool not_equal(int x, int y) {
  return !x == y;  // warn here
}

  return !(x == y);  // first fix-it, to negate comparison.

  return (!x) == y;  // second fix-it, to silence warning.

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

11 years ago[clang-format] Don't flash an ugly cmd prompt in Vim on Windows
Reid Kleckner [Mon, 10 Jun 2013 14:16:26 +0000 (14:16 +0000)]
[clang-format] Don't flash an ugly cmd prompt in Vim on Windows

Reviewers: klimek

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

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

11 years agoFixes the comment for hasDeclaration.
Manuel Klimek [Mon, 10 Jun 2013 08:52:15 +0000 (08:52 +0000)]
Fixes the comment for hasDeclaration.

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

11 years agoSupport for contextual conversion tweaks (N3323) was added, as Revision 183637
Larisse Voufo [Mon, 10 Jun 2013 08:25:58 +0000 (08:25 +0000)]
Support for contextual conversion tweaks (N3323) was added, as Revision 183637

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

11 years agoreverted test
Larisse Voufo [Mon, 10 Jun 2013 06:50:24 +0000 (06:50 +0000)]
reverted test

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

11 years agotest
Larisse Voufo [Mon, 10 Jun 2013 06:28:37 +0000 (06:28 +0000)]
test

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

11 years ago[CodeGen] Make CGCleanup.h include what it now uses
Reid Kleckner [Sun, 9 Jun 2013 16:56:53 +0000 (16:56 +0000)]
[CodeGen] Make CGCleanup.h include what it now uses

Also move CGCleanup.h to the top of CGCleanup.cpp to verify that
CGCleanup.h really includes what it needs.

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

11 years ago[CodeGen] Move EHScopeStack to CGCleanup.h from CodeGenFunction.h
Reid Kleckner [Sun, 9 Jun 2013 16:45:02 +0000 (16:45 +0000)]
[CodeGen] Move EHScopeStack to CGCleanup.h from CodeGenFunction.h

No functionality change.  CGCleanup.cpp provides the implementation for
EHScopeStack, so it seems more consistent to place the class definition
in CGCleanup.h.

This should also help solve a header ordering problem that I have.

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

11 years agoFix the parser's updating of the template depth when parsing local templates and...
Faisal Vali [Sat, 8 Jun 2013 19:47:52 +0000 (19:47 +0000)]
Fix the parser's updating of the template depth when parsing local templates and late-parsed templates.
This is a slight tweak of r180708; It avoids incrementing depth when non-template local classes nested within member templates of local classes are encountered.
This patch was LGTM'd by Doug http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130506/079656.html and passed the regression tests that normally pass (i.e. excluding many Module and Index tests on Windows that fail regardless)

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

11 years agoRevert r183618.
Faisal Vali [Sat, 8 Jun 2013 19:39:00 +0000 (19:39 +0000)]
Revert r183618.
I ran clang-format on my patch but it seemed to have wreaked havoc with new lines  - might have to do with using it on windows :( will resubmit once i've cleaned this issue up. sorry.

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

11 years agoFix the parser's updating of the template depth when parsing local templates and...
Faisal Vali [Sat, 8 Jun 2013 19:33:09 +0000 (19:33 +0000)]
Fix the parser's updating of the template depth when parsing local templates and late-parsed templates. This is a slight tweak of r180708; It avoids incrementing depth when non-template local classes nested within member templates of local classes are encountered.
This patch was LGTM'd by Doug http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130506/079656.html and passed the regression tests that normally pass (i.e. excluding many Module and Index tests on Windows that fail regardless)

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

11 years agoAdd a test case for blocks taking an array typedef
Reid Kleckner [Sat, 8 Jun 2013 18:51:21 +0000 (18:51 +0000)]
Add a test case for blocks taking an array typedef

r183614 was failing because va_list on some platforms is defined in a
similar manner.  This test fails on Windows with r183614 applied.

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

11 years agoRevert "[Sema] Make FunctionType's TSI use unadjusted argument types"
Reid Kleckner [Sat, 8 Jun 2013 18:19:52 +0000 (18:19 +0000)]
Revert "[Sema] Make FunctionType's TSI use unadjusted argument types"

This reverts commit r183614.

It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms,
and the fix is not trivial.

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

11 years ago[Sema] Make FunctionType's TSI use unadjusted argument types
Reid Kleckner [Sat, 8 Jun 2013 17:28:56 +0000 (17:28 +0000)]
[Sema] Make FunctionType's TSI use unadjusted argument types

This helps preserve the type-as-written in the AST, which we need for
MSVC mangling.  In particular, we need to preserve the types of array
parameters in function pointer types.

The essence of this change is:
-  QualType ArgTy = Param->getType();
+  QualType ArgTy = Param->getTypeSourceInfo()->getType();

... followed by the adjustment in ActOnFunctionDeclarator().

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

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

11 years agoRecognition of empty structures and unions is moved to semantic stage
Serge Pavlov [Sat, 8 Jun 2013 13:29:58 +0000 (13:29 +0000)]
Recognition of empty structures and unions is moved to semantic stage

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

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

11 years agoAdded a type checking which handle the case of an ext vector and integral scalar
Jin-Gu Kang [Sat, 8 Jun 2013 02:15:36 +0000 (02:15 +0000)]
Added a type checking which handle the case of an ext vector and integral scalar

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

11 years ago[analyzer] Minor fixups to r183062
Anna Zaks [Sat, 8 Jun 2013 00:29:29 +0000 (00:29 +0000)]
[analyzer] Minor fixups to r183062

Based on feedback from Jordan.

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

11 years ago[analyzer; alternate edges] Fix the edge locations in presence of macros.
Anna Zaks [Sat, 8 Jun 2013 00:29:24 +0000 (00:29 +0000)]
[analyzer; alternate edges] Fix the edge locations in presence of macros.

We drew the diagnostic edges to wrong statements in cases the note was on a macro.
The fix is simple, but seems to work just fine for a whole bunch of test cases (plist-macros.cpp).

Also, removes an unnecessary edge in edges-new.mm, when function signature starts with a macro.

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

11 years agoFixed comment typo.
Michael Gottesman [Sat, 8 Jun 2013 00:27:19 +0000 (00:27 +0000)]
Fixed comment typo.

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

11 years agoDebug info: An if condition now creates a lexical scope of its own.
Adrian Prantl [Sat, 8 Jun 2013 00:16:55 +0000 (00:16 +0000)]
Debug info: An if condition now creates a lexical scope of its own.
Two variables with the same name declared in two if conditions in the same
scope are no longer coalesced into one.

rdar://problem/14024005

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

11 years agoRecursively lifetime-extend into array temporaries. These can get implicitly
Richard Smith [Sat, 8 Jun 2013 00:02:08 +0000 (00:02 +0000)]
Recursively lifetime-extend into array temporaries. These can get implicitly
created through binding a reference-to-array to an initializer list.

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

11 years agoWhen we're compiling with -pg make sure to link with gcrt1.o on linux. Be
Eric Christopher [Fri, 7 Jun 2013 23:25:01 +0000 (23:25 +0000)]
When we're compiling with -pg make sure to link with gcrt1.o on linux. Be
sure to do this always, this matches the behavior for the gcc driver.

Fixes PR16251.

Based on a patch by Qiao Yang.

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

11 years agoFix va_arg on x86-64 for a struct containing a single int128_t. PR16248
Eli Friedman [Fri, 7 Jun 2013 23:20:55 +0000 (23:20 +0000)]
Fix va_arg on x86-64 for a struct containing a single int128_t.  PR16248

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

11 years agoLoosen r178109 even further, to assume that all redefined macros in system headers...
Douglas Gregor [Fri, 7 Jun 2013 22:56:11 +0000 (22:56 +0000)]
Loosen r178109 even further, to assume that all redefined macros in system headers and system modules are equivalent.

Fixes <rdar://problem/14025673>.

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

11 years ago80-column fixup after recent change to getOrCreateType.
Eric Christopher [Fri, 7 Jun 2013 22:54:39 +0000 (22:54 +0000)]
80-column fixup after recent change to getOrCreateType.

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

11 years agoEven in a modules world, people will depend on the weird xmmintrin.h -> emmintrin...
Douglas Gregor [Fri, 7 Jun 2013 22:49:44 +0000 (22:49 +0000)]
Even in a modules world, people will depend on the weird xmmintrin.h -> emmintrin.h forwarding.

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

11 years agoFix line endings.
Eli Friedman [Fri, 7 Jun 2013 22:42:22 +0000 (22:42 +0000)]
Fix line endings.

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

11 years agoaddress some comments on r183474:
Adrian Prantl [Fri, 7 Jun 2013 22:29:12 +0000 (22:29 +0000)]
address some comments on r183474:
- factor the name construction part out from constructSetterName
- rename constructSetterName to the more appropriate constructSetterSelector

no functionality change intended.
rdar://problem/14035789

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

11 years agoRevert "Properly consider the range of enum for range comparisons in C mode"
David Majnemer [Fri, 7 Jun 2013 22:07:20 +0000 (22:07 +0000)]
Revert "Properly consider the range of enum for range comparisons in C mode"

The approach r183084 took was wrong, back it out.

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

11 years agoAdd missing file from r183563 (the recommit of 183466).
Eli Friedman [Fri, 7 Jun 2013 20:33:10 +0000 (20:33 +0000)]
Add missing file from r183563 (the recommit of 183466).

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

11 years agoRe-commit r183466 with a fix to make the TypeLoc casting machinery work
Eli Friedman [Fri, 7 Jun 2013 20:31:48 +0000 (20:31 +0000)]
Re-commit r183466 with a fix to make the TypeLoc casting machinery work
correctly in the presence of qualified types.

(I had to change the unittest because it was trying to cast a
QualifiedTypeLoc to TemplateSpecializationTypeLoc.)

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

11 years agoObjective-C: Another case of issuing warning about misusing
Fariborz Jahanian [Fri, 7 Jun 2013 20:26:51 +0000 (20:26 +0000)]
Objective-C: Another case of issuing warning about misusing
property auto-synthesis before knowingit it is to be
auto-synthesized. // rdar://14094682

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

11 years agoPR16273: Weaken a bogus assertion.
Richard Smith [Fri, 7 Jun 2013 20:03:01 +0000 (20:03 +0000)]
PR16273: Weaken a bogus assertion.

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

11 years agoDefine id to the correct type.
Rafael Espindola [Fri, 7 Jun 2013 18:41:01 +0000 (18:41 +0000)]
Define id to the correct type.

Found this while working on pr16247. The fix for that bug will cause clang to
reject this.

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

11 years agoObjective-C: Removes a bogus warning about auto-synthesis
Fariborz Jahanian [Fri, 7 Jun 2013 18:32:55 +0000 (18:32 +0000)]
Objective-C: Removes a bogus warning about auto-synthesis
of properties. Fixes // rdar://14085456

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

11 years agoThread the 'Invalid' out parameter through SourceManager::getSLocEntry() and callees...
Argyrios Kyrtzidis [Fri, 7 Jun 2013 17:57:59 +0000 (17:57 +0000)]
Thread the 'Invalid' out parameter through SourceManager::getSLocEntry() and callees of SourceManager::getSLocEntryByID().

Also add an 'Invalid' check in SourceManager::computeMacroArgsCache().

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

11 years agoImproved handling of escaped newlines at the token start.
Alexander Kornienko [Fri, 7 Jun 2013 17:45:07 +0000 (17:45 +0000)]
Improved handling of escaped newlines at the token start.

Summary: Remove them from the TokenText as well.

Reviewers: klimek

Reviewed By: klimek

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

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

11 years agoHandle Unicode characters in fix-it replacement strings.
Jordan Rose [Fri, 7 Jun 2013 17:16:01 +0000 (17:16 +0000)]
Handle Unicode characters in fix-it replacement strings.

Patch by Sukolsak Sakshuwong!

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

11 years agofix up recogtion of block pointer type in my last patch.
Fariborz Jahanian [Fri, 7 Jun 2013 16:07:38 +0000 (16:07 +0000)]
fix up recogtion of block pointer type in my last patch.
// rdar://14085217.
e-This line, and those below, will be ignored--

M    lib/Sema/SemaExpr.cpp

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

11 years agoFixed calculation of penalty when breaking tokens.
Alexander Kornienko [Fri, 7 Jun 2013 16:02:52 +0000 (16:02 +0000)]
Fixed calculation of penalty when breaking tokens.

Summary:
Introduced two new style parameters: PenaltyBreakComment and
PenaltyBreakString. Add penalty for each character of a breakable token beyond
the column limit (this relates mainly to comments, as they are broken only on
whitespace). Tuned PenaltyBreakComment to prefer comment breaking over breaking
inside most binary expressions.
Fixed a bug that prevented *, & and && from being considered TT_BinaryOperator
in the presense of adjacent comments.

Reviewers: klimek, djasper

Reviewed By: klimek

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

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

11 years agoAdds a test that verifies angle bracket locations.
Manuel Klimek [Fri, 7 Jun 2013 11:27:57 +0000 (11:27 +0000)]
Adds a test that verifies angle bracket locations.

Regression test to make sure TemplateSpecializationTypeLocs have the
correct locations for angle brackets.

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

11 years agoReverts r183466: "Perform dynamic alignment computations..."
Manuel Klimek [Fri, 7 Jun 2013 11:27:53 +0000 (11:27 +0000)]
Reverts r183466: "Perform dynamic alignment computations..."

This introduces bugs in TemplateSpecializationTypeLoc's angle bracket
locations.

Regression test follows in a subsequent commit.

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

11 years agoReverting test commit
Faisal Vali [Fri, 7 Jun 2013 05:33:21 +0000 (05:33 +0000)]
Reverting test commit

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

11 years agotest commit
Faisal Vali [Fri, 7 Jun 2013 05:19:33 +0000 (05:19 +0000)]
test commit

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

11 years agoPR16243: Use CXXThisOverride during template instantiation, and fix up the
Richard Smith [Fri, 7 Jun 2013 02:33:37 +0000 (02:33 +0000)]
PR16243: Use CXXThisOverride during template instantiation, and fix up the
places which weren't setting it up properly. This allows us to get the right
cv-qualifiers for 'this' when it appears outside a method body in a class
template.

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

11 years agoWhen we're synthesizing copy/move-assignment, we can't form a reference to an
Eli Friedman [Fri, 7 Jun 2013 01:48:56 +0000 (01:48 +0000)]
When we're synthesizing copy/move-assignment, we can't form a reference to an
invalid field; make sure we don't try.  Fixes <rdar://problem/14084171>.

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

11 years agodocumentation: remove confusing reference to properties.
Adrian Prantl [Fri, 7 Jun 2013 01:10:48 +0000 (01:10 +0000)]
documentation: remove confusing reference to properties.

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

11 years agoObjC Debug Info: Emit the names of accessors whenever they diverge from
Adrian Prantl [Fri, 7 Jun 2013 01:10:45 +0000 (01:10 +0000)]
ObjC Debug Info: Emit the names of accessors whenever they diverge from
the default names, not just when the isImplicit flag is set.

rdar://problem/14035789

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

11 years agoImprove documentation.
Adrian Prantl [Fri, 7 Jun 2013 01:10:41 +0000 (01:10 +0000)]
Improve documentation.

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

11 years agoblocks: fixes an ast bug when block pointer variable
Fariborz Jahanian [Fri, 7 Jun 2013 00:48:14 +0000 (00:48 +0000)]
blocks: fixes an ast bug when block pointer variable
is evaluated in a condition expression and then
dereferenced to envoke the block. This is
pr15663 and I applied a slight variation of the
patch with a test case. (patch is from
Arthur O'Dwyer). Also // rdar://14085217

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

11 years agoDiagnose malformed x86 inline asm using 'y' constraint.
Tim Northover [Fri, 7 Jun 2013 00:04:50 +0000 (00:04 +0000)]
Diagnose malformed x86 inline asm using 'y' constraint.

X86's 'y' inline assembly constraint represents an MMX register, this change
prevents Clang from hitting an assertion when passed an incompatible type to
deal with.

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

11 years agoPerform dynamic alignment computations so that the data in TypeLocs is
Eli Friedman [Fri, 7 Jun 2013 00:04:31 +0000 (00:04 +0000)]
Perform dynamic alignment computations so that the data in TypeLocs is
correctly aligned.  Not performing such computations led to misaligned loads,
which crash on some platforms and are generally bad on other platforms.

The implementation of TypeLocBuilder::pushImpl is rather messy; code using
TypeLocBuilder accidentally assumes that partial TypeLocs are
laid out like a complete TypeLoc.  As a followup, I intend to work on
fixing the TypeLocBuilder API to avoid exposing partial TypeLocs; this should
substantially simplify the implemementation.

Fixes PR16144.

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