summaryrefslogtreecommitdiffstats
path: root/clang/Sema
Commit message (Collapse)AuthorAgeFilesLines
...
* AST for @synchronized.Fariborz Jahanian2008-01-292-0/+10
| | | | llvm-svn: 46524
* Tighten up ASTContext::typesAreCompatible()...it needs to make sure the ↵Steve Naroff2008-01-291-12/+17
| | | | | | | | qualifiers match. The comment and C99 citation for this routine were correct...the code needed to conform to the comment/spec. This fixes the test added below. Tightening up this routine forced tweaks to Sema::CheckSubtractionOperands() and Sema::CheckCompareOperands(). For example, they both need to operate on the unqualified pointee... llvm-svn: 46522
* Use the canonical type when comparing array types so the comparison Eli Friedman2008-01-291-2/+2
| | | | | | doesn't get confused by typedefs. llvm-svn: 46502
* Tweak Sema::DefaultArgumentPromotion() to call UsualUnaryConversions(). This ↵Steve Naroff2008-01-291-4/+4
| | | | | | | | makes sure function calls that don't have a prototype get the default function/array conversion. Patch by Eli Friedman! llvm-svn: 46489
* Implement "private extern" on function decls!Steve Naroff2008-01-281-0/+1
| | | | llvm-svn: 46464
* Fix a bug with struct initializers (in Sema::CheckInitializerListTypes()). Steve Naroff2008-01-281-2/+3
| | | | | | | Test case included from bz1948 (thanks Neil!). Also fixed an 80 column violation... llvm-svn: 46430
* Add more support for Apple's "private extern" extension...Steve Naroff2008-01-251-5/+6
| | | | llvm-svn: 46371
* Diagnose bad receiver type.Fariborz Jahanian2008-01-251-2/+4
| | | | llvm-svn: 46358
* Replace Sema::CheckVariableInitList, CheckConstantInitList, and ↵Steve Naroff2008-01-252-198/+196
| | | | | | | | | | CheckForCharArrayInitializer with CheckInitializerListTypes. The new routine now supports struct/union initializers. This is a modified version of a patch by Eli Friedman. This version passes all of the clang tests and supports vectors:-) Note that Eli and I are still unsatisfied the implementation of CheckInitializerListTypes(). We'd like to find a more elegant implementation. Nevertheless, this is a complex part of the standard (and may be hard to simplify). Since the complexity is localized to this routine, we can iterate without too much disruption:-) llvm-svn: 46339
* Fix a bug recovering from broken code with a goto that Eli reported.Chris Lattner2008-01-251-2/+7
| | | | llvm-svn: 46336
* Exclude vectors from Type::isScalar() predicate.Steve Naroff2008-01-241-2/+3
| | | | llvm-svn: 46328
* - Add Sema::CheckStringLiteralInit, Sema::IsStringLiteralInit.Steve Naroff2008-01-222-28/+39
| | | | | | - Use previous hooks to simplify Sema::CheckInitializerTypes()... llvm-svn: 46235
* Sema::CheckInitializerTypes(). Start simpliying and cleaning up...Steve Naroff2008-01-211-4/+8
| | | | llvm-svn: 46234
* Elimate bogus warning when va_start is correctly used inFariborz Jahanian2008-01-211-1/+1
| | | | | | a method. llvm-svn: 46232
* Sema::FinalizeDeclaratorGroup(): Tighten up the tentative definition rule ↵Steve Naroff2008-01-181-4/+9
| | | | | | | | when dealing with arrays. Bug submitted by Eli. llvm-svn: 46179
* Sema::FinalizeDeclaratorGroup()...make sure we emit an diagnostic for ↵Steve Naroff2008-01-181-1/+2
| | | | | | tentative definitions with incomplete types. Touch up all test cases that are effected. llvm-svn: 46152
* Don't ICE on missing interface declaration when declaring one of its protocols.Fariborz Jahanian2008-01-171-14/+15
| | | | llvm-svn: 46141
* Fixed typo introduced by r46133 that caused -Wfloat-equal to break.Ted Kremenek2008-01-171-1/+1
| | | | llvm-svn: 46134
* Implement basic overload support via a new builtin, __builtin_overload.Nate Begeman2008-01-172-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | __builtin_overload takes 2 or more arguments: 0) a non-zero constant-expr for the number of arguments the overloaded functions will take 1) the arguments to pass to the matching overloaded function 2) a list of functions to match. The return type of __builtin_overload is inferred from the function whose args match the types of the arguments passed to the builtin. For example: float a; float sinf(float); int sini(int); float b = __builtin_overload(1, a, sini, sinf); Says that we are overloading functions that take one argument, and trying to pass an argument of the same type as 'a'. sini() does not match since it takes and argument of type int. sinf does match, so at codegen time this will turn into float b = sinf(a); llvm-svn: 46132
* Renamed getSynthesizedSelectorSize to getSynthesizedMethodSize. Compute ↵Fariborz Jahanian2008-01-171-1/+1
| | | | | | | | method name size in accordance with how rewriter synthesizes method name. llvm-svn: 46131
* Added method Expr::IgnoreParens(), which returns the first non-ParenExpr Expr*.Ted Kremenek2008-01-173-13/+4
| | | | | | | Refactored the use of this method into both the Sema module and Analysis module, which were using their own static functions that did the same thing. llvm-svn: 46129
* Computed length of a __func__ identifier used in an objective-c method ↵Fariborz Jahanian2008-01-171-1/+1
| | | | | | | | correctly, when creating its type. llvm-svn: 46109
* Move promoteExprToType from being a static method in SemaExpr.cpp to beingChris Lattner2008-01-164-47/+68
| | | | | | | | | | a method named ImpCastExprToType in Sema. Use this method to insert implicit casts for case statements from their operand type to the condition type of the switch. This fixes a crash on test/CodeGen/statements.c, reported by Eli Friedman. llvm-svn: 46083
* Sema::MergeFunctionDecl()...make sure diagnostic is accurate (wrt function ↵Steve Naroff2008-01-161-2/+7
| | | | | | declarations/definitions). Patch by Carl Lewis! llvm-svn: 46070
* Finish up handling all permutations of "complex int" (in ↵Steve Naroff2008-01-151-5/+9
| | | | | | | | | | Sema::UsualArithmeticConversions()). A FIXME remains to verify the conversion rules are consistent with GCC. Thanks to Eli for the new/improved test case... llvm-svn: 46022
* - Change Type::isComplexType() to exlude GCC's complex integer extension. In ↵Steve Naroff2008-01-151-17/+28
| | | | | | | | | | general, we will keep the lowest level Type predicates "pure" (i.e. true to the C99 spec). - Modify Sema::UsualArithmeticConversions() to work with the new definition of Type::isComplexType(). This is a nice cleanup and also fixes a bug submitted by Eli (which I've added to the test suite). llvm-svn: 46005
* Rework commit r45976, which was incorrect.Steve Naroff2008-01-151-4/+17
| | | | | | | | - Add Type::isComplexIntegerType(), Type::getAsComplexIntegerType(). - Don't inlude complex types with Type::isIntegerType(), which is too general. - Use the new predicates in Sema::UsualArithmeticConversions() to recognize/convert the types. llvm-svn: 45992
* Make sure Sema::GetTypeForDeclarator() deals with abstract declarators when ↵Steve Naroff2008-01-141-4/+4
| | | | | | | | diagnosing incorrect code. Bug submitted by Eli. llvm-svn: 45989
* Fix build issue on cygwin, patch by Sam BishopChris Lattner2008-01-141-2/+4
| | | | llvm-svn: 45977
* Fix crasher when redefining functions. Not 100% pleased with this solution, ↵Steve Naroff2008-01-141-9/+16
| | | | | | but it is clearly an improvement. Will discuss with Chris later. llvm-svn: 45975
* Record if a compound literal expression is @ file scope. This allows us to ↵Steve Naroff2008-01-141-4/+5
| | | | | | | | implement C99 6.5.2.5p6. This could have been done without modifying the AST (by checking the decl type and passing the info down to isContextExpr), however we concluded this is more desirable. Bug/patch by Eli Friedman! llvm-svn: 45966
* Change Sema::CheckAddressOfOperation() to respect C99-only addressof rules.Steve Naroff2008-01-131-13/+17
| | | | | | | | | | | | | | | | | | Remove diagnostics from Sema::CheckIndirectionOperand(). C89/C99 allow dereferencing an incomplete type. clang appears to be emulating some incorrect gcc behavior (see below). void foo (void) { struct b; struct b* x = 0; struct b* y = &*x; // gcc produces an error ("dereferencing pointer to incomplete type") } With this patch, the above is now allowed. Bug/Patch by Eli Friedman! llvm-svn: 45933
* allow __func__ in objc methods.Chris Lattner2008-01-121-4/+8
| | | | llvm-svn: 45915
* Tighten up handling of __func__ and friends: it should be an arrayChris Lattner2008-01-121-13/+11
| | | | | | | | of const char, and it should error if it occurs outside a function. Is it valid in an objc method? If so we should handle that too. llvm-svn: 45910
* Fix the type of predefined identifiers like __func__. Patch byChris Lattner2008-01-121-2/+7
| | | | | | Eli Friedman! llvm-svn: 45906
* Add first pieces of support for parsing and representing Chris Lattner2008-01-122-0/+24
| | | | | | extern "C" in C++ mode. Patch by Mike Stump! llvm-svn: 45904
* - Teach Expr::isConstantExpr() about InitListExpr's (and offsetof, since I ↵Steve Naroff2008-01-103-47/+47
| | | | | | | | | | noticed it was missing). - Rename CheckInitializer() to CheckInitializerTypes(). - Removed the isStatic argument to CheckInitializerTypes() and all of it's subroutines. Checking for constant expressions is now done separately. - Added CheckForConstantInitializer(). llvm-svn: 45840
* Recover from user typo not having proper @interface decl and a bad foreach decl.Fariborz Jahanian2008-01-102-19/+26
| | | | llvm-svn: 45839
* Allow messaging expression as foreach's collection expression.Fariborz Jahanian2008-01-101-4/+4
| | | | llvm-svn: 45793
* Fix Sema::ActOnDeclarator() to call MergeFunctionDecl for function decls ↵Steve Naroff2008-01-091-8/+8
| | | | | | that aren't in scope. Since C functions are in a flat namespace, we need to give them special treatment (when compared with variables and typedefs). llvm-svn: 45789
* Fix ASTContext::typesAreCompatible to allow for int/enum compatibility (C99 ↵Steve Naroff2008-01-091-1/+3
| | | | | | | | 6.7.2.2p4). Fix Sema::MergeFunctionDecl to allow for function type compatibility (by using the predicate on ASTContext). Function types don't have to be identical to be compatible... llvm-svn: 45784
* Teach Sema::ActOnCompoundLiteral about constraint C99 6.5.2.5p3.Steve Naroff2008-01-091-2/+3
| | | | llvm-svn: 45782
* Fix Sema::CheckConditionalOperands(). The null pointer constant checks need ↵Steve Naroff2008-01-081-13/+11
| | | | | | to precede the check for two pointer operands. llvm-svn: 45732
* Substituted all instances of the string "Objc" for "ObjC". This fixesTed Kremenek2008-01-079-345/+345
| | | | | | | some naming inconsistencies in the names of classes pertaining to Objective-C support in clang. llvm-svn: 45715
* Limit type of foreach's element and collection to be a pointer to Fariborz Jahanian2008-01-071-1/+1
| | | | | | objc object type. llvm-svn: 45709
* Issue diagnostics if more than one declaration in objectove-c's foreach-stmt ↵Fariborz Jahanian2008-01-071-1/+4
| | | | | | header. llvm-svn: 45708
* minor cleanup.Chris Lattner2008-01-071-2/+1
| | | | llvm-svn: 45706
* rearrange some code.Chris Lattner2008-01-061-11/+16
| | | | llvm-svn: 45666
* some simplifications/cleanups to ?: sema.Chris Lattner2008-01-061-14/+21
| | | | llvm-svn: 45665
* Emit warnings like "dereferencing void pointer" instead of trying to Chris Lattner2008-01-061-3/+2
| | | | | | pretty print the type name for void. llvm-svn: 45664
OpenPOWER on IntegriCloud