summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Several things...Steve Naroff2008-12-042-2/+2
| | | | | | | | | | | - Implement RewritePropertySetter(). While the routine is simple, there were some tricky changes to RewriteFunctionBodyOrGlobalInitializer(), the main rewriter loop. It also required some additional instance data to distinguish setters from getters, as well as some changes to RewritePropertyGetter(). - Implement FIXME: for pretty printing ObjCPropertyRefExpr's. - Changed ObjCPropertyRefExpr::getSourceRange() to point to the end of the property name (not the beginning). Also made a minor name change from "Loc"->"IdLoc" (to make it clear the Loc does not point to the "."). llvm-svn: 60540
* Fix some type punning errors in SizeOfAlignOf and Typeid AST nodes. This ↵Sebastian Redl2008-12-033-5/+5
| | | | | | should satisfy compilers and language lawyers alike. llvm-svn: 60511
* Correct pretty printing of array new expressions.Sebastian Redl2008-12-021-4/+9
| | | | llvm-svn: 60444
* Handle new by passing the Declaration to the Action, not a processed type.Sebastian Redl2008-12-023-14/+21
| | | | llvm-svn: 60413
* This patch corrects problem in searching for a setter/getter method forFariborz Jahanian2008-12-021-24/+18
| | | | | | | | a property. Previous scheme of seaching in interface's list of methods would not work because this list is not yet constructed. This is in preparation for doing semantic check on viability of setter/getter method declarations. llvm-svn: 60386
* -Add several ObjC types to Decl::getDeclKindName(), a useful debug hook.Steve Naroff2008-12-011-0/+3
| | | | | | -Start adding support for rewriting @synthesize. llvm-svn: 60368
* Use EmitInt, not Emit, to emit unsigned valuesDouglas Gregor2008-12-011-2/+2
| | | | llvm-svn: 60364
* Generate the correct results for the comma expression. Fixes PR3123.Anders Carlsson2008-12-011-7/+10
| | | | llvm-svn: 60334
* Revert change that made isNullPointerConstant start emitting warnings. We ↵Anders Carlsson2008-12-011-11/+9
| | | | | | don't want that :) llvm-svn: 60333
* Remove dead code.Anders Carlsson2008-12-011-3/+0
| | | | llvm-svn: 60320
* Add a new variant of isNullConstantExpr that returns an EvalResult.Anders Carlsson2008-12-011-5/+15
| | | | llvm-svn: 60318
* Emit the correct diagnostic when a comma is in an ICE.Anders Carlsson2008-12-011-4/+4
| | | | llvm-svn: 60316
* Change the diagnostics that the evaluator reports to be of type NOTE.Anders Carlsson2008-11-301-11/+10
| | | | llvm-svn: 60301
* Replace the isEvaluated bool with a ShortCircuit int, making it easier to ↵Anders Carlsson2008-11-301-12/+10
| | | | | | handle recursion llvm-svn: 60300
* Pass the expression to the Error and Extension methods.Anders Carlsson2008-11-301-20/+22
| | | | llvm-svn: 60299
* Add a new variant of Evaluate and reimplement the old Evaluate in terms of ↵Anders Carlsson2008-11-301-7/+17
| | | | | | the new. llvm-svn: 60298
* General cleanup, evaluate the RHS of a logical op even if the LHS will give ↵Anders Carlsson2008-11-301-16/+25
| | | | | | us the result. llvm-svn: 60297
* EvalInfo now holds a reference to an EvalResult struct.Anders Carlsson2008-11-301-24/+14
| | | | llvm-svn: 60296
* Implement the GNU __null extensionDouglas Gregor2008-11-293-1/+29
| | | | llvm-svn: 60235
* Switch QualType to use llvm::PointerIntPair internally to do the pointerChris Lattner2008-11-281-6/+8
| | | | | | bitmangling. llvm-svn: 60226
* remove debug-only assertion in the complex float evaluator as it makes some ↵Nuno Lopes2008-11-261-1/+0
| | | | | | real apps crash llvm-svn: 60069
* Refactored checking on readonly property into a method.Fariborz Jahanian2008-11-252-18/+27
| | | | llvm-svn: 60050
* Patch to allow over-riding of readonly property to Fariborz Jahanian2008-11-251-4/+18
| | | | | | a writable property in one of its category. llvm-svn: 60035
* Remove more #ifdeffed codeAnders Carlsson2008-11-251-144/+0
| | | | llvm-svn: 60033
* Fix CFG bug where the 'increment' block for a 'for' statement would not beTed Kremenek2008-11-241-2/+10
| | | | | | | | | | properly reversed once constructed. This fixes PR 3125: http://llvm.org/bugs/show_bug.cgi?id=3125 llvm-svn: 59982
* Reimplement Expr::isConstantExpr in terms of Expr::Evaluate. This fixes PR2832.Anders Carlsson2008-11-241-0/+25
| | | | llvm-svn: 59946
* The address of a variable is only constant if the variable has global storage.Anders Carlsson2008-11-241-1/+9
| | | | llvm-svn: 59939
* Fix bug in the constant evaluator. Fixes PR3115.Anders Carlsson2008-11-241-33/+33
| | | | llvm-svn: 59938
* Migrate some stuff from NamedDecl::getName() to Chris Lattner2008-11-245-22/+22
| | | | | | NamedDecl::getNameAsString() to make it more explicit. llvm-svn: 59937
* Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make itChris Lattner2008-11-242-7/+6
| | | | | | | | | assert if the name is not an identifier. Update callers to do the right thing and avoid this method in unsafe cases. This also fixes an objc warning that was missing a space, and migrates a couple more to taking IdentifierInfo and QualTypes instead of std::strings. llvm-svn: 59936
* simplify this code.Chris Lattner2008-11-241-1/+2
| | | | llvm-svn: 59935
* Rename Selector::getName() to Selector::getAsString(), and addChris Lattner2008-11-245-11/+10
| | | | | | | | | | | | | a new NamedDecl::getAsString() method. Change uses of Selector::getName() to just pass in a Selector where possible (e.g. to diagnostics) instead of going through an std::string. This also adds new formatters for objcinstance and objcclass as described in the dox. llvm-svn: 59933
* Return false if we encounter a type we can't handle.Anders Carlsson2008-11-221-1/+2
| | | | llvm-svn: 59889
* Case values must be evaluatedAnders Carlsson2008-11-221-19/+23
| | | | llvm-svn: 59884
* Use Expr::Evaluate for case statements. Fixes PR2525Anders Carlsson2008-11-221-9/+27
| | | | llvm-svn: 59881
* Support for implicit property assignment. Error assigning toFariborz Jahanian2008-11-222-1/+7
| | | | | | 'implicit' property with no 'setter'. llvm-svn: 59878
* New AST node to access "implicit" setter/getter using property dor syntax.Fariborz Jahanian2008-11-224-25/+56
| | | | | | | Issuing diagnostics when assigning to read-only properties. This is work in progress. llvm-svn: 59874
* Implementation of new and delete parsing and sema.Sebastian Redl2008-11-214-3/+152
| | | | | | This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first. llvm-svn: 59835
* Enable some more operator overloading tests, and don't look into an ↵Douglas Gregor2008-11-211-0/+3
| | | | | | identifier for functions that might not have one llvm-svn: 59818
* Rename IdentifierInfo::isName to ::isStr. Use a nifty trickChris Lattner2008-11-201-4/+4
| | | | | | | from Sebastian to enforce that a literal string is passed in, and use this to avoid having to call strlen on it. llvm-svn: 59706
* CMake: Added some source files.Oscar Fuentes2008-11-191-0/+1
| | | | | | Patch contributed by Jay Foad! llvm-svn: 59656
* Make DeclContext::getLexicalParent reuse DeclContext::getParent.Argyrios Kyrtzidis2008-11-191-4/+1
| | | | llvm-svn: 59651
* Take care another assert:Argyrios Kyrtzidis2008-11-191-0/+9
| | | | | | | | | | | | | | | | | | | | struct A { struct B; }; struct A::B { void m() {} // Assertion failed: getContainingDC(DC) == CurContext && "The next DeclContext should be lexically contained in the current one." }; Introduce DeclContext::getLexicalParent which may be different from DeclContext::getParent when nested-names are involved, e.g: namespace A { struct S; } struct A::S {}; // getParent() == namespace 'A' // getLexicalParent() == translation unit llvm-svn: 59650
* fix folding of '*doubleArray'Nuno Lopes2008-11-191-0/+3
| | | | llvm-svn: 59647
* Make the non-const DeclContext::getParent call the const version, instead of ↵Argyrios Kyrtzidis2008-11-191-3/+3
| | | | | | the other way around. llvm-svn: 59646
* Support overloading of the subscript operator[], including support forDouglas Gregor2008-11-191-0/+5
| | | | | | | | | built-in operator candidates. Test overloading of '&' and ','. In C++, a comma expression is an lvalue if its right-hand subexpression is an lvalue. Update Expr::isLvalue accordingly. llvm-svn: 59643
* Added operator overloading for unary operators, post-increment, andDouglas Gregor2008-11-191-0/+5
| | | | | | | | | | | | | post-decrement, including support for generating all of the built-in operator candidates for these operators. C++ and C have different rules for the arguments to the builtin unary '+' and '-'. Implemented both variants in Sema::ActOnUnaryOp. In C++, pre-increment and pre-decrement return lvalues. Update Expr::isLvalue accordingly. llvm-svn: 59638
* simplify some code.Chris Lattner2008-11-191-8/+7
| | | | llvm-svn: 59608
* formattingChris Lattner2008-11-191-4/+2
| | | | llvm-svn: 59599
* Extend DeclarationName to support C++ overloaded operators, e.g.,Douglas Gregor2008-11-184-7/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | operator+, directly, using the same mechanism as all other special names. Removed the "special" identifiers for the overloaded operators from the identifier table and IdentifierInfo data structure. IdentifierInfo is back to representing only real identifiers. Added a new Action, ActOnOperatorFunctionIdExpr, that builds an expression from an parsed operator-function-id (e.g., "operator +"). ActOnIdentifierExpr used to do this job, but operator-function-ids are no longer represented by IdentifierInfo's. Extended Declarator to store overloaded operator names. Sema::GetNameForDeclarator now knows how to turn the operator name into a DeclarationName for the overloaded operator. Except for (perhaps) consolidating the functionality of ActOnIdentifier, ActOnOperatorFunctionIdExpr, and ActOnConversionFunctionExpr into a common routine that builds an appropriate DeclRefExpr by looking up a DeclarationName, all of the work on normalizing declaration names should be complete with this commit. llvm-svn: 59526
OpenPOWER on IntegriCloud