summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* Don't allow non-ASM statements in naked functionsHans Wennborg2014-09-041-0/+11
| | | | | | | | | | Naked functions don't have prologues or epilogues, so doing codegen for anything other than inline assembly would be completely hit or miss. Differential Revision: http://reviews.llvm.org/D5183 llvm-svn: 217199
* PR20844: If we fail to list-initialize a reference, map to the referenced typeRichard Smith2014-09-041-0/+13
| | | | | | | | | before retrying the initialization to produce diagnostics. Otherwise, we may fail to produce any diagnostics, and silently produce invalid AST in a -Asserts build. Also add a note to this codepath to make it more clear why we were trying to create a temporary. llvm-svn: 217197
* [modules] Make NamespaceAliasDecl redeclarable, as it should be. This fixesRichard Smith2014-09-031-30/+33
| | | | | | | merging of namespace aliases across modules and improves source fidelity. Incidentally also fixes PR20816. llvm-svn: 217103
* Fix member function call on null pointer in Sema::FindInstantiatedDecl.Alexey Samsonov2014-09-031-11/+11
| | | | | | This bug was reported by UBSan. llvm-svn: 217059
* Split off CUDA-specific Sema parts to a new fileEli Bendersky2014-09-034-57/+77
| | | | | | | | | | | In line with SemaOpenMP.cpp, etc. CUDA-specific semantic analysis code goes into a separate file. This is in anticipation of adding extra functionality here in the near future. No change in functionality. Review: http://reviews.llvm.org/D5160 llvm-svn: 217043
* Fix up formatting.Eli Bendersky2014-09-021-1/+1
| | | | llvm-svn: 216976
* Don't allow lambdas to capture invalid decls during template instantiations.Richard Trieu2014-09-021-1/+1
| | | | | | Fixes PR20731. llvm-svn: 216936
* Fix some cases where StringRef was being passed by const reference. Remove ↵Craig Topper2014-08-302-3/+3
| | | | | | const from some other StringRefs since its implicitly const already. llvm-svn: 216825
* Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor ↵Craig Topper2014-08-304-10/+8
| | | | | | and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. llvm-svn: 216824
* Fix for PR20660, where unexpanded parameter pack in function parameter ↵Larisse Voufo2014-08-291-7/+31
| | | | | | clause causes clang to crash. llvm-svn: 216778
* Objective-C [qoi]. If property is going to be implementedFariborz Jahanian2014-08-291-3/+4
| | | | | | | | in the super class, do not issue the warning about property in current class's protocol will not be auto synthesized. // rdar://18179833 llvm-svn: 216769
* Objective-C. Tweak diagnosing properties that are not auto-synthesized.Fariborz Jahanian2014-08-291-20/+19
| | | | | | | | | | | Do not warn when property declared in class's protocol will be auto-synthesized by its uper class implementation because super class has also declared this property while this class has not. Continue to warn if current class has declared the property also (because this declaration will not result in a 2nd synthesis). rdar://18152478 llvm-svn: 216753
* Use llvm::makeArrayRef instead of explicitly calling ArrayRef constructor ↵Craig Topper2014-08-291-3/+1
| | | | | | and mentioning the type. This works now that we have a conversion from ArrayRef<T*> to ArrayRef<const T*>. llvm-svn: 216710
* Don't load invalid enum value in Sema::LazilyCreateBuiltin.Alexey Samsonov2014-08-281-10/+8
| | | | | | This bug was reported by UBSan. llvm-svn: 216696
* [C++11] Support for capturing of variable length arrays in lambda expression.Alexey Bataev2014-08-285-11/+54
| | | | | | Differential Revision: http://reviews.llvm.org/D4368 llvm-svn: 216649
* During cross field uninitialized checking, when processing an assignment,Richard Trieu2014-08-281-29/+43
| | | | | | | | | | | | | | | | | | | | | | don't mark the field as initialized until the next initializer instead of instantly. Since this checker is AST based, statements are processed in tree order instead of following code flow. This can result in different warnings from just reordering the code. Also changed to use one checker per constructor instead of creating a new checker per field. class T { int x, y; // Already warns T(bool b) : x(!b ? (1 + y) : (y = 5)) {} // New warning added here, previously (1 + y) comes after (y = 5) in the AST // preventing the warning. T(bool b) : x(b ? (y = 5) : (1 + y)) {} }; llvm-svn: 216641
* PR20769: Fix confusion when checking whether a prior default argument was inRichard Smith2014-08-272-6/+13
| | | | | | scope when checking for conflicts. llvm-svn: 216628
* More -Wuninitialized updatesRichard Trieu2014-08-272-8/+25
| | | | | | | | | | | Fix r216438 to catch more complicated self-initialized in std::move. For instance, "Foo f = std::move(cond ? OtherFoo : (UNUSED_VALUE, f));" Make sure that BinaryConditionalOperator, ConditionalOperator, BinaryOperator with comma operator, and OpaqueValueExpr perform the correct usage forwarding across the three uninitialized value checkers. llvm-svn: 216627
* Allow adding dll attributes on certain redecls with a warning if the decl ↵Hans Wennborg2014-08-271-6/+23
| | | | | | | | | | | | hasn't been used yet (PR20746) This shouldn't really be allowed, but it comes up in real code (see PR). As long as the decl hasn't been used there's no technical difficulty in supporting it, so downgrade the error to a warning. Differential Revision: http://reviews.llvm.org/D5087 llvm-svn: 216619
* Call ResolveExceptionSpec for non-OdrUsed functions.Nico Weber2014-08-271-6/+9
| | | | | | | | In C++11, instantiation of exception specs is deferred. The instantiation is done in MarkFunctionReferenced(), which wasn't called for non-OdrUsed functions, which then caused an assert in codegen. Fixes PR19190, see the bug for details. llvm-svn: 216562
* Objective-C. When multiple nullary selectors are found inFariborz Jahanian2014-08-271-1/+11
| | | | | | | | | | global pool in the course of method selection for a messaging expression, select one with the most general return type of 'id'. This is to remove type-mismatch warning (which is useless) as result of random selection of method with more restrictive return type. rdar://18095772 llvm-svn: 216560
* Allow __fp16 as a function arg or return type for AArch64Oliver Stannard2014-08-271-4/+4
| | | | | | | | | | | ACLE 2.0 allows __fp16 to be used as a function argument or return type. This enables this for AArch64. This also fixes an existing bug that causes clang to not allow homogeneous floating-point aggregates with a base type of __fp16. This is valid for AAPCS64, but not for AAPCS-VFP. llvm-svn: 216558
* Simplify creation of a bunch of ArrayRefs by using None, makeArrayRef or ↵Craig Topper2014-08-273-18/+17
| | | | | | just letting them be implicitly created. llvm-svn: 216528
* Fix representation of __attribute__((nonnull)) to support correctly modelingRichard Smith2014-08-272-41/+62
| | | | | | | | | | | | | | | the no-arguments case. Don't expand this to an __attribute__((nonnull(A, B, C))) attribute, since that does the wrong thing for function templates and varargs functions. In passing, fix a grammar error in the diagnostic, a crash if __attribute__((nonnull(N))) is applied to a varargs function, a bug where the same null argument could be diagnosed multiple times if there were multiple nonnull attributes referring to it, and a bug where nonnull attributes would not be accumulated correctly across redeclarations. llvm-svn: 216520
* Clarify comment so this doesn't appear to be a C11-only rule.Richard Smith2014-08-261-0/+3
| | | | llvm-svn: 216490
* revert patch r216469.Fariborz Jahanian2014-08-261-1/+1
| | | | llvm-svn: 216485
* c11- Check for c11 language option as documentation saysFariborz Jahanian2014-08-261-1/+1
| | | | | | | | feature is c11 about nested struct declarations must have struct-declarator-list. Without this change, code which was meant for c99 breaks. rdar://18125536 llvm-svn: 216469
* ARM: Add dbg builtin intrinsicYi Kong2014-08-261-2/+2
| | | | llvm-svn: 216452
* Passing a variable to std::move now counts as a use for -WuninitializedRichard Trieu2014-08-262-0/+30
| | | | llvm-svn: 216438
* [modules] Track the described template in an alias declaration that is theRichard Smith2014-08-262-0/+2
| | | | | | | pattern of an alias template declaration. Use this to merge alias templates properly when they're members of class template specializations. llvm-svn: 216437
* Objective-C. Allow [super initialize] in an +initializeFariborz Jahanian2014-08-251-8/+19
| | | | | | | implementation but not anywhere else. rdar://16628028 llvm-svn: 216408
* PR20716 - Crash when recovering from type in known dependent base.Nikola Smiljanic2014-08-241-1/+4
| | | | llvm-svn: 216352
* Move __vector long deprecation checking into DeclSpec::FinishHal Finkel2014-08-241-6/+3
| | | | | | | | | | | | __vector long is deprecated, but __vector long long is not. As a result, we cannot check for __vector long (to issue the deprecation warning) as we parse the type because we need to know how many 'long's we have first. DeclSpec::Finish seems like a more-appropriate place to perform the check (which places it with several other similar Altivec vector checks). Fixes PR20720. llvm-svn: 216342
* Don't assert on different DLL attributes in template and explicit ↵Hans Wennborg2014-08-242-11/+31
| | | | | | | | | | | | | | | | | | | | instantiation (PR20137) We would previously assert (a decl cannot have two DLL attributes) on this code: template <typename T> struct __declspec(dllimport) S { T f() { return T(); } }; template struct __declspec(dllexport) S<int>; The problem was that when instantiating, we would take the attribute from the template even if the instantiation itself already had an attribute. Also, don't inherit DLL attributes from the template to its members before instantiation, as the attribute may change. I couldn't figure out what MinGW does here, so I'm leaving that open. At least we're not asserting anymore. llvm-svn: 216340
* MS ABI: Inherit DLL attributes to partial class template specializationsHans Wennborg2014-08-231-0/+13
| | | | llvm-svn: 216333
* checkDLLAttribute: remove a redundant dyn_castHans Wennborg2014-08-231-21/+19
| | | | | | The same dyn_cast was done earlier in the function. No functionality change. llvm-svn: 216326
* CodeGen: Skip unnamed bitfields when handling designated initializersDavid Majnemer2014-08-231-1/+9
| | | | | | | We would accidently initialize unnamed bitfields instead of the following field. llvm-svn: 216313
* [modules] Put class template declarations into the scope in which they'reRichard Smith2014-08-231-3/+7
| | | | | | | | | | | declared, rather than putting them into the template parameter scope. We previously had *no record* in the scope for class template declarations, once those declarations completed and their template parameter scopes were popped. This in turn caused us to be unable to merge class template declarations that were declared in the global scope (where we use scope lookup rather than DeclContext lookup for merging), when loading a module. llvm-svn: 216311
* Fix a bad location in -Wparentheses fix-it hintRichard Trieu2014-08-231-1/+1
| | | | | | | The code used getLocStart() instead of getLocEnd(). This works for single token expressions, but breaks if the expression is longer. llvm-svn: 216306
* Objective-C. Warn when @encode'ing provides an incompleteFariborz Jahanian2014-08-221-1/+5
| | | | | | | | type encoding because in certain cases, such as for vector types, because we still haven't designed encoding for them. rdar://9255564 llvm-svn: 216301
* Objective-C. Update my previous patch to not warn ifFariborz Jahanian2014-08-221-2/+3
| | | | | | | +initialize is called on 'super' in its implementation. rdar://16628028 llvm-svn: 216282
* Objective-C. Warn if user has made explicit callFariborz Jahanian2014-08-222-0/+17
| | | | | | | to +initilize as this results in an extra call to this method. rdar://16628028 llvm-svn: 216271
* [AArch64, inline-asm] Improve diagnostic that is printed when the size of aAkira Hatanaka2014-08-221-3/+14
| | | | | | | | | | | | | | | | | variable that has regiser constraint "r" is not 64-bit. General register operands are output using 64-bit "x" register names, regardless of the size of the variable, unless the asm operand is prefixed with the "%w" modifier. This surprises and confuses many users who aren't familiar with aarch64 inline assembly rules. With this commit, a note and fixit hint are printed which tell the users that they need modifier "%w" in order to output a "w" register instead of an "x" register. <rdar://problem/12764785> llvm-svn: 216260
* Fix PR20705, crash on invalid.Richard Trieu2014-08-221-1/+1
| | | | | | dyn_cast -> dyn_cast_or_null to handle a null pointer. llvm-svn: 216254
* Return statements are initialization; don't forget to revert the initializer toRichard Smith2014-08-211-1/+2
| | | | | | its syntactic form before re-analyzing it during template instantiation. llvm-svn: 216224
* Objective-C. Recover from missing interface decl.Fariborz Jahanian2014-08-211-1/+2
| | | | | | | and checking on availability of method declaration instead of crashing. // rdar://18059669 llvm-svn: 216191
* MS ABI: Don't always instantiate all members of dllexported class templates ↵Hans Wennborg2014-08-211-1/+11
| | | | | | | | | | | | | | | | (PR20163) Normally we mark all members of exported classes referenced to get them emitted. However, MSVC doesn't do this for class templates that are implicitly specialized or just have an explicit instantiation declaration. For such specializations, the members are emitted when referenced. The exception is the case when the dllexport attribute is propagated from a base class to a base class template that doesn't have an explicit attribute: in this case all methods of the base class template do get instantiated. llvm-svn: 216145
* Objective-C [qoi]. Provide fix-it hint when sendingFariborz Jahanian2014-08-191-5/+13
| | | | | | class method to an object receiver. rdar://16263395 llvm-svn: 216038
* C++1y is now C++14!Aaron Ballman2014-08-199-38/+38
| | | | | | Changes diagnostic options, language standard options, diagnostic identifiers, diagnostic wording to use c++14 instead of c++1y. It also modifies related test cases to use the updated diagnostic wording. llvm-svn: 215982
* Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid ↵Craig Topper2014-08-174-15/+15
| | | | | | needing to mention the size. llvm-svn: 215869
OpenPOWER on IntegriCloud