summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Sink the BuiltinInfo object from ASTContext into theChris Lattner2009-06-141-0/+1
| | | | | | | | preprocessor and initialize it early in clang-cc. This ensures that __has_builtin works in all modes, not just when ASTContext is around. llvm-svn: 73319
* Instantiation support for more Obj-C expressions, string literals, @selector ↵Anders Carlsson2009-06-071-0/+16
| | | | | | and @protocol expressions. llvm-svn: 73036
* A corner case of objc2 gc's write-barrier generationFariborz Jahanian2009-06-011-9/+17
| | | | | | for the Next runtime. llvm-svn: 72703
* When evaluating a VarDecl as a constant or determining whether it isDouglas Gregor2009-05-261-2/+15
| | | | | | | | an integral constant expression, maintain a cache of the value and the is-an-ICE flag within the VarDecl itself. This eliminates exponential-time behavior of the Fibonacci template metaprogram. llvm-svn: 72428
* Add a new CallExpr::getCallReturnType and use it in Expr::isLvalueInternal. ↵Anders Carlsson2009-05-261-9/+13
| | | | | | No intended functionality change. llvm-svn: 72410
* A block that returns a reference is an lvalue.Anders Carlsson2009-05-261-0/+3
| | | | llvm-svn: 72409
* Template instantiation for C99 designated initializers, because weDouglas Gregor2009-05-211-28/+49
| | | | | | | | can. Also, delay semantic analysis of initialization for value-dependent as well as type-dependent expressions, since we can't always properly type-check a value-dependent expression. llvm-svn: 72233
* Fix handling of the GNU "t ? : f" extension to the conditionalDouglas Gregor2009-05-191-4/+4
| | | | | | | operator in C++, and verify that template instantiation for the condition operator does the right thing. llvm-svn: 72127
* Template instantiation for imaginary literals, because they were next in Expr.hDouglas Gregor2009-05-181-0/+10
| | | | llvm-svn: 72058
* Make ActOnExprStmt take a FullExprArg.Anders Carlsson2009-05-171-0/+3
| | | | llvm-svn: 71989
* Implement instantiation of a few boring, simple expressions. I don't think ↵Sebastian Redl2009-05-161-0/+17
| | | | | | these are testable yet, though. llvm-svn: 71953
* Basic support for member exprs where the base expr type is dependent.Anders Carlsson2009-05-151-0/+5
| | | | llvm-svn: 71907
* Implement C++0x nullptr.Sebastian Redl2009-05-101-0/+4
| | | | llvm-svn: 71405
* Fixes a bug for objc2's gc in the presense of type-casts.Fariborz Jahanian2009-05-051-1/+3
| | | | llvm-svn: 71041
* PR2524: downgrade taking address of expression of type 'void' to an Eli Friedman2009-05-031-5/+11
| | | | | | extension warning. llvm-svn: 70805
* When determining whether an expression refers to a bit-field, lookDouglas Gregor2009-05-021-4/+10
| | | | | | | | | into the left-hand side of an assignment expression. This completes most of PR3500; the only remaining part is to deal with the GCC-specific implementation-defined behavior for "unsigned long" (and other) bit-fields. llvm-svn: 70623
* PR4103: Silence bogus unused expression warning.Eli Friedman2009-04-291-1/+2
| | | | llvm-svn: 70384
* Remove getIntegerConstantExprValue in favor of using EvaluateAsInt.Eli Friedman2009-04-261-1/+1
| | | | llvm-svn: 70145
* implement PCH support for the rest of ExprObjC.h, includingChris Lattner2009-04-261-0/+10
| | | | | | the missing bits of ObjCMessageExpr. llvm-svn: 70100
* Change isNullPointerConstant to be strict; hopefully this won't cause Eli Friedman2009-04-251-6/+2
| | | | | | any issues now that we have our own tgmath.h. llvm-svn: 70090
* Fix PR4027 + rdar://6808859, we were rejecting implicit casts ofChris Lattner2009-04-211-0/+1
| | | | | | aggregates even though we already accept explicit ones. Easy fix. llvm-svn: 69661
* FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor2009-04-181-2/+6
| | | | | | | | lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. llvm-svn: 69406
* Fix two embarrassing PCH bugs:Douglas Gregor2009-04-171-1/+1
| | | | | | | | | 1) Accidentally used delete [] on an array of statements that was allocated with ASTContext's allocator 2) Deserialization of names with multiple declarations (e.g., a struct and a function) used the wrong mangling constant, causing it to view declaration IDs as Decl*s. 403.gcc builds and links properly. llvm-svn: 69390
* Implement lvalue test for conditional expressions.Sebastian Redl2009-04-171-0/+26
| | | | | | Add a few commented lines to the test case that point out things that don't work yet. llvm-svn: 69354
* Fix <rdar://problem/6765383> clang-6: clang does not appear to support ↵Steve Naroff2009-04-161-0/+2
| | | | | | declaring a static Block 'const'. llvm-svn: 69306
* PCH support for InitListExpr, DesignatedInitExpr, and ImplicitValueInitExpr.Douglas Gregor2009-04-161-0/+18
| | | | llvm-svn: 69251
* PCH support for ShuffleVectorExpr and BlockDeclRefExprDouglas Gregor2009-04-161-0/+9
| | | | llvm-svn: 69244
* PCH support for ExtVectorElementExpr and VAArgExpr.Douglas Gregor2009-04-151-3/+3
| | | | llvm-svn: 69240
* PCH support for MemberExpr and CallExpr.Douglas Gregor2009-04-151-0/+5
| | | | llvm-svn: 69186
* PCH support for string literalsDouglas Gregor2009-04-151-0/+21
| | | | llvm-svn: 69172
* Implement support for designated initializers that refer to members ofDouglas Gregor2009-04-151-18/+48
| | | | | | anonymous structs or unions. Fixes PR3778. llvm-svn: 69153
* Improve "assignment to cast" diagnostic.Daniel Dunbar2009-04-151-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Strip off extra parens when looking for casts. - Change the location info to point at the cast (instead of the assignment). For example, on int *b; #define a ((void*) b) void f0() { a = 10; } we now emit: /tmp/t.c:4:3: error: assignment to cast is illegal, lvalue casts are not supported a = 10; ^ ~ /tmp/t.c:2:12: note: instantiated from: #define a ((void*) b) ~^~~~~~~~~~ instead of: /tmp/t.c:4:5: error: expression is not assignable a = 10; ~ ^ llvm-svn: 69114
* Strip paren expressions when trying to diagnose "cast as lvalue"Daniel Dunbar2009-04-141-1/+1
| | | | | | extension. llvm-svn: 69100
* Make our diagnostics about the obsolete GNU designated-initializerDouglas Gregor2009-03-281-1/+1
| | | | | | | syntax into extension warnings, and provide code-modification hints showing how to fix the problem. llvm-svn: 67885
* use isa<>Chris Lattner2009-03-231-2/+2
| | | | llvm-svn: 67543
* Adjust isModifiableLvalue to give a slightly more useful diagnostic for Eli Friedman2009-03-221-10/+11
| | | | | | attempting to illegally modify a BlockDeclRefExpr. llvm-svn: 67491
* fix some warnings in release-assert mode.Chris Lattner2009-03-221-9/+9
| | | | llvm-svn: 67456
* When building the structured initializer list, pre-allocate storage inDouglas Gregor2009-03-201-0/+5
| | | | | | | | | | | its vectors based on the subobject type we're initializing and the (unstructured) initializer list. This eliminates some malloc thrashing when parsing initializers (from 117 vector reallocations down to 0 when parsing Cocoa.h). We can't always pre-allocate the right amount of storage, since designated initializers can cause us to initialize in non-predictable patterns. llvm-svn: 67421
* Destroy expressions properly when resizing an initializer listDouglas Gregor2009-03-201-1/+1
| | | | llvm-svn: 67417
* Almost complete implementation of rvalue references. One bug, and a few ↵Sebastian Redl2009-03-161-10/+8
| | | | | | unclear areas. Maybe Doug can shed some light on some of the fixmes. llvm-svn: 67059
* Add the ability to clone integer and string literals. Use it when ↵Anders Carlsson2009-03-151-1/+10
| | | | | | instantiating template expressions. llvm-svn: 67030
* Handle dependent types/exprs in static_assert expressions.Anders Carlsson2009-03-141-0/+1
| | | | llvm-svn: 66997
* Implement template instantiation for the prefix unary operators. AsDouglas Gregor2009-03-131-0/+30
| | | | | | | | always, refactored the existing logic to tease apart the parser action and the semantic analysis shared by the parser and template instantiation. llvm-svn: 66987
* Refactor the way we handle operator overloading and templateDouglas Gregor2009-03-131-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | instantiation for binary operators. This change moves most of the operator-overloading code from the parser action ActOnBinOp to a new, parser-independent semantic checking routine CreateOverloadedBinOp. Of particular importance is the fact that CreateOverloadedBinOp does *not* perform any name lookup based on the current parsing context (it doesn't take a Scope*), since it has to be usable during template instantiation, when there is no scope information. Rather, it takes a pre-computed set of functions that are visible from the context or via argument-dependent lookup, and adds to that set any member operators and built-in operator candidates. The set of functions is computed in the parser action ActOnBinOp based on the current context (both operator name lookup and argument-dependent lookup). Within a template, the set computed by ActOnBinOp is saved within the type-dependent AST node and is augmented with the results of argument-dependent name lookup at instantiation time (see TemplateExprInstantiator::VisitCXXOperatorCallExpr). Sadly, we can't fully test this yet. I'll follow up with template instantiation for sizeof so that the real fun can begin. llvm-svn: 66923
* add a helper function to strip noop casts.Chris Lattner2009-03-131-0/+34
| | | | llvm-svn: 66909
* Eliminate some unused default cases in switches on the binary operator kindDouglas Gregor2009-03-121-1/+4
| | | | llvm-svn: 66837
* Eliminate CXXClassVarDecl. It doesn't add anythingDouglas Gregor2009-03-111-1/+1
| | | | llvm-svn: 66696
* Minor cleanup for choose expressions: add a helper that returns the Eli Friedman2009-03-041-8/+2
| | | | | | chosen sub-expression, rather than just evaluating the condition. llvm-svn: 66018
* Change the AST generated for offsetof a bit so that it looks like a Eli Friedman2009-02-271-43/+0
| | | | | | | | normal expression, and change Evaluate and IRGen to evaluate it like a normal expression. This simplifies the code significantly, and fixes PR3396. llvm-svn: 65622
* Make isICE assert when Evaluate can't evaluate an ICE, as suggested byEli Friedman2009-02-271-26/+58
| | | | | | | Daniel. Some minor fixes/cleanup. Allow __builtin_choose_expr, __real__, and __imag__ in ICEs, following gcc's example. llvm-svn: 65610
OpenPOWER on IntegriCloud