summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-2286/+0
| | | | | | | | | | lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
* simplify all the type info accessors in TargeTInfo to return scalars,Chris Lattner2008-03-081-7/+6
| | | | | | which is simpler to use and provide. llvm-svn: 48051
* remove the source location arguments to various target query methods.Chris Lattner2008-03-051-23/+15
| | | | llvm-svn: 47954
* character literals have char type in C++ and int type in C. PatchChris Lattner2008-03-011-2/+4
| | | | | | by Nuno Lopes for PR2089 llvm-svn: 47787
* Fix http://llvm.org/bugs/show_bug.cgi?id=2103.Steve Naroff2008-02-291-5/+15
| | | | llvm-svn: 47775
* Add support for attribute(deprecated), patch by Nuno Lopes!Chris Lattner2008-02-291-0/+4
| | | | llvm-svn: 47753
* Alternate address spaces work:Chris Lattner2008-02-201-7/+9
| | | | | | | | | rename QualType::getQualifiers to getCVRQualifiers. Add some fixme's and clean up some code relevant to qualifiers. Change ASQualType to contain a Type* instead of a QualType. Any CVR qualifiers should be on the outer qual type. llvm-svn: 47398
* Allow ArraySubscriptExpr to be a base node for vector dereference. ThisNate Begeman2008-02-191-1/+1
| | | | | | | | | allows you to do things like typedef __attribute__(( ocu_vector_type(4))) float float4; float4 *x; float y = x[0][2]; llvm-svn: 47295
* Fix PR1992 by computing the right type for string literals, whichChris Lattner2008-02-111-10/+14
| | | | | | | | is an array type not a pointer type. This requires updating some diags that change and updating the code generator to handle the proper form of strings. llvm-svn: 46941
* Fix the type of conditionals involving void* to be self-consistent and Eli Friedman2008-02-101-4/+16
| | | | | | | | spec-compliant. I'll put together some testcases in a bit. llvm-svn: 46937
* Fix spelling in comment.Steve Naroff2008-02-091-1/+1
| | | | llvm-svn: 46906
* Fix <rdar://problem/5733511> clang doesn't emit error for const array.Steve Naroff2008-02-091-2/+11
| | | | llvm-svn: 46905
* Fix indentation.Eli Friedman2008-02-081-5/+5
| | | | llvm-svn: 46873
* Detabify SemaExpr. My text editor defaults to 8 spaces per tab, so it Eli Friedman2008-02-081-26/+26
| | | | | | gets kind of annoying. llvm-svn: 46872
* Add a FIXME for alternate address spaces.Eli Friedman2008-02-071-0/+1
| | | | llvm-svn: 46841
* Make sure to propagate qualifiers through the member operator.Eli Friedman2008-02-061-3/+12
| | | | llvm-svn: 46830
* Rename diagnostic to reflect it's role...Steve Naroff2008-02-011-1/+1
| | | | llvm-svn: 46650
* getPrimaryDecl can return null.Anders Carlsson2008-02-011-1/+1
| | | | llvm-svn: 46638
* It is allowed to get the address of an array subscript, even if the array ↵Anders Carlsson2008-02-011-10/+16
| | | | | | has the register qualifier, if the array is really a pointer. llvm-svn: 46634
* Remainder of the __builtin_overload feedbackNate Begeman2008-01-311-5/+19
| | | | llvm-svn: 46601
* Implement first round of feedback on __builtin_overloadNate Begeman2008-01-301-11/+19
| | | | llvm-svn: 46572
* Fix codegen for conditionals with incommpatible pointer types. Code Eli Friedman2008-01-301-1/+7
| | | | | | | that causes this isn't really correct, but if we're going to accept this, it should come up with a consistent AST. llvm-svn: 46557
* 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
* 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
* Exclude vectors from Type::isScalar() predicate.Steve Naroff2008-01-241-2/+3
| | | | llvm-svn: 46328
* Implement basic overload support via a new builtin, __builtin_overload.Nate Begeman2008-01-171-1/+71
| | | | | | | | | | | | | | | | | | | | | | | | __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-171-2/+2
| | | | | | | 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-161-45/+37
| | | | | | | | | | 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
* 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
* 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
* - Teach Expr::isConstantExpr() about InitListExpr's (and offsetof, since I ↵Steve Naroff2008-01-101-3/+6
| | | | | | | | | | 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
* 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-071-17/+17
| | | | | | | some naming inconsistencies in the names of classes pertaining to Objective-C support in clang. llvm-svn: 45715
* 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
* unnest vector handling again.Chris Lattner2008-01-041-23/+23
| | | | llvm-svn: 45602
* we already test for exact type matches early, so we don't have to do Chris Lattner2008-01-041-16/+13
| | | | | | it explicitly for vectors. This allows us to unnest some code. llvm-svn: 45600
* simplify some of this code by removing the else/if chain and by Chris Lattner2008-01-041-8/+25
| | | | | | stripping down to canonical types early. llvm-svn: 45599
* move objc expr sema to its own file.Chris Lattner2008-01-041-280/+0
| | | | llvm-svn: 45597
OpenPOWER on IntegriCloud