summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Add an assert to make it clear we're on the first lineAlp Toker2013-12-051-1/+3
| | | | | | A raw lexer in its initial state is guaranteed to be on line number one. llvm-svn: 196461
* Remove unused variable.Richard Trieu2013-12-051-1/+0
| | | | llvm-svn: 196459
* Fix non-MSVC build error in ASTContext::getAdjustedTypeReid Kleckner2013-12-051-2/+4
| | | | | | | | 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. llvm-svn: 196455
* Fix init-captures for generic lambdas.Faisal Vali2013-12-0512-95/+455
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 196454
* Parse: Recover better from bad definitions with base specifiersDavid Majnemer2013-12-052-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 196453
* Add an AdjustedType sugar node for adjusting calling conventionsReid Kleckner2013-12-0525-80/+239
| | | | | | | | | | | | | | | | 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 llvm-svn: 196451
* Simplify the constructor to CodeGenABITypes.Mark Lacey2013-12-052-8/+12
| | | | | | | | | | | | 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. llvm-svn: 196450
* Reject template-ids containing literal-operator-ids that have a dependentRichard Smith2013-12-056-7/+66
| | | | | | | | | 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. llvm-svn: 196443
* Giving a Subjects list to DllExport, which allows the removal of some custom ↵Aaron Ballman2013-12-042-9/+4
| | | | | | semantic handling. The same cannot be done for DllImport, and so comments were left explaining why. llvm-svn: 196429
* Common functionality is already checked within SemaDeclAttr.cpp and so it ↵Aaron Ballman2013-12-041-65/+4
| | | | | | does not need to be re-checked for each target. llvm-svn: 196428
* Factor duplicated code for TransformTypeInObjectScopeReid Kleckner2013-12-041-49/+22
| | | | | | Fixes the relevant FIXME about copy-pasted code. llvm-svn: 196425
* Fix for PR18052 - Lambdas within NSDMI's and default arguments in Nested ↵Faisal Vali2013-12-042-2/+71
| | | | | | | | | | | | | | | | | | | | | | 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! llvm-svn: 196423
* The MSP430Interrupt attribute does have a sema handler (it's in ↵Aaron Ballman2013-12-042-1/+7
| | | | | | 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. llvm-svn: 196420
* Getting rid of some hard-coded strings. No functional changes intended, ↵Aaron Ballman2013-12-042-9/+9
| | | | | | though some test cases needed to be updated for attribute names becoming quoted. llvm-svn: 196417
* This attribute somehow remained nameless in the attribute tablegen, until now.Aaron Ballman2013-12-042-3/+5
| | | | llvm-svn: 196415
* Remove empty header.Rafael Espindola2013-12-041-0/+0
| | | | llvm-svn: 196410
* ObjectiveC - Introducing objc_bridge_related attribute Fariborz Jahanian2013-12-047-0/+195
| | | | | | | | which specifies couple of (optional) method selectors for bridging a CFobject to or from an ObjectiveC object. This is wip. // rdsr://15499111 llvm-svn: 196408
* Enea Zaffanella's fix for the PPCallbacks Elif callback, with a slight ↵John Thompson2013-12-041-17/+15
| | | | | | re-org, and an update of the new PPCallbacks test (soon to be moved to clang from extra), rather the unittest. llvm-svn: 196407
* Fix indentation.Richard Smith2013-12-041-3/+3
| | | | llvm-svn: 196406
* [ms-cxxabi] Construct and destroy call arguments in the correct orderReid Kleckner2013-12-0410-106/+188
| | | | | | | | | | | | | | | | | | | 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 llvm-svn: 196402
* Fix test case due to r196394 and improve it to not rely on LLVM code ↵David Blaikie2013-12-041-4/+3
| | | | | | generation either. llvm-svn: 196399
* When parsing ignored attribute arguments, presuming the first argument is an ↵Aaron Ballman2013-12-042-1/+17
| | | | | | unresolved identifier the same way that we do for unknown arguments. This resolves PR18075, where we regressed the handling of OpenBSD's bounded attribute. llvm-svn: 196387
* Added a regression test for the change in r196380Alexander Kornienko2013-12-041-0/+8
| | | | llvm-svn: 196384
* Fix the regression caused by r196378Alexander Kornienko2013-12-041-3/+3
| | | | llvm-svn: 196380
* Leave constructor initializer lists on one line in styles with no column limit.Alexander Kornienko2013-12-042-12/+50
| | | | | | | | | | | | | | | | | 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 llvm-svn: 196378
* Revert r196372, "do not warn about unknown pragmas in modes that do not ↵NAKAMURA Takumi2013-12-045-17/+9
| | | | | | | | handle them (pr9537)" It broke clang tests on some hosts with +Asserts. Seems "STDC" clashes. llvm-svn: 196376
* do not warn about unknown pragmas in modes that do not handle them (pr9537)Lubos Lunak2013-12-045-9/+17
| | | | | | | And refactor to have just one place in code that sets up the empty pragma handlers. llvm-svn: 196372
* [SystemZ] Fix handling of pass-by-pointer argumentsRichard Sandiford2013-12-042-4/+4
| | | | | | | | | | | | | | | | 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. llvm-svn: 196370
* Sema: Propagate the mangling number into instantiationsDavid Majnemer2013-12-042-0/+35
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 196368
* [AArch64 NEON] Add ACLE intrinsic vceqz_f64.Kevin Qin2013-12-042-5/+19
| | | | llvm-svn: 196361
* [AArch64 NEON] Add missing compare intrinsics.Kevin Qin2013-12-044-20/+213
| | | | llvm-svn: 196359
* Fix error recovery in return statement.Serge Pavlov2013-12-042-2/+15
| | | | | | This patch fixes PR16989. llvm-svn: 196352
* Fix PR17637: incorrect calculation of template parameter depthFaisal Vali2013-12-044-2/+86
| | | | | | In delayed template parsing mode, adjust the template depth counter for each template parameter list associated with an out of line member template specialization. llvm-svn: 196351
* clang/test: REQUIRES: s/x86-64-registered-target/x86-registered-target/NAKAMURA Takumi2013-12-0423-23/+23
| | | | llvm-svn: 196350
* clang/test: REQUIRES: s/ppc{32|64}-registered-target/powerpc-registered-target/NAKAMURA Takumi2013-12-0417-17/+17
| | | | llvm-svn: 196349
* clang/test/CodeGen/builtins-nvptx.c: Prune "REQUIRES: ↵NAKAMURA Takumi2013-12-041-1/+0
| | | | | | nvptx64-registered-target". "nvptx" should imply it. llvm-svn: 196348
* check-clang: Introduce get_llvm_config_props in clang/test/lit.cfg.NAKAMURA Takumi2013-12-042-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 196347
* Add newline at eof.NAKAMURA Takumi2013-12-041-1/+1
| | | | llvm-svn: 196346
* Remove redundant check.Richard Smith2013-12-041-4/+1
| | | | llvm-svn: 196338
* Fix crash if a dependent template-id was assumed to be a type but instantiatesRichard Smith2013-12-042-1/+26
| | | | | | to a variable template specialization. llvm-svn: 196337
* clang-format-diff.py: Fix 'beintroduced' in help outputAlp Toker2013-12-042-5/+7
| | | | | | Also update docs to reflect recently changed -i inplace edit behaviour. llvm-svn: 196336
* Fix crash if a variable template specialization is used in a ↵Richard Smith2013-12-043-7/+7
| | | | | | nested-name-specifier. llvm-svn: 196335
* Fix several crash-on-invalids when using template-ids that aren'tRichard Smith2013-12-049-15/+55
| | | | | | simple-template-ids (eg, 'operator+<int>') in weird places. llvm-svn: 196333
* [objc] Add a warning when a class that provides a designated initializer, ↵Argyrios Kyrtzidis2013-12-035-7/+46
| | | | | | | | does not override all of the designated initializers of its superclass. llvm-svn: 196319
* [objc] Emit warning when the implementation of a secondary initializer calls onArgyrios Kyrtzidis2013-12-039-8/+97
| | | | | | | | | | | 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. llvm-svn: 196318
* [objc] Emit warnings when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-036-19/+61
| | | | | | | | calls on super an initializer that is not a designated one or any initializer on self. llvm-svn: 196317
* [objc] Emit a warning when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-0310-2/+207
| | | | | | | | does not chain to an init method that is a designated initializer for the superclass. llvm-svn: 196316
* [objc] Introduce ObjCInterfaceDecl::getDesignatedInitializers() to get theArgyrios Kyrtzidis2013-12-035-3/+53
| | | | | | | | | | 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. llvm-svn: 196315
* [objc] Introduce attribute 'objc_designated_initializer'.Argyrios Kyrtzidis2013-12-034-0/+68
| | | | | | It only applies to methods of init family in an interface declaration. llvm-svn: 196314
* Fix corner case in module-based layering warning.Daniel Jasper2013-12-032-2/+4
| | | | | | | | | | | 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. llvm-svn: 196311
OpenPOWER on IntegriCloud