summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Address some comments on the name lookup/DeclContext patch from ChrisDouglas Gregor2008-12-112-10/+9
| | | | llvm-svn: 60897
* Actually distinguish between RecordDecl::field_iterator and ↵Douglas Gregor2008-12-111-2/+2
| | | | | | RecordDecl::field_const_iterator, propagating the constness down to the FieldDecls. llvm-svn: 60883
* Unifies the name-lookup mechanisms used in various parts of the ASTDouglas Gregor2008-12-119-128/+393
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and separates lexical name lookup from qualified name lookup. In particular: * Make DeclContext the central data structure for storing and looking up declarations within existing declarations, e.g., members of structs/unions/classes, enumerators in C++0x enums, members of C++ namespaces, and (later) members of Objective-C interfaces/implementations. DeclContext uses a lazily-constructed data structure optimized for fast lookup (array for small contexts, hash table for larger contexts). * Implement C++ qualified name lookup in terms of lookup into DeclContext. * Implement C++ unqualified name lookup in terms of qualified+unqualified name lookup (since unqualified lookup is not purely lexical in C++!) * Limit the use of the chains of declarations stored in IdentifierInfo to those names declared lexically. * Eliminate CXXFieldDecl, collapsing its behavior into FieldDecl. (FieldDecl is now a ScopedDecl). * Make RecordDecl into a DeclContext and eliminates its Members/NumMembers fields (since one can just iterate through the DeclContext to get the fields). llvm-svn: 60878
* The "real" fix for <rdar://problem/6424347> clang on xcode: Assertion ↵Steve Naroff2008-12-101-28/+30
| | | | | | | | failed: (0 && "unexpected type"), function mergeTypes, Commit r60845 was premature. llvm-svn: 60852
* Some cleanups to the dependent-types commit, as suggested by SebastianDouglas Gregor2008-12-101-4/+0
| | | | llvm-svn: 60848
* Fix <rdar://problem/6424347> clang on xcode: Assertion failed: (0 && ↵Steve Naroff2008-12-101-27/+27
| | | | | | "unexpected type"), function mergeTypes, llvm-svn: 60845
* Fix <rdar://problem/6418623> Bogus block type compatibility warning.Steve Naroff2008-12-101-1/+20
| | | | llvm-svn: 60842
* Prevent bogus warning on unimplemented setter/getter when userFariborz Jahanian2008-12-091-0/+8
| | | | | | has added declaration of these methods in its @interface. llvm-svn: 60803
* Support for implementation of property in the case whereFariborz Jahanian2008-12-091-3/+4
| | | | | | | the synthesis is in an implementation of s subclass of a super class where the property has been declared. llvm-svn: 60792
* Add preliminary CFG support for @throw. We basically treat it like a return ↵Ted Kremenek2008-12-091-1/+23
| | | | | | statement. llvm-svn: 60790
* ObjCInterfaceDecl::lookupInstanceMethod() needs to look through a categories ↵Steve Naroff2008-12-081-0/+8
| | | | | | | | protocols. Fixes <rdar://problem/6418640> clang on prokit: error: incompatible type returning 'id', expected 'NSSize' llvm-svn: 60716
* Workaround for PR3173. The fix is correct in the sense that if the enum Eli Friedman2008-12-081-0/+3
| | | | | | | | | code were working correctly, it would be a no-op, but it's not really a proper fix. That said, I don't really want to touch the enum code at the moment because I don't understand it very well, and this seems to be a relatively visible regression. llvm-svn: 60680
* Use of properties declared in protocols in the categoryFariborz Jahanian2008-12-061-0/+25
| | | | | | | via the category's protocol list1s, with appropriate diagnsostics and a test case. llvm-svn: 60634
* Add support for calls to dependent names within templates, e.g.,Douglas Gregor2008-12-063-0/+29
| | | | | | | | | | | | | | | | | | template<typename T> void f(T x) { g(x); // g is a dependent name, so don't even bother to look it up g(); // error: g is not a dependent name } Note that when we see "g(", we build a CXXDependentNameExpr. However, if none of the call arguments are type-dependent, we will force the resolution of the name "g" and replace the CXXDependentNameExpr with its result. GCC actually produces a nice error message when you make this mistake, and even offers to compile your code with -fpermissive. I'll do the former next, but I don't plan to do the latter. llvm-svn: 60618
* Introduce basic support for dependent types, type-dependentDouglas Gregor2008-12-056-4/+135
| | | | | | | | | | | | expressions, and value-dependent expressions. This permits us to parse some template definitions. This is not a complete solution; we're missing type- and value-dependent computations for most of the expression types, and we're missing checks for dependent types and type-dependent expressions throughout Sema. llvm-svn: 60615
* Fixed a comment.Fariborz Jahanian2008-12-051-4/+4
| | | | llvm-svn: 60611
* This test checks for duplicate implementation of the same Fariborz Jahanian2008-12-051-0/+54
| | | | | | | | property. It also checks for duplicate use of the same ivar in two different iproperty implementations. It also caught an error for a test case used in CodeGen :). llvm-svn: 60610
* Representation of template type parameters and non-type templateDouglas Gregor2008-12-057-1/+96
| | | | | | | | | | | | | | | parameters, with some semantic analysis: - Template parameters are introduced into template parameter scope - Complain about template parameter shadowing (except in Microsoft mode) Note that we leak template parameter declarations like crazy, a problem we'll remedy once we actually create proper declarations for templates. Next up: dependent types and value-dependent/type-dependent expressions. llvm-svn: 60597
* This wasn't such a good idea after all as it broke some tests.Anders Carlsson2008-12-051-10/+1
| | | | llvm-svn: 60582
* Handle __builtin___CFStringMakeConstantString in Expr::Evaluate.Anders Carlsson2008-12-051-1/+10
| | | | llvm-svn: 60581
* 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
OpenPOWER on IntegriCloud