summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Implement method type encoding in the presenseFariborz Jahanian2010-04-082-4/+6
| | | | | | of c-style arguments. Completes radar 7445205. llvm-svn: 100813
* Fix a misuse of iterators when iterating through block'sFariborz Jahanian2010-04-081-2/+2
| | | | | | parameters list for encoding. llvm-svn: 100788
* Implement dependent friend function template specializations.John McCall2010-04-081-0/+34
| | | | llvm-svn: 100753
* AST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.Daniel Dunbar2010-04-081-91/+197
| | | | llvm-svn: 100746
* When a template (without arguments) is passed as a template typeJeffrey Yasskin2010-04-081-0/+14
| | | | | | | parameter, explicitly ask the user to give it arguments. We used to complain that it wasn't a type and expect the user to figure it out. llvm-svn: 100729
* Don't emit an 'unused expression' warning for '||' and '&&' expressions that ↵Ted Kremenek2010-04-071-12/+15
| | | | | | | | contain assignments or similar side-effects. llvm-svn: 100676
* Implement the protected access restriction ([class.protected]), which requiresJohn McCall2010-04-062-2/+22
| | | | | | | | that protected members be used on objects of types which derive from the naming class of the lookup. My first N attempts at this were poorly-founded, largely because the standard is very badly worded here. llvm-svn: 100562
* Put type restriction on convesion to nonconforming 'id' back in Fariborz Jahanian2010-04-061-3/+2
| | | | | | block pointer type comparison. llvm-svn: 100533
* Match MemoryBuffer API changes.Chris Lattner2010-04-051-2/+1
| | | | llvm-svn: 100484
* Extend the type printing policy to allow one to turn off the printingDouglas Gregor2010-04-051-12/+15
| | | | | | | of file locations for anonymous tag types (e.g., "enum <anonymous at t.h:15:6>"), which can get rather long. llvm-svn: 100470
* fix PR6780, properly handling the IR {|} escapes in inline asm strings.Chris Lattner2010-04-051-5/+9
| | | | llvm-svn: 100449
* AST: Add ObjCIvarDecl::getContainingInterface().Daniel Dunbar2010-04-021-0/+23
| | | | llvm-svn: 100227
* Sema/Obj-C: Narrow type of ObjCIvarDecl::Create, and check additional ↵Daniel Dunbar2010-04-022-2/+19
| | | | | | | | invariants on the provided DeclContext. - Doug, please see the FIXME in DeclObjC.cpp -- I am not sure what the right fix is. llvm-svn: 100213
* Rework our handling of copy construction of temporaries, which was aDouglas Gregor2010-04-021-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | poor (and wrong) approximation of the actual rules governing when to build a copy and when it can be elided. The correct implementation is actually simpler than the approximation. When we only enumerate constructors as part of initialization (e.g., for direct initialization or when we're copying from a class type or one of its derived classes), we don't create a copy. When we enumerate all conversion functions, we do create a copy. Before, we created some extra copies and missed some others. The new test copy-initialization.cpp shows a case where we missed creating a (required, non-elidable) copy as part of a user-defined conversion, which resulted in a miscompile. This commit also fixes PR6757, where the missing copy made us reject well-formed code in the ternary operator. This commit also cleans up our handling of copy elision in the case where we create an extra copy of a temporary object, which became necessary now that we produce the right copies. The code that seeks to find the temporary object being copied has moved into Expr::getTemporaryObject(); it used to have two different not-quite-the-same implementations, one in Sema and one in CodeGen. Note that we still do not attempt to perform the named return value optimization, so we miss copy elisions for return values and throw expressions. llvm-svn: 100196
* Relax the typesafty rules of block pointers types whichFariborz Jahanian2010-04-011-2/+3
| | | | | | take'id' or return 'id' in their type. Fixes radar 7814131. llvm-svn: 100129
* Change the representation of dependent elaborated-type-specifiersDouglas Gregor2010-03-311-0/+21
| | | | | | | | | | | | | | (such as "class T::foo") from an ElaboratedType of a TypenameType to a DependentNameType, which more accurately models the underlying concept. Improve template instantiation for DependentNameType nodes that represent nested-name-specifiers, by performing tag name lookup and checking the resulting tag appropriately. Fixes PR5681. There is still much testing and cleanup to do in this area. llvm-svn: 100054
* Extend DependentNameType with a keyword enum that specifies whetherDouglas Gregor2010-03-312-15/+33
| | | | | | | this was parsed as a typename-specifier, elaborated-type-specifier (including the kind), or just a dependent qualified type name. llvm-svn: 100039
* Remove the AST statistics tracking I added yesterday; it didn't pan out.Douglas Gregor2010-03-314-28/+0
| | | | llvm-svn: 100027
* Rename TypenameType to DependentNameType in anticipation of someDouglas Gregor2010-03-314-22/+22
| | | | | | refactoring work in this area. llvm-svn: 100019
* Regularize support for naming conversion functions in using decls.John McCall2010-03-311-13/+34
| | | | llvm-svn: 99979
* Introduce a new kind of derived-to-base cast which bypasses the need forJohn McCall2010-03-301-0/+2
| | | | | | | null checks, and make sure we elide null checks when accessing base class members. llvm-svn: 99963
* Remember the regparm attribute in FunctionType::ExtInfo.Rafael Espindola2010-03-303-8/+24
| | | | | | Fixes PR3782. llvm-svn: 99940
* Propagate the "found declaration" (i.e. the using declaration instead ofJohn McCall2010-03-301-25/+26
| | | | | | | | | | | | | the underlying/instantiated decl) through a lot of API, including "intermediate" MemberExprs required for (e.g.) template instantiation. This is necessary because of the access semantics of member accesses to using declarations: only the base class *containing the using decl* need be accessible from the naming class. This allows us to complete an access-controlled selfhost, if there are no recent regressions. llvm-svn: 99936
* the big refactoring bits of PR3782.Rafael Espindola2010-03-304-52/+57
| | | | | | | | This introduces FunctionType::ExtInfo to hold the calling convention and the noreturn attribute. The next patch will extend it to include the regparm attribute and fix the bug. llvm-svn: 99920
* Introduce new AST statistics that keep track of the number of isa (orDouglas Gregor2010-03-304-0/+28
| | | | | | | | | | | | | | | | | | | | | dyn_cast) invocations for C++ and Objective-C types, declarations, expressions, and statements. The statistics will be printed when -print-stats is provided to Clang -cc1, with results such as: 277073 clang - Number of checks for C++ declaration nodes 13311 clang - Number of checks for C++ expression nodes 18 clang - Number of checks for C++ statement nodes 174182 clang - Number of checks for C++ type nodes 92300 clang - Number of checks for Objective-C declaration nodes 9800 clang - Number of checks for Objective-C expression nodes 7 clang - Number of checks for Objective-C statement nodes 65733 clang - Number of checks for Objective-C type nodes The statistics are only gathered when NDEBUG is not defined, since they introduce potentially-expensive operations into very low-level routines (isa). llvm-svn: 99912
* Add Support for 'warn_unused_result" attribute onFariborz Jahanian2010-03-301-1/+8
| | | | | | objective-c methods. (radar 7418262). llvm-svn: 99903
* When copying a partial diagnostic into a DependentDiagnostic, allocateDouglas Gregor2010-03-291-13/+6
| | | | | | | | | storage for that partial diagnostic via the ASTContext's BumpPtrAllocator rather than using up slots in the ASTContext's cache. Now that we do this, we don't have to worry about destroying dependent diagnostics when destroying a DependentStoredDeclsMap. llvm-svn: 99854
* Optimize PartialDiagnostic's memory-allocation behavior by placing aDouglas Gregor2010-03-291-0/+2
| | | | | | | | | | | | | | cache of PartialDiagnostic::Storage objects into an allocator within the ASTContext. This eliminates a significant amount of malloc traffic, for a 10% performance improvement in -fsyntax-only wall-clock time with 403.gcc's combine.c. Also, eliminate the RequireNonAbstractType hack I put in earlier, which was but a symptom of this larger problem. Fixes <rdar://problem/7806091>. llvm-svn: 99849
* When collecting virtual bases it's very important to use the canonical type ↵Anders Carlsson2010-03-291-3/+3
| | | | | | of the base class. Otherwise, we might add the same virtual base class twice if the virtual base is an instantiated template. Fixes PR6251. llvm-svn: 99829
* Fix a nasty bug in the virtual base computation which would lead to us ↵Anders Carlsson2010-03-291-49/+37
| | | | | | initializing virtual bases in the wrong order. llvm-svn: 99806
* Be a bit more consistent in using operator->Rafael Espindola2010-03-291-2/+2
| | | | | | | This patch moves some methods from QualType to Type and changes the users to use -> instead of . llvm-svn: 99805
* Properly account for redeclarations when explicitly instantiating class ↵John McCall2010-03-261-4/+2
| | | | | | | | | | | | | templates. What happens here is that we actually turn the first declaration into a definition, regardless of whether it was actually originally a definition, and furthermore we do this all after we've instantiated all the declarations. This exposes a bug in my DefinitionData patch where it was only setting the DefinitionData for previous declarations, not future declarations. Fortunately, there's an iterator for that. llvm-svn: 99657
* Implement a framework for the delay of arbitrary diagnostics withinJohn McCall2010-03-242-20/+84
| | | | | | | | | templates. So delay access-control diagnostics when (for example) the target of a friend declaration is a specific specialization of a template. I was surprised to find that this was required for an access-controlled selfhost. llvm-svn: 99383
* Implement computation of the final overriders for each virtualDouglas Gregor2010-03-231-0/+237
| | | | | | | | | | | | | | | | | | | | function within a class hierarchy (C++ [class.virtual]p2). We use the final-overrider computation to determine when a particular class is ill-formed because it has multiple final overriders for a given virtual function (e.g., because two virtual functions override the same virtual function in the same virtual base class). Fixes PR5973. We also use the final-overrider computation to determine which virtual member functions are pure when determining whether a class is abstract or diagnosing the improper use of an abstract class. The prior approach to determining whether there were any pure virtual functions in a class didn't cope with virtual base class subobjects properly, and could not easily be fixed to deal with the oddities of subobject hiding. Fixes PR6631. llvm-svn: 99351
* More clean up of ivars which are either in class extensions andFariborz Jahanian2010-03-221-27/+15
| | | | | | | | implementation or synthesized into an implementation. Also, fixes a code gen. bug when ivars are itroduced in interleaved implementations. (related to radar 7547942). llvm-svn: 99193
* Sort calls to add_clang_library()Kovarththanan Rajaratnam2010-03-221-2/+2
| | | | llvm-svn: 99191
* Evaluate: Fix a subtle bug in the pointer evaluator in which we would do anDaniel Dunbar2010-03-201-10/+17
| | | | | | | | expression computation in the wrong bit-width, and end up generating a totally bogus array reference (_g0+8589934546). - This showed up on Prolangs/cdecl. llvm-svn: 99042
* Remove the capture, serialization, and deserialization of commentDouglas Gregor2010-03-191-197/+1
| | | | | | | | ranges as part of the ASTContext. This code is not and was never used, but contributes ~250k to the size of the Cocoa.h precompiled header. llvm-svn: 99007
* Make the CIndex API more resilient to being used on invalid code.Ted Kremenek2010-03-191-1/+4
| | | | llvm-svn: 98981
* Pretty-print anonymous types using their kind and presumed location.John McCall2010-03-191-6/+25
| | | | | | Fixes PR6643. Patch by Mike M! llvm-svn: 98946
* Make PredefinedExpr::ComputeName() more robust to incorrectTed Kremenek2010-03-181-1/+6
| | | | | | | code when we are printing the name of an Objective-C method whose class has not been declared. Fixes <rdar://problem/7495713>. llvm-svn: 98874
* Some cleanup, change diagnostic when assigning toFariborz Jahanian2010-03-181-5/+3
| | | | | | a property which is not lvalue. llvm-svn: 98848
* objective-c patch to provide type safty when blocks are passing orFariborz Jahanian2010-03-171-7/+59
| | | | | | | returning objc objects. There will be a corresponding objective-c++ patch soon. llvm-svn: 98696
* Implement -Wshadow. Based on a patch by Mike M.!John McCall2010-03-161-1/+4
| | | | llvm-svn: 98684
* Let SourceManager::getBufferData return StringRef instead of a pair of two ↵Benjamin Kramer2010-03-161-2/+2
| | | | | | const char*. llvm-svn: 98630
* Use SourceManager's Diagnostic object for all file-reading errors,Douglas Gregor2010-03-161-1/+1
| | | | | | simplifying the SourceManager interfaces somewhat. llvm-svn: 98598
* Give SourceManager a Diagnostic object with which to report errors,Douglas Gregor2010-03-161-10/+12
| | | | | | and start simplifying the interfaces in SourceManager that can fail. llvm-svn: 98594
* Introduce a new BufferResult class to act as the return type ofDouglas Gregor2010-03-151-9/+15
| | | | | | | | | | | | | | SourceManager's getBuffer() (and similar) operations. This abstract can be used to force callers to cope with errors in getBuffer(), such as missing files and changed files. Fix a bunch of callers to use the new interface. Add some very basic checks for file consistency (file size, modification time) into ContentCache::getBuffer(), although these checks don't help much until we've updated the main callers (e.g., SourceManager::getSpelling()). llvm-svn: 98585
* Move method FindPropertyVisibleInPrimaryClass() from ObjCContainerDecl to ↵Ted Kremenek2010-03-151-10/+9
| | | | | | | | ObjCInterfaceDecl. Also change this method to lookup property declarations using DeclContext::lookup(). llvm-svn: 98574
* Change ObjCCategoryDecl::FindPropertyDeclaration() to lookupTed Kremenek2010-03-151-33/+42
| | | | | | property decls using DeclContext::lookup(). llvm-svn: 98571
OpenPOWER on IntegriCloud