summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* XFAIL vtable-debug-info.cpp on WIN32 and fix curly brace.Francois Pichet2010-12-201-2/+1
| | | | llvm-svn: 122230
* Emit an error if operator __uuidof() is called on a type with no associated ↵Francois Pichet2010-12-201-0/+25
| | | | | | GUID. llvm-svn: 122226
* Introduce a new type, PackExpansionType, to capture types that areDouglas Gregor2010-12-204-0/+81
| | | | | | | | | | | | | | | | | | | | pack expansions, e.g. given template<typename... Types> struct tuple; template<typename... Types> struct tuple_of_refs { typedef tuple<Types&...> types; }; the type of the "types" typedef is a PackExpansionType whose pattern is Types&. This commit introduces support for creating pack expansions for template type arguments, as above, but not for any other kind of pack expansion, nor for any form of instantiation. llvm-svn: 122223
* Validate Microsoft's uuid attribute string.Francois Pichet2010-12-201-2/+40
| | | | llvm-svn: 122220
* 1. Add some ABI information for the Microblaze.Wesley Peck2010-12-191-0/+51
| | | | | | 2. Add attibutes "interrupt_handler" and "save_volatiles" for the Microblaze target. llvm-svn: 122184
* Add support for the Microsoft uuid attribute:Francois Pichet2010-12-192-1/+27
| | | | | | | | example: struct __declspec(uuid("6d5140c1-7436-11ce-8034-00aa006009fa")) test { }; llvm-svn: 122173
* Motions towards simplifying how we deal with attribute-qualified function types.John McCall2010-12-193-52/+184
| | | | llvm-svn: 122162
* Apply attributes to explicit specializations. Specializations whichJohn McCall2010-12-181-0/+3
| | | | | | | don't provide their own explicit visibility attributes should get them from the template. Fixes rdar://problem/8778497. llvm-svn: 122136
* Warn when synthesizing a property which isFariborz Jahanian2010-12-171-0/+12
| | | | | | | implicitly atomic under -Wimplicit-atomic-properties flag. // rdar://8774580 llvm-svn: 122095
* Use hasSameType to compare types for equality.Abramo Bagnara2010-12-171-1/+2
| | | | llvm-svn: 122058
* Avoid to emit redundant implicit cast for enum constants init expressions.Abramo Bagnara2010-12-171-1/+1
| | | | llvm-svn: 122056
* Do lvalue-to-rvalue conversions on the LHS of a shift operator.John McCall2010-12-161-8/+8
| | | | | | Fixes rdar://problem/8776586. llvm-svn: 121992
* Add tests checking for unexpanded parameter packs in declarations thatDouglas Gregor2010-12-161-1/+10
| | | | | | | occur within statements. Teach Sema::ActOnExceptionDeclarator() to check for unexpanded parameter packs in the exception type. llvm-svn: 121984
* Tweak a commentDouglas Gregor2010-12-161-1/+1
| | | | llvm-svn: 121979
* Delay the check for unexpanded parameter packs in the types ofDouglas Gregor2010-12-161-8/+41
| | | | | | | | non-type template parameters until we know that we have an actual template declaration of some sort. This cannot be tested yet, but will become important when we have template template parameter packs. llvm-svn: 121967
* Check for unexpanded parameter packs in non-type template parameter types.Douglas Gregor2010-12-161-3/+9
| | | | llvm-svn: 121964
* Check for unexpanded parameter packs in default arguments.Douglas Gregor2010-12-163-5/+43
| | | | llvm-svn: 121962
* Fix a regression I caused in r121930. It turns out thatDouglas Gregor2010-12-161-3/+7
| | | | | | | DeclarationNameInfo instances don't always have a non-NULL TypeSourceInfo? llvm-svn: 121940
* Check for unexpanded parameter packs within variable initializers.Douglas Gregor2010-12-162-21/+38
| | | | llvm-svn: 121938
* Check for unexpanded parameter packs in friend declarations.Douglas Gregor2010-12-162-0/+13
| | | | llvm-svn: 121934
* Improve diagnostics when property being looked upFariborz Jahanian2010-12-161-0/+6
| | | | | | in a forward @class object. // rdar://8774513 llvm-svn: 121933
* Check for unexpanded parameter packs in using declarations. As aDouglas Gregor2010-12-163-2/+58
| | | | | | | drive-by, make sure to check for unexpanded parameter packs within the name of a declaration. llvm-svn: 121930
* Check for unexpanded parameter packs in enumeration types and enumerators.Douglas Gregor2010-12-161-0/+9
| | | | llvm-svn: 121928
* Check for unexpanded parameter packs in static assertion expressions.Douglas Gregor2010-12-151-0/+3
| | | | llvm-svn: 121922
* ivars craeted for explicit @synthesize and thoseFariborz Jahanian2010-12-152-2/+2
| | | | | | | created for auto-synthesis are @private. Fixes: // rdar://8769582 llvm-svn: 121913
* Check for unexpanded parameter packs in various kinds ofDouglas Gregor2010-12-151-2/+12
| | | | | | | | declarations. This is a work in progress, as I go through the C++ declaration grammar to identify where unexpanded parameter packs can occur. llvm-svn: 121912
* Test that all of the relevant types properly compute the "containsDouglas Gregor2010-12-151-3/+8
| | | | | | | unexpanded parameter pack" bit and that the recursive AST visitor can then find those unexpanded parameter packs. llvm-svn: 121899
* Introduce a RecursiveASTVisitor subclass that finds all unexpandedDouglas Gregor2010-12-151-6/+141
| | | | | | | | | | | | | | | | parameter packs within a statement, type, etc. Use this visitor to provide improved diagnostics for the presence of unexpanded parameter packs in a full expression, base type, declaration type, etc., by highlighting the unexpanded parameter packs and providing their names, e.g., test/CXX/temp/temp.decls/temp.variadic/p5.cpp:28:85: error: declaration type contains unexpanded parameter packs 'VeryInnerTypes', 'OuterTypes', ... ...VeryInnerTypes, OuterTypes>, pair<InnerTypes, OuterTypes> > types; ~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ^ llvm-svn: 121883
* Fix diagnostic pragmas.Argyrios Kyrtzidis2010-12-156-37/+50
| | | | | | | | | | | | Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state. Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect a lot of places, like C++ inline methods, template instantiations, the lexer, etc. Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location. Fixes rdar://8365684. llvm-svn: 121873
* Move the work-in-progress implementation of variadic templates to its own ↵Douglas Gregor2010-12-153-29/+47
| | | | | | file in Sema. No functionality change. llvm-svn: 121869
* Reorganize LookupMemberExpr for clarity and to make the obvious fast pathsJohn McCall2010-12-151-267/+321
| | | | | | come first. llvm-svn: 121866
* __attribute__((nonnull)) can apply to reference-to-pointerDouglas Gregor2010-12-151-2/+2
| | | | | | parameters. Fixes <rdar://problem/8769025>. llvm-svn: 121864
* Sema: have BuildExpressionFromIntegralTemplateArgument produce well-formed ↵Peter Collingbourne2010-12-151-1/+10
| | | | | | | | | | | | | IntegerLiterals BuildExpressionFromIntegralTemplateArgument can produce malformed IntegerLiterals with an EnumType if the template parameter type is an EnumType. This breaks the AST printer which expects all IntegerLiterals to have a plain integer type. Instead, give the IntegerLiteral the enum's promotion type and wrap in an implicit cast to the EnumType. llvm-svn: 121862
* Sundry missing lvalue-to-rvalue conversions. Also leave a TODO for the vitalJohn McCall2010-12-153-7/+19
| | | | | | | future task of performing contextual conversion to size_t in a VLA size expression. :) llvm-svn: 121836
* Set the "implicitly inline" bit on a method as soon as we see a definitionJohn McCall2010-12-151-0/+6
| | | | | | | | within the class. Teach IR gen to look for function definitions in record lexical contexts when deciding whether to emit a function whose address was taken. Fixes PR8789. llvm-svn: 121833
* Variadic templates: extend the Expr class with a bit that specifiesDouglas Gregor2010-12-155-21/+12
| | | | | | | | | | | | | | | | | | whether the expression contains an unexpanded parameter pack, in the same vein as the changes to the Type hierarchy. Compute this bit within all of the Expr subclasses. This change required a bunch of reshuffling of dependency calculations, mainly to consolidate them inside the constructors and to fuse multiple loops that iterate over arguments to determine type dependence, value dependence, and (now) containment of unexpanded parameter packs. Again, testing is painfully sparse, because all of the diagnostics will change and it is more important to test the to-be-written visitor that collects unexpanded parameter packs. llvm-svn: 121831
* Added missing IgnoreParens().Abramo Bagnara2010-12-147-17/+13
| | | | llvm-svn: 121795
* Rewrite ComplexExprEvaluator::VisitCastExpr to use cast kinds, and fixJohn McCall2010-12-141-4/+18
| | | | | | | the basic casting logic to insert intermediate casts and preserve the exact complex-cast design. Fixes a crash in the test suite. llvm-svn: 121776
* Improve some comments, shrink FunctionType::ExtInfo, and fix a bug foundJohn McCall2010-12-141-1/+1
| | | | | | | by valgrind where we were doing the wrong thing in the presence of invalid exception specs. llvm-svn: 121770
* Restore r121752 without modification.John McCall2010-12-148-133/+135
| | | | llvm-svn: 121763
* Pull out r121752 in case it's causing the selfhost breakage.John McCall2010-12-148-135/+133
| | | | llvm-svn: 121759
* Factor out most of the extra state in a FunctionProtoType into a separateJohn McCall2010-12-148-133/+135
| | | | | | | class to be passed around. The line between argument and return types and everything else is kindof vague, but I think it's justifiable. llvm-svn: 121752
* Variadic templates: extend Type, NestedNameSpecifier, TemplateName,Douglas Gregor2010-12-134-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | and TemplateArgument with an operation that determines whether there are any unexpanded parameter packs within that construct. Use this information to diagnose the appearance of the names of parameter packs that have not been expanded (C++ [temp.variadic]p5). Since this property is checked often (every declaration, ever expression statement, etc.), we extend Type and Expr with a bit storing the result of this computation, rather than walking the AST each time to determine whether any unexpanded parameter packs occur. This commit is deficient in several ways, which will be remedied with future commits: - Expr has a bit to store the presence of an unexpanded parameter pack, but it is never set. - The error messages don't point out where the unexpanded parameter packs were named in the type/expression, but they should. - We don't check for unexpanded parameter packs in all of the places where we should. - Testing is sparse, pending the resolution of the above three issues. llvm-svn: 121724
* Skip ParenType on function instantiations.Abramo Bagnara2010-12-131-3/+3
| | | | llvm-svn: 121720
* Reduce the number of builtin operator overload candidates added in certainChandler Carruth2010-12-131-27/+89
| | | | | | | | | | | | cases. First, omit all builtin overloads when no non-record type is in the set of candidate types. Second, avoid arithmetic type overloads for non-arithmetic or enumeral types (counting vector types as arithmetic due to Clang extensions). When heavily using constructs such as STL's '<<' based stream logging, this can have a significant impact. One logging-heavy test case's compile time dropped by 10% with this. Self-host shows 1-2% improvement in compile time, but that's likely in the noise. llvm-svn: 121665
* Basic, Sema: add support for CUDA launch_bounds attributePeter Collingbourne2010-12-122-0/+49
| | | | llvm-svn: 121654
* Sema: diagnose kernel functions with non-void return typePeter Collingbourne2010-12-121-0/+15
| | | | llvm-svn: 121653
* Move the functionality to mark all vtables of key functions as used withinChandler Carruth2010-12-122-13/+13
| | | | | | | | | | | | | | a translation unit to the ActOnEndOfTranslationUnit function instead of doing it at the start of DefineUsedVTables. The latter is now called *recursively* during template instantiation, which causes an absolutely insane number of walks of every record decl in the translation unit. After this patch, an extremely template instantiation heavy test case's compile time drops by 10x, and we see between 15% and 20% improvement in average compile times across a project. This is just recovering a regression, it doesn't make anything faster than it was several weeks ago. llvm-svn: 121644
* Finish cleaning up the static utility code for adding builtin operator overloadChandler Carruth2010-12-121-62/+65
| | | | | | | candidates. They're now wrapped in nice APIs which hide the tables, etc. Also removes some repetitive code from clients. llvm-svn: 121634
* Clean up the helpers used to compute the usual arithmetic conversions' resultChandler Carruth2010-12-121-67/+56
| | | | | | | | | | | | type. Localize all of the logic within a single function rather than spreading it throughout the class. Also fixes a buglet where we failed to check for a RHS arithmetic type wider than the LHS and return its canonical type. I've yet to produce a test case that breaks because of this, but it was spotted by inspection by folks on the IRC channel and is obviously correct now. llvm-svn: 121633
OpenPOWER on IntegriCloud