]> granicus.if.org Git - clang/log
clang
10 years agoMark auto-generated file as auto-generated, as suggested by Alp.
Richard Smith [Thu, 5 Dec 2013 21:08:20 +0000 (21:08 +0000)]
Mark auto-generated file as auto-generated, as suggested by Alp.

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

10 years agoPass down the target CPU to the system assembler for NetBSD/ARM.
Joerg Sonnenberger [Thu, 5 Dec 2013 21:07:29 +0000 (21:07 +0000)]
Pass down the target CPU to the system assembler for NetBSD/ARM.

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

10 years agoObjectiveC: Don't warn when method implemented in
Fariborz Jahanian [Thu, 5 Dec 2013 20:52:31 +0000 (20:52 +0000)]
ObjectiveC: Don't warn when method implemented in
category is declared in category's primary
class's super class. Because the super class is
expected to implemented the method. // rdar://15580969

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

10 years ago[c-index-test] For the '-remap-file' option use a comma for separator which is more
Argyrios Kyrtzidis [Thu, 5 Dec 2013 20:13:27 +0000 (20:13 +0000)]
[c-index-test] For the '-remap-file' option use a comma for separator which is more
Windows friendly than the colon.

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

10 years agoFix assertion failure left over from changes to move away from "darwin" triples.
Bob Wilson [Thu, 5 Dec 2013 19:38:42 +0000 (19:38 +0000)]
Fix assertion failure left over from changes to move away from "darwin" triples.

I happened to notice this while trying to write a test for an iOS simulator
target. I suspect we just missed this when we added separate "macosx" and "ios"
triples instead of the generic "darwin" OS.

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

10 years agoAttributeList: tweak the conditional order to avoid two strcmps
Alp Toker [Thu, 5 Dec 2013 18:04:42 +0000 (18:04 +0000)]
AttributeList: tweak the conditional order to avoid two strcmps

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

10 years agoclang-format vsix cmake build: use ${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}
Hans Wennborg [Thu, 5 Dec 2013 17:49:58 +0000 (17:49 +0000)]
clang-format vsix cmake build: use ${LLVM_TOOLS_BINARY_DIR}/${CMAKE_CFG_INTDIR}
as the location for grabbing clang-format.exe, and also output the .vsix here.

This allows us to find clang-format.exe when building from a MSVC Solution.

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

10 years agoCheck the initial line number without going through PresumedLoc
Alp Toker [Thu, 5 Dec 2013 17:28:42 +0000 (17:28 +0000)]
Check the initial line number without going through PresumedLoc

No practical difference in this case and would return 1 either way, but this is
more self-explanatory.

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

10 years agoFix a tranche of comment, test and doc typos
Alp Toker [Thu, 5 Dec 2013 16:25:25 +0000 (16:25 +0000)]
Fix a tranche of comment, test and doc typos

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

10 years agoPR17983: Fix crasher bug in C++1y mode when performing a non-global array
Richard Smith [Thu, 5 Dec 2013 08:30:59 +0000 (08:30 +0000)]
PR17983: Fix crasher bug in C++1y mode when performing a non-global array
delete on a class which has no array cookie and has no class-specific operator
new.

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

10 years ago[libclang] Record ranges skipped by the preprocessor and expose them with libclang.
Argyrios Kyrtzidis [Thu, 5 Dec 2013 08:19:32 +0000 (08:19 +0000)]
[libclang] Record ranges skipped by the preprocessor and expose them with libclang.

Patch by Erik Verbruggen!

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

10 years ago[c-index-test] Enhance perform_test_reparse_source() to allow remapping a file
Argyrios Kyrtzidis [Thu, 5 Dec 2013 08:19:23 +0000 (08:19 +0000)]
[c-index-test] Enhance perform_test_reparse_source() to allow remapping a file
at a particular reparsing iteration.

Passing '-remap-file-1=from:to' will remap the files in the second iteration.

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

10 years ago[c-index-test] For the '-remap-file=' option use ':' instead of ';' for separator.
Argyrios Kyrtzidis [Thu, 5 Dec 2013 08:19:18 +0000 (08:19 +0000)]
[c-index-test] For the '-remap-file=' option use ':' instead of ';' for separator.

lldb does not like semicolon as part of an option.

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

10 years agoclang-format-diff.py: pass through errors to stderr, not stdout
Alp Toker [Thu, 5 Dec 2013 08:14:54 +0000 (08:14 +0000)]
clang-format-diff.py: pass through errors to stderr, not stdout

Also use write() for unified diff output to avoid further processing by the
print function (e.g. trailing newline).

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

10 years agoUpdate C++ status from 'SVN' to 'Clang 3.4' in preparation for release. Leave
Richard Smith [Thu, 5 Dec 2013 07:52:05 +0000 (07:52 +0000)]
Update C++ status from 'SVN' to 'Clang 3.4' in preparation for release. Leave
boxes yellow until we release, though.

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

10 years agoImplement DR482: namespace members can be redeclared with a qualified name
Richard Smith [Thu, 5 Dec 2013 07:51:02 +0000 (07:51 +0000)]
Implement DR482: namespace members can be redeclared with a qualified name
within their namespace, and such a redeclaration isn't required to be a
definition any more.

Update DR status page to say Clang 3.4 instead of SVN and add new Clang 3.5
category (but keep Clang 3.4 yellow for now).

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

10 years agoFix comment typo in r196476
Alp Toker [Thu, 5 Dec 2013 07:16:23 +0000 (07:16 +0000)]
Fix comment typo in r196476

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

10 years ago[objc] If an interface has no initializer marked as designated and introduces at...
Argyrios Kyrtzidis [Thu, 5 Dec 2013 07:07:03 +0000 (07:07 +0000)]
[objc] If an interface has no initializer marked as designated and introduces at least one new initializer,
don't assume that it inherits the designated initializers from the super class.

If the assumption was wrong because a new initializer was a designated one that was not marked as such,
we will emit misleading warnings for subclasses of the interface.

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

10 years agoCorrect hyphenations in comments and assert messages
Alp Toker [Thu, 5 Dec 2013 04:47:09 +0000 (04:47 +0000)]
Correct hyphenations in comments and assert messages

This patch tries to avoid unrelated changes other than fixing a few
hyphen-related ambiguities in nearby lines.

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

10 years agoPer [dcl.meaning]p1, a name in an inline namespace can be redeclared using a
Richard Smith [Thu, 5 Dec 2013 04:30:04 +0000 (04:30 +0000)]
Per [dcl.meaning]p1, a name in an inline namespace can be redeclared using a
name from the enclosing namespace set if the name is specified as a
qualified-id.

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

10 years agoFixed a bad assert from r194968. r194969 removed the assert.
Richard Trieu [Thu, 5 Dec 2013 04:27:16 +0000 (04:27 +0000)]
Fixed a bad assert from r194968.  r194969 removed the assert.

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

10 years agoAdd an assert to make it clear we're on the first line
Alp Toker [Thu, 5 Dec 2013 03:41:20 +0000 (03:41 +0000)]
Add an assert to make it clear we're on the first line

A raw lexer in its initial state is guaranteed to be on line number one.

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

10 years agoRemove unused variable.
Richard Trieu [Thu, 5 Dec 2013 02:52:09 +0000 (02:52 +0000)]
Remove unused variable.

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

10 years agoFix non-MSVC build error in ASTContext::getAdjustedType
Reid Kleckner [Thu, 5 Dec 2013 01:41:37 +0000 (01:41 +0000)]
Fix non-MSVC build error in ASTContext::getAdjustedType

Use FunctionTypeUnwrapper like we do in AttributedType to try to keep
some sugar.  We can actually do one better here in the future by
avoiding the AdjustedType node altogether when no sugar would be lost.

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

10 years agoFix init-captures for generic lambdas.
Faisal Vali [Thu, 5 Dec 2013 01:40:41 +0000 (01:40 +0000)]
Fix init-captures for generic lambdas.

For an init capture, process the initialization expression
right away.  For lambda init-captures such as the following:
const int x = 10;
 auto L = [i = x+1](int a) {
   return [j = x+2,
          &k = x](char b) { };
 };
keep in mind that each lambda init-capture has to have:
 - its initialization expression executed in the context
   of the enclosing/parent decl-context.
 - but the variable itself has to be 'injected' into the
   decl-context of its lambda's call-operator (which has
   not yet been created).
Each init-expression is a full-expression that has to get
Sema-analyzed (for capturing etc.) before its lambda's
call-operator's decl-context, scope & scopeinfo are pushed on their
respective stacks.  Thus if any variable is odr-used in the init-capture
it will correctly get captured in the enclosing lambda, if one exists.
The init-variables above are created later once the lambdascope and
call-operators decl-context is pushed onto its respective stack.

Since the lambda init-capture's initializer expression occurs in the
context of the enclosing function or lambda, therefore we can not wait
till a lambda scope has been pushed on before deciding whether the
variable needs to be captured.  We also need to process all
lvalue-to-rvalue conversions and discarded-value conversions,
so that we can avoid capturing certain constant variables.
For e.g.,
 void test() {
  const int x = 10;
  auto L = [&z = x](char a) { <-- don't capture by the current lambda
    return [y = x](int i) { <-- don't capture by enclosing lambda
         return y;
    }
  };
If x was not const, the second use would require 'L' to capture, and
that would be an error.
Make sure TranformLambdaExpr is also aware of this.

Patch approved by Richard (Thanks!!)
http://llvm-reviews.chandlerc.com/D2092

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

10 years agoParse: Recover better from bad definitions with base specifiers
David Majnemer [Thu, 5 Dec 2013 01:36:53 +0000 (01:36 +0000)]
Parse: Recover better from bad definitions with base specifiers

We would skip until the next comma, hoping good things whould lie there,
however this would fail when we have such things as this:

struct A {};
template <typename>
struct D;
template <>
struct D<C> : B, A::D;

Once this happens, we would believe that D with a nested namespace
specifier of A was a variable that was being declared. We would go on
to complain that there was an extraneous 'template <>' on their variable
declaration.

Crashes would happen when 'A' gets defined as 'enum class A {}' as
various asserts would fire.

Instead, we should skip up until the semicolon if we see that we are in
the middle of a definition and the current token is a ':'

This fixes PR17084.

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

10 years agoAdd an AdjustedType sugar node for adjusting calling conventions
Reid Kleckner [Thu, 5 Dec 2013 01:23:43 +0000 (01:23 +0000)]
Add an AdjustedType sugar node for adjusting calling conventions

Summary:
In general, this type node can be used to represent any type adjustment
that occurs implicitly without losing type sugar.  The immediate use of
this is to adjust the calling conventions of member function pointer
types without breaking template instantiation.

Fixes PR17996.

Reviewers: rsmith

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

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

10 years agoSimplify the constructor to CodeGenABITypes.
Mark Lacey [Thu, 5 Dec 2013 01:23:01 +0000 (01:23 +0000)]
Simplify the constructor to CodeGenABITypes.

The CodeGenOptions are not used for ABI type selection, so we will just
create one with the default constructor (there is a FloatABI option in
CodeGenOptions that is passed on to LLVM, but not used in Clang for LLVM
IR type generation).

We can use the DiagnosticsEngine on the ASTContext rather than making a
client pass one in explicitly.

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

10 years agoReject template-ids containing literal-operator-ids that have a dependent
Richard Smith [Thu, 5 Dec 2013 00:58:33 +0000 (00:58 +0000)]
Reject template-ids containing literal-operator-ids that have a dependent
nested-name-specifier, rather than crashing. (In fact, reject all
literal-operator-ids that have a non-namespace nested-name-specifier). The
grammar doesn't allow these in some cases, and in other cases does allow them
but instantiation will always fail.

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

10 years agoGiving a Subjects list to DllExport, which allows the removal of some custom semantic...
Aaron Ballman [Wed, 4 Dec 2013 23:23:19 +0000 (23:23 +0000)]
Giving a Subjects list to DllExport, which allows the removal of some custom semantic handling. The same cannot be done for DllImport, and so comments were left explaining why.

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

10 years agoCommon functionality is already checked within SemaDeclAttr.cpp and so it does not...
Aaron Ballman [Wed, 4 Dec 2013 23:07:58 +0000 (23:07 +0000)]
Common functionality is already checked within SemaDeclAttr.cpp and so it does not need to be re-checked for each target.

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

10 years agoFactor duplicated code for TransformTypeInObjectScope
Reid Kleckner [Wed, 4 Dec 2013 22:51:51 +0000 (22:51 +0000)]
Factor duplicated code for TransformTypeInObjectScope

Fixes the relevant FIXME about copy-pasted code.

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

10 years agoFix for PR18052 - Lambdas within NSDMI's and default arguments in Nested classes.
Faisal Vali [Wed, 4 Dec 2013 22:43:08 +0000 (22:43 +0000)]
Fix for PR18052 - Lambdas within NSDMI's and default arguments in Nested classes.

Clang currently croaks on the following:
  struct X1 {
    struct X2 {
      int L = ([] (int i) { return i; })(2);
    };
  };

asserting that the containing lexical context of the lambda is not Sema's cur context, when pushing the lambda's decl context on.

This occurs because (prior to this patch) getContainingDC always returns the non-nested class for functions at class scope (even for inline member functions of nested classes (to account for delayed parsing of their bodies)).  The patch addresses this by having getContainingDC always return the lexical DC for a lambda's call operator.

Link to the bug: http://llvm.org/bugs/show_bug.cgi?id=18052
Link to Richard Smith's feedback on phabricator: http://llvm-reviews.chandlerc.com/D2331

Thanks!

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

10 years agoThe MSP430Interrupt attribute does have a sema handler (it's in TargetAttributesSema...
Aaron Ballman [Wed, 4 Dec 2013 22:23:43 +0000 (22:23 +0000)]
The MSP430Interrupt attribute does have a sema handler (it's in TargetAttributesSema). Added a FIXME about the attribute being nameless when it really does have a valid name, and a comment explaining why we're using the name instead of the attribute kind.

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

10 years agoGetting rid of some hard-coded strings. No functional changes intended, though some...
Aaron Ballman [Wed, 4 Dec 2013 22:02:33 +0000 (22:02 +0000)]
Getting rid of some hard-coded strings. No functional changes intended, though some test cases needed to be updated for attribute names becoming quoted.

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

10 years agoThis attribute somehow remained nameless in the attribute tablegen, until now.
Aaron Ballman [Wed, 4 Dec 2013 21:43:30 +0000 (21:43 +0000)]
This attribute somehow remained nameless in the attribute tablegen, until now.

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

10 years agoRemove empty header.
Rafael Espindola [Wed, 4 Dec 2013 20:44:03 +0000 (20:44 +0000)]
Remove empty header.

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

10 years agoObjectiveC - Introducing objc_bridge_related attribute
Fariborz Jahanian [Wed, 4 Dec 2013 20:32:50 +0000 (20:32 +0000)]
ObjectiveC - Introducing objc_bridge_related attribute
which specifies couple of (optional) method selectors
for bridging a CFobject to or from an ObjectiveC
object. This is wip. // rdsr://15499111

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

10 years agoEnea Zaffanella's fix for the PPCallbacks Elif callback, with a slight re-org, and...
John Thompson [Wed, 4 Dec 2013 20:19:30 +0000 (20:19 +0000)]
Enea Zaffanella's fix for the PPCallbacks Elif callback, with a slight re-org, and an update of the new PPCallbacks test (soon to be moved to clang from extra), rather the unittest.

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

10 years agoFix indentation.
Richard Smith [Wed, 4 Dec 2013 20:05:45 +0000 (20:05 +0000)]
Fix indentation.

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

10 years ago[ms-cxxabi] Construct and destroy call arguments in the correct order
Reid Kleckner [Wed, 4 Dec 2013 19:23:12 +0000 (19:23 +0000)]
[ms-cxxabi] Construct and destroy call arguments in the correct order

Summary:
MSVC destroys arguments in the callee from left to right.  Because C++
objects have to be destroyed in the reverse order of construction, Clang
has to construct arguments from right to left and destroy arguments from
left to right.

This patch fixes the ordering by reversing the order of evaluation of
all call arguments under the MS C++ ABI.

Fixes PR18035.

Reviewers: rsmith

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

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

10 years agoFix test case due to r196394 and improve it to not rely on LLVM code generation either.
David Blaikie [Wed, 4 Dec 2013 19:09:19 +0000 (19:09 +0000)]
Fix test case due to r196394 and improve it to not rely on LLVM code generation either.

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

10 years agoWhen parsing ignored attribute arguments, presuming the first argument is an unresolv...
Aaron Ballman [Wed, 4 Dec 2013 15:32:26 +0000 (15:32 +0000)]
When parsing ignored attribute arguments, presuming the first argument is an unresolved identifier the same way that we do for unknown arguments. This resolves PR18075, where we regressed the handling of OpenBSD's bounded attribute.

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

10 years agoAdded a regression test for the change in r196380
Alexander Kornienko [Wed, 4 Dec 2013 13:58:27 +0000 (13:58 +0000)]
Added a regression test for the change in r196380

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

10 years agoFix the regression caused by r196378
Alexander Kornienko [Wed, 4 Dec 2013 13:25:26 +0000 (13:25 +0000)]
Fix the regression caused by r196378

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

10 years agoLeave constructor initializer lists on one line in styles with no column limit.
Alexander Kornienko [Wed, 4 Dec 2013 12:21:08 +0000 (12:21 +0000)]
Leave constructor initializer lists on one line in styles with no column limit.

Summary:
Allow tryFitMultipleLinesInOne join unwrapped lines when
ContinuationIndenter::mustBreak doesn't agree. But don't merge any lines, that
are separate in the input.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2321

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

10 years agoRevert r196372, "do not warn about unknown pragmas in modes that do not handle them...
NAKAMURA Takumi [Wed, 4 Dec 2013 11:12:26 +0000 (11:12 +0000)]
Revert r196372, "do not warn about unknown pragmas in modes that do not handle them (pr9537)"

It broke clang tests on some hosts with +Asserts. Seems "STDC" clashes.

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

10 years agodo not warn about unknown pragmas in modes that do not handle them (pr9537)
Lubos Lunak [Wed, 4 Dec 2013 10:21:41 +0000 (10:21 +0000)]
do not warn about unknown pragmas in modes that do not handle them (pr9537)

And refactor to have just one place in code that sets up the empty
pragma handlers.

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

10 years ago[SystemZ] Fix handling of pass-by-pointer arguments
Richard Sandiford [Wed, 4 Dec 2013 09:59:57 +0000 (09:59 +0000)]
[SystemZ] Fix handling of pass-by-pointer arguments

I'd misunderstood getIndirect() to mean that the argument should be passed
as a pointer at the ABI level, with the ByVal argument choosing caller-copy
semantics over no-caller-copy (callee-copy-on-write) semantics.  But
getIndirect(x) actually means that x is passed by pointer at the IR
level but (at least on all other targets I looked at) directly at the
ABI level.  getIndirect(x, false) selects a pointer to a caller-made
copy, which is what SystemZ was aiming for.

This fixes a miscompilation of c-index-test.  Structure arguments were being
passed by pointer, but no copy was being made, so a write in the callee
stomped over a caller's local variable.

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

10 years agoSema: Propagate the mangling number into instantiations
David Majnemer [Wed, 4 Dec 2013 09:01:55 +0000 (09:01 +0000)]
Sema: Propagate the mangling number into instantiations

We would lose track of the mangling number assigned to the original
declaration which would cause us to create manglings that didn't match
the Itanium C++ specification.

e.g. Two static fields with the same name inside of a function template
would receive the same mangling with LLVM fixing up the second field so
they wouldn't collide.  This would create an incompatibility with other
compilers following the Itanium ABI.

I've confirmed that the new mangling is identical to the ones generated
by icc and gcc.

N.B. This was uncovered while working on Microsoft mangler.

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

10 years ago[AArch64 NEON] Add ACLE intrinsic vceqz_f64.
Kevin Qin [Wed, 4 Dec 2013 08:02:11 +0000 (08:02 +0000)]
[AArch64 NEON] Add ACLE intrinsic vceqz_f64.

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

10 years ago[AArch64 NEON] Add missing compare intrinsics.
Kevin Qin [Wed, 4 Dec 2013 07:53:09 +0000 (07:53 +0000)]
[AArch64 NEON] Add missing compare intrinsics.

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

10 years agoFix error recovery in return statement.
Serge Pavlov [Wed, 4 Dec 2013 03:51:59 +0000 (03:51 +0000)]
Fix error recovery in return statement.

This patch fixes PR16989.

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

10 years agoFix PR17637: incorrect calculation of template parameter depth
Faisal Vali [Wed, 4 Dec 2013 03:51:14 +0000 (03:51 +0000)]
Fix PR17637: incorrect calculation of template parameter depth

In delayed template parsing mode, adjust the template depth counter for each template parameter list associated with an out of line member template specialization.

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

10 years agoclang/test: REQUIRES: s/x86-64-registered-target/x86-registered-target/
NAKAMURA Takumi [Wed, 4 Dec 2013 03:41:33 +0000 (03:41 +0000)]
clang/test: REQUIRES: s/x86-64-registered-target/x86-registered-target/

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

10 years agoclang/test: REQUIRES: s/ppc{32|64}-registered-target/powerpc-registered-target/
NAKAMURA Takumi [Wed, 4 Dec 2013 03:41:15 +0000 (03:41 +0000)]
clang/test: REQUIRES: s/ppc{32|64}-registered-target/powerpc-registered-target/

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

10 years agoclang/test/CodeGen/builtins-nvptx.c: Prune "REQUIRES: nvptx64-registered-target"...
NAKAMURA Takumi [Wed, 4 Dec 2013 03:41:02 +0000 (03:41 +0000)]
clang/test/CodeGen/builtins-nvptx.c: Prune "REQUIRES: nvptx64-registered-target". "nvptx" should imply it.

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

10 years agocheck-clang: Introduce get_llvm_config_props in clang/test/lit.cfg.
NAKAMURA Takumi [Wed, 4 Dec 2013 03:40:56 +0000 (03:40 +0000)]
check-clang: Introduce get_llvm_config_props in clang/test/lit.cfg.

In trunk, we can use features as below:

  aarch64-registered-target
  hexagon-registered-target
  msp430-registered-target
  r600-registered-target
  systemz-registered-target
  xcore-registered-target

Each of them, as below, implies corresponding subtargets:

  arm-registered-target   -- arm, thumb
  mips-registered-target  -- mips, mips64, mips64el, mipsel
  nvptx-registered-target -- nvptx, nvptx64
  sparc-registered-target -- sparc, sparcv9
  x86-registered-target   -- x86, x86-64

They will be renamed:

  cppbackend-registered-target -- was "cpp". Unused in trunk.
  powerpc-registered-target -- was "ppc32", "ppc64" and "ppc64le".

The feature "asserts" is also taken from llvm-config.

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

10 years agoAdd newline at eof.
NAKAMURA Takumi [Wed, 4 Dec 2013 03:40:51 +0000 (03:40 +0000)]
Add newline at eof.

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

10 years agoRemove redundant check.
Richard Smith [Wed, 4 Dec 2013 01:01:51 +0000 (01:01 +0000)]
Remove redundant check.

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

10 years agoFix crash if a dependent template-id was assumed to be a type but instantiates
Richard Smith [Wed, 4 Dec 2013 00:56:29 +0000 (00:56 +0000)]
Fix crash if a dependent template-id was assumed to be a type but instantiates
to a variable template specialization.

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

10 years agoclang-format-diff.py: Fix 'beintroduced' in help output
Alp Toker [Wed, 4 Dec 2013 00:48:22 +0000 (00:48 +0000)]
clang-format-diff.py: Fix 'beintroduced' in help output

Also update docs to reflect recently changed -i inplace edit behaviour.

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

10 years agoFix crash if a variable template specialization is used in a nested-name-specifier.
Richard Smith [Wed, 4 Dec 2013 00:47:45 +0000 (00:47 +0000)]
Fix crash if a variable template specialization is used in a nested-name-specifier.

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

10 years agoFix several crash-on-invalids when using template-ids that aren't
Richard Smith [Wed, 4 Dec 2013 00:28:23 +0000 (00:28 +0000)]
Fix several crash-on-invalids when using template-ids that aren't
simple-template-ids (eg, 'operator+<int>') in weird places.

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

10 years ago[objc] Add a warning when a class that provides a designated initializer, does not
Argyrios Kyrtzidis [Tue, 3 Dec 2013 21:11:54 +0000 (21:11 +0000)]
[objc] Add a warning when a class that provides a designated initializer, does not
override all of the designated initializers of its superclass.

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

10 years ago[objc] Emit warning when the implementation of a secondary initializer calls on
Argyrios Kyrtzidis [Tue, 3 Dec 2013 21:11:49 +0000 (21:11 +0000)]
[objc] Emit warning when the implementation of a secondary initializer calls on
super another initializer and when the implementation does not delegate to
another initializer via a call on 'self'.

A secondary initializer is an initializer method not marked as a designated
initializer within a class that has at least one initializer marked as a
designated initializer.

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

10 years ago[objc] Emit warnings when the implementation of a designated initializer calls on
Argyrios Kyrtzidis [Tue, 3 Dec 2013 21:11:43 +0000 (21:11 +0000)]
[objc] Emit warnings when the implementation of a designated initializer calls on
super an initializer that is not a designated one or any initializer on self.

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

10 years ago[objc] Emit a warning when the implementation of a designated initializer does not...
Argyrios Kyrtzidis [Tue, 3 Dec 2013 21:11:36 +0000 (21:11 +0000)]
[objc] Emit a warning when the implementation of a designated initializer does not chain to
an init method that is a designated initializer for the superclass.

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

10 years ago[objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get the
Argyrios Kyrtzidis [Tue, 3 Dec 2013 21:11:30 +0000 (21:11 +0000)]
[objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get the
designated initializers of an interface.

If the interface declaration does not have methods marked as designated
initializers then the interface inherits the designated initializers of
its super class.

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

10 years ago[objc] Introduce attribute 'objc_designated_initializer'.
Argyrios Kyrtzidis [Tue, 3 Dec 2013 21:11:25 +0000 (21:11 +0000)]
[objc] Introduce attribute 'objc_designated_initializer'.

It only applies to methods of init family in an interface declaration.

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

10 years agoFix corner case in module-based layering warning.
Daniel Jasper [Tue, 3 Dec 2013 20:30:36 +0000 (20:30 +0000)]
Fix corner case in module-based layering warning.

Before, there SourceManager would not return a FileEntry for a
SourceLocation of a macro expansion (if the header name itself is
defined in a macro). We'd then fallback to assume that the module
currently being built is the including module. However, in this case we
are actually interested in the spelling location of the filename loc in
order to derive the including module.

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

10 years agoCMake: enable building the clang-format vs plugin
Hans Wennborg [Tue, 3 Dec 2013 18:02:51 +0000 (18:02 +0000)]
CMake: enable building the clang-format vs plugin

This makes it possible to build the clang-format vs plugin from the cmake build.
It is a hack, as it shells out to "devenv" to actually build it, but it's hidden
away in a corner behind a flag, and it provides a convenient way of building the
plug-in from the command-line together with the rest of clang.

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

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

10 years agoclang-format: Improve clang-format's documentation of ColumnLimit=0.
Daniel Jasper [Tue, 3 Dec 2013 17:21:57 +0000 (17:21 +0000)]
clang-format: Improve clang-format's documentation of ColumnLimit=0.

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

10 years agoIssue diagnostic when constructor or destructor
Fariborz Jahanian [Tue, 3 Dec 2013 17:10:08 +0000 (17:10 +0000)]
Issue diagnostic when constructor or destructor
return void expression. // rdar://15366494
pr17759.

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

10 years agoCheck IR on this test.
Rafael Espindola [Tue, 3 Dec 2013 14:46:31 +0000 (14:46 +0000)]
Check IR on this test.

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

10 years agoCheck IR on this test.
Rafael Espindola [Tue, 3 Dec 2013 14:43:17 +0000 (14:43 +0000)]
Check IR on this test.

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

10 years agoCheck IR on this test.
Rafael Espindola [Tue, 3 Dec 2013 14:37:33 +0000 (14:37 +0000)]
Check IR on this test.

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

10 years agoCheck IR on this test.
Rafael Espindola [Tue, 3 Dec 2013 14:35:42 +0000 (14:35 +0000)]
Check IR on this test.

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

10 years agoCheck IR on this test.
Rafael Espindola [Tue, 3 Dec 2013 14:33:08 +0000 (14:33 +0000)]
Check IR on this test.

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

10 years agocheck IR in this test
Rafael Espindola [Tue, 3 Dec 2013 14:23:52 +0000 (14:23 +0000)]
check IR in this test

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

10 years agocheck IR in this test.
Rafael Espindola [Tue, 3 Dec 2013 14:21:57 +0000 (14:21 +0000)]
check IR in this test.

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

10 years agocheck IR in this test.
Rafael Espindola [Tue, 3 Dec 2013 14:19:02 +0000 (14:19 +0000)]
check IR in this test.

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

10 years agoCheck IR in this test.
Rafael Espindola [Tue, 3 Dec 2013 14:16:22 +0000 (14:16 +0000)]
Check IR in this test.

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

10 years agoCheck IR in this test.
Rafael Espindola [Tue, 3 Dec 2013 14:09:19 +0000 (14:09 +0000)]
Check IR in this test.

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

10 years agoCheck IR in this test.
Rafael Espindola [Tue, 3 Dec 2013 14:06:23 +0000 (14:06 +0000)]
Check IR in this test.

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

10 years agoCheck IR instead of assembly in this test.
Rafael Espindola [Tue, 3 Dec 2013 13:57:25 +0000 (13:57 +0000)]
Check IR instead of assembly in this test.

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

10 years agoTypo caught by Alp Toker: s/appertain/appertains
Aaron Ballman [Tue, 3 Dec 2013 13:45:50 +0000 (13:45 +0000)]
Typo caught by Alp Toker: s/appertain/appertains

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

10 years agoCreate a separate file for JS-specific unit tests.
Alexander Kornienko [Tue, 3 Dec 2013 10:50:16 +0000 (10:50 +0000)]
Create a separate file for JS-specific unit tests.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek
Differential Revision: http://llvm-reviews.chandlerc.com/D2307

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

10 years agoPreserve carriage return when using clang-format's XML interface.
Manuel Klimek [Tue, 3 Dec 2013 09:46:06 +0000 (09:46 +0000)]
Preserve carriage return when using clang-format's XML interface.

Patch by James Park.

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

10 years agoParse: Fix references to 'if' that meant 'for', 'do', and 'while'
Justin Bogner [Tue, 3 Dec 2013 07:36:55 +0000 (07:36 +0000)]
Parse: Fix references to 'if' that meant 'for', 'do', and 'while'

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

10 years agoRemove HandleTagDeclDefinition class declaration
Alp Toker [Tue, 3 Dec 2013 07:27:53 +0000 (07:27 +0000)]
Remove HandleTagDeclDefinition class declaration

HandleTagDeclDefinition is in fact a function.

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

10 years agoDocumentation typo corrections
Alp Toker [Tue, 3 Dec 2013 06:53:39 +0000 (06:53 +0000)]
Documentation typo corrections

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

10 years agoFix method/variable name typos
Alp Toker [Tue, 3 Dec 2013 06:53:35 +0000 (06:53 +0000)]
Fix method/variable name typos

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

10 years agoclang-format: Explicitly set fallback style that is tested.
Daniel Jasper [Tue, 3 Dec 2013 06:48:41 +0000 (06:48 +0000)]
clang-format: Explicitly set fallback style that is tested.

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

10 years agoEmit an extension warning when changing system header tokens
Alp Toker [Tue, 3 Dec 2013 06:13:01 +0000 (06:13 +0000)]
Emit an extension warning when changing system header tokens

clang converts keywords to identifiers for compatibility with various system
headers such as GNU libc.

Implement a -Wkeyword-compat extension warning to diagnose those cases. The
warning is on by default but will generally be ignored in system headers. It
can however be enabled globally to aid standards conformance testing.

This also changes the __uptr keyword avoidance from r195710 to no longer
special-case system headers, bringing it in line with other similar workarounds
in clang.

Implementation returns bool for symmetry with token annotation functions.

Some examples:

warning: keyword '__is_pod' will be treated as an identifier for the remainder of the translation unit [-Wkeyword-compat]
struct __is_pod

warning: keyword '__uptr' will be treated as an identifier here [-Wkeyword-compat]
union w *__uptr;

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

10 years ago[AArch64]Add missing floating point convert, round and misc intrinsics.
Hao Liu [Tue, 3 Dec 2013 06:07:13 +0000 (06:07 +0000)]
[AArch64]Add missing floating point convert, round and misc intrinsics.
E.g. int64x1_t vcvt_s64_f64(float64x1_t a) -> FCVTZS Dd, Dn

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

10 years agoAArch64: add missing ACLE intrinsics mapping to general arithmetic operation from...
Hao Liu [Tue, 3 Dec 2013 05:58:49 +0000 (05:58 +0000)]
AArch64: add missing ACLE intrinsics mapping to general arithmetic operation from VFP instructions.
E.g. float64x1_t vadd_f64(float64x1_t a, float64x1_t b) -> FADD Dd, Dn, Dm.

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

10 years agoPatch by Ana Pazos.
Jiangning Liu [Tue, 3 Dec 2013 05:36:55 +0000 (05:36 +0000)]
Patch by Ana Pazos.

Fixed vcopy_laneq_f64 intrinsic implementation.

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

10 years agorevert r196152.
Hao Liu [Tue, 3 Dec 2013 05:35:17 +0000 (05:35 +0000)]
revert r196152.
This is a duplicate implementation.
E.g. this patch defines:
     float64_t vabd_f64(float64_t a, float64_t b)
But there is already a similar intrinsic "vabdd_f64" with the same types.
Also, this intrinsic will be conflicted to the vector type intrinsic as following(Which is implemented by me and will be committed to trunk):
     float64x1_t vabd_f64(float64x1_t a, float64x1_t b).
Two functions shouldn't have a same name in arm_neon.h.
According to ARM ACLE document, such vabd_f64 with float64_t is not existing.
So I revert this commit.

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

10 years agoTest to ensure no old-style-cast warning is emitted for objc-arc __bridge casts
Alp Toker [Tue, 3 Dec 2013 05:31:51 +0000 (05:31 +0000)]
Test to ensure no old-style-cast warning is emitted for objc-arc __bridge casts

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