summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
* SemaTemplateInstantiateDecl.cpp: Suppress a warning. [-Wunused-variable]NAKAMURA Takumi2013-08-061-0/+1
| | | | llvm-svn: 187765
* Started implementing variable templates. Top level declarations should be ↵Larisse Voufo2013-08-067-279/+1774
| | | | | | fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention... llvm-svn: 187762
* Add option to disable module loading.Daniel Jasper2013-08-051-1/+1
| | | | | | | This patch was created by Lawrence Crowl and reviewed in: http://llvm-reviews.chandlerc.com/D963 llvm-svn: 187738
* Implement C++'s restrictions on the type of an expression passed to a varargRichard Smith2013-08-052-91/+168
| | | | | | | | | | | | | function: it can't be 'void' and it can't be an initializer list. We give a hard error for these rather than treating them as undefined behavior (we can and probably should do the same for non-POD types in C++11, but as of this change we don't). Slightly rework the checking of variadic arguments in a function with a format attribute to ensure that certain kinds of format string problem (non-literal string, too many/too few arguments, ...) don't suppress this error. llvm-svn: 187735
* Sema: Don't assume a nested name specifier holds a typeDavid Majnemer2013-08-051-2/+1
| | | | | | | | | Sema::PerformObjectMemberConversion assumed that the Qualifier it was given holds a type. However, the specifier could hold just a namespace. In this case, we should ignore the qualifier and not attempt to cast to it. llvm-svn: 187715
* Add support for passing -1 to __builtin_shufflevector to signify an ↵Craig Topper2013-08-031-0/+4
| | | | | | undefined element value to match IR capabilities. llvm-svn: 187694
* Remove rather oddly merged logic from AArch64 commit.Tim Northover2013-08-021-21/+7
| | | | | | | | | | We seem to have ended up with both an inlined check of permitted NEON base types and a call to a function. Since the outer if was (I believe) strictly weaker than the one in the function, there's no actual user-visible behaviour change, so no tests. llvm-svn: 187652
* Fix indentation. No functional change.Craig Topper2013-08-021-1/+1
| | | | llvm-svn: 187644
* AArch64: initial NEON supportTim Northover2013-08-012-3/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch by Ana Pazos - Completed implementation of instruction formats: AdvSIMD three same AdvSIMD modified immediate AdvSIMD scalar pairwise - Completed implementation of instruction classes (some of the instructions in these classes belong to yet unfinished instruction formats): Vector Arithmetic Vector Immediate Vector Pairwise Arithmetic - Initial implementation of instruction formats: AdvSIMD scalar two-reg misc AdvSIMD scalar three same - Intial implementation of instruction class: Scalar Arithmetic - Initial clang changes to support arm v8 intrinsics. Note: no clang changes for scalar intrinsics function name mangling yet. - Comprehensive test cases for added instructions To verify auto codegen, encoding, decoding, diagnosis, intrinsics. llvm-svn: 187568
* Check dynamic_cast is not used with -fno-rtti, unless it is a noop or can be ↵Arnaud A. de Grandmaison2013-08-011-0/+7
| | | | | | resolved statically. llvm-svn: 187564
* Sema: Diagnose explicitly bound unresolved member expressions decaying into ↵David Majnemer2013-08-011-25/+42
| | | | | | | | | | | | | pointers to function type We would disallow the case where the overloaded member expression is coming from an address-of operator but we wouldn't issue any diagnostics when the overloaded member expression comes by way of a function to pointer decay cast. Clang's implementation of DR61 is now seemingly complete. llvm-svn: 187559
* ObjectiveC ARC: finishing off issuing error whenFariborz Jahanian2013-07-312-6/+20
| | | | | | | retainable pointer is passed to an audited CF function expecting CF type. // rdar://14569171 llvm-svn: 187543
* ObjectiveC ARC: Do not issue bridge cast diagnostic whenFariborz Jahanian2013-07-313-6/+16
| | | | | | | | passing a retainable object arg to a CF audited function expecting a CF object type. Issue a normal type mismatch diagnostic. This is wip // rdar://14569171 llvm-svn: 187532
* Fix declaring class template methods with an attributed typedefReid Kleckner2013-07-312-52/+41
| | | | | | | | | | | | | | This change unifies the logic for template instantiation of methods and functions declared with typedefs. It ensures that SubstFunctionType() always fills the Params out param with non-null ParmVarDecls or returns null. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1135 llvm-svn: 187528
* A few small cleanups to r187504. Thanks to dblaikie for the assist.Kaelyn Uhrain2013-07-311-8/+7
| | | | llvm-svn: 187521
* ObjectiveC arc: minor refactoring in my last patchFariborz Jahanian2013-07-311-2/+5
| | | | | | to avoid future false positives. // rdar://14569171 llvm-svn: 187509
* ObjectiveC arc: Introduce a new initialization kindFariborz Jahanian2013-07-312-9/+25
| | | | | | | | for parameters passed to CF audited functions to be used for better diagnostics. Current set but unused. // rdar://14569171 llvm-svn: 187508
* Improve the diagnostic experience, including adding recovery, forKaelyn Uhrain2013-07-313-8/+44
| | | | | | changing '->' to '.' when there is no operator-> defined for a class. llvm-svn: 187504
* ObjectiveC arc: Move check for type conversions in arcFariborz Jahanian2013-07-313-11/+21
| | | | | | | | out of ImpCastExprToType and to the caller site as appropriate. This is in prep. to do more work for // rdar://14569171 llvm-svn: 187503
* Fix a crasher than manifests when typo correction suggests a function template.Richard Trieu2013-07-311-2/+2
| | | | llvm-svn: 187467
* err_attribute_missing_parameter_name has been replaced by ↵Aaron Ballman2013-07-301-1/+2
| | | | | | err_attribute_argument_type. llvm-svn: 187420
* Replacing err_attribute_argument_not_int with err_attribute_not_type_attrAaron Ballman2013-07-303-27/+36
| | | | llvm-svn: 187419
* err_attribute_not_string has been subsumed by err_attribute_argument_type.Aaron Ballman2013-07-302-43/+37
| | | | llvm-svn: 187400
* Refactor some attributes to use checkFunctionOrMethodArgumentIndex instead ↵Aaron Ballman2013-07-301-159/+46
| | | | | | of using custom logic. No functional changes intended. llvm-svn: 187398
* Support for Thread Safety Analysis in CDavid Blaikie2013-07-291-1/+1
| | | | | | Patch by Ethan Jackson. llvm-svn: 187365
* Return ExprError if both arguments to the mask form of ↵Craig Topper2013-07-291-13/+13
| | | | | | | | __builtin_shufflvector don't have the same number of elements or the mask isn't an integer vector. Previously a diagnostic was issued, but the code went ahead and built the ShuffleVectorExpr. While I'm here also simplify a couple lines by wrapping the return ExprError around the Diag calls. llvm-svn: 187344
* Fix up formatting. No functional change.Craig Topper2013-07-281-6/+6
| | | | llvm-svn: 187334
* Don't build expressions for invalid casts.Eli Friedman2013-07-261-8/+21
| | | | | | | | | | This matches how we normally perform semantic analysis for other sorts of invalid expressions: it means we don't have to reason about invalid sub-expressions. Fixes PR16680. llvm-svn: 187276
* Handle a difference in lambda return type deduction between C++11 and C++1y: ifRichard Smith2013-07-261-2/+8
| | | | | | | no return type is specified, C++11 will deduce a cv-qualified return type in some cases, but C++1y never will. llvm-svn: 187275
* PR16708: If a lambda has an implicit return type, don't get confused if its ↵Richard Smith2013-07-261-17/+17
| | | | | | return type has already been determined to be a type containing an 'auto'. llvm-svn: 187266
* Tighten type-checking for vector attributes.Eli Friedman2013-07-261-1/+14
| | | | | | Based on patch by Yunzhong Gao. llvm-svn: 187176
* Partially revert r186903.Eli Friedman2013-07-261-1/+1
| | | | | | | | It turns out that Plum Hall depends on us not emitting an error on integer literals which fit into long long, but fit into unsigned long long. So C99 conformance requires not conforming to C99. :) llvm-svn: 187172
* When we perform dependent name lookup during template instantiation, it's notRichard Smith2013-07-254-39/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sufficient to only consider names visible at the point of instantiation, because that may not include names that were visible when the template was defined. More generally, if the instantiation backtrace goes through a module M, then every declaration visible within M should be available to the instantiation. Any of those declarations might be part of the interface that M intended to export to a template that it instantiates. The fix here has two parts: 1) If we find a non-visible declaration during name lookup during template instantiation, check whether the declaration was visible from the defining module of all entities on the active template instantiation stack. The defining module is not the owning module in all cases: we look at the module in which a template was defined, not the module in which it was first instantiated. 2) Perform pending instantiations at the end of a module, not at the end of the translation unit. This is general goodness, since it significantly cuts down the amount of redundant work that is performed in every TU importing a module, and also implicitly adds the module containing the point of instantiation to the set of modules checked for declarations in a lookup within a template instantiation. There's a known issue here with template instantiations performed while building a module, if additional imports are added later on. I'll fix that in a subsequent commit. llvm-svn: 187167
* Remove the mblaze backend from clang.Rafael Espindola2013-07-251-53/+0
| | | | | | Approval in here http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/064169.html llvm-svn: 187143
* Sema: Minor const fixups and control flow tidying.Benjamin Kramer2013-07-242-97/+71
| | | | | | No functionality change. llvm-svn: 187047
* Added the attribute name to the err_attribute_wrong_number_arguments ↵Aaron Ballman2013-07-233-40/+78
| | | | | | | | diagnostic for clarity; updated almost all of the affected test cases. Thanks to Fariborz Jahanian for the suggestion! llvm-svn: 186980
* Going back to using getName for consistency.Aaron Ballman2013-07-231-7/+2
| | | | llvm-svn: 186966
* Replacing some manual diagnostic checks with an existing helper method. ↵Aaron Ballman2013-07-231-12/+3
| | | | | | Adding missing test cases for the diagnostics. llvm-svn: 186944
* Removed a redundant diagnostic and replaced it with a more standard one. ↵Aaron Ballman2013-07-231-2/+2
| | | | | | Added a test case for the diagnostic. llvm-svn: 186942
* Consolidate several attribute argument diagnostics into a single, selectable ↵Aaron Ballman2013-07-232-48/+72
| | | | | | diagnostic. This makes the diagnostic more consistent. llvm-svn: 186940
* Correcting the NSObject and Overloadable attribute diagnostics so that the ↵Aaron Ballman2013-07-231-6/+2
| | | | | | count reported matches reality. llvm-svn: 186936
* C++1y literal suffix support:Richard Smith2013-07-231-1/+3
| | | | | | | * Allow ns, us, ms, s, min, h as numeric ud-suffixes * Allow s as string ud-suffix llvm-svn: 186933
* Error on more illegal kernel argument types for OpenCLMatt Arsenault2013-07-231-18/+170
| | | | | | | | bool, half, pointers and structs / unions containing any of these are not allowed. Does not yet reject size_t and related integer types that are also disallowed. llvm-svn: 186908
* Integers which are too large should be an error.Eli Friedman2013-07-231-4/+4
| | | | | | | | Switch some warnings over to errors which should never have been warnings in the first place. (Also, a minor fix to the preprocessor rules for integer literals while I'm here.) llvm-svn: 186903
* Don't emit open-paren fixit without close-paren.Eli Friedman2013-07-221-0/+4
| | | | | | | | | | getLocForEndOfToken() isn't guaranteed to succeed; if it doesn't, make sure we do something sane. Fixes PR16673. I'm not sure how to write a testcase for this short of grepping through the diagnostic output. llvm-svn: 186889
* Fixed implementation of C89 6.5.7 p3.Enea Zaffanella2013-07-221-0/+1
| | | | | | Warning should be emitted only for InitListExpr nodes. llvm-svn: 186859
* Update comment to refer to core issue number.Richard Smith2013-07-221-4/+2
| | | | llvm-svn: 186848
* Implement the part of C89 6.5.7 p3 requiring a constant initializer listEnea Zaffanella2013-07-221-3/+13
| | | | | | when initializing aggregate/union types, no matter if static or not. llvm-svn: 186817
* Improve clarity/consistency of a few UsingDecl methods and related helpers.Enea Zaffanella2013-07-223-25/+27
| | | | | | | | | | | | No functionality change. In Sema helper functions: * renamed isTypeName as HasTypenameKeyword In UsingDecl: * renamed get/setUsingLocation to get/setUsingLoc * renamed is/setTypeName as has/setTypename llvm-svn: 186816
* Remove superfluous cast.Robert Wilhelm2013-07-221-2/+1
| | | | llvm-svn: 186807
OpenPOWER on IntegriCloud