summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* remove some extraneous qualifiers.Chris Lattner2010-04-201-2/+2
| | | | llvm-svn: 101912
* Keep track of the actual storage specifier written on a variable orDouglas Gregor2010-04-193-16/+21
| | | | | | | | function declaration, since it may end up being changed (e.g., "extern" can become "static" if a prior declaration was static). Patch by Enea Zaffanella and Paolo Bolzoni. llvm-svn: 101826
* AST: Dump ASTRecordLayout objects when they are created with ↵Daniel Dunbar2010-04-192-12/+30
| | | | | | -fdump-record-layouts. llvm-svn: 101815
* Fix -Wcast-qual warnings.Dan Gohman2010-04-193-3/+5
| | | | llvm-svn: 101786
* If a wide bit-field is inside a union its offset should always be 0.Anders Carlsson2010-04-171-4/+7
| | | | llvm-svn: 101668
* Add printName to DeclarationName which prints the human-readable name on aBenjamin Kramer2010-04-172-30/+35
| | | | | | raw_ostream. Use it in getAsString and NamedDecl's raw_ostream operator. llvm-svn: 101633
* Add raw_ostream operators to NamedDecl for convenience. Switch over all ↵Benjamin Kramer2010-04-178-67/+69
| | | | | | | | users of getNameAsString on a stream. The next step is to print the name directly into the stream, avoiding a temporary std::string copy. llvm-svn: 101632
* make our existing "switch on bool" warning work for C. SinceChris Lattner2010-04-161-0/+59
| | | | | | | the result of comparisons are 'int' in C, it doesn't work to test just the result type of the expression. llvm-svn: 101576
* Remove printfs.Anders Carlsson2010-04-161-6/+0
| | | | llvm-svn: 101470
* More work on wide bit-fields, WIP.Anders Carlsson2010-04-162-0/+66
| | | | llvm-svn: 101467
* Rename the ASTContext member 'Context'.Anders Carlsson2010-04-162-35/+35
| | | | llvm-svn: 101462
* Split adding the primary virtual base offsets out into a separate pass. This ↵Anders Carlsson2010-04-152-35/+71
| | | | | | fixes a bug where we would lay out virtual bases in the wrong order. llvm-svn: 101373
* Tweak spelling (Bitfield -> BitField)Daniel Dunbar2010-04-151-1/+1
| | | | llvm-svn: 101369
* Add TargetInfo::useBitfieldTypeAlignment().Daniel Dunbar2010-04-151-4/+3
| | | | | | | | | | | | | | | - Used to determine whether the alignment of the type in a bit-field is respected when laying out structures. The default is true, targets can override this as needed. - This is designed to correspond to the PCC_BITFIELD_TYPE_MATTERS macro in gcc. The AST/Sema implementation only affects one line, unless I have forgotten something. I'd appreciate further review. - IRgen still needs to be updated to fully support this (which is effectively PR5591). llvm-svn: 101356
* Add encoding of reference types like gcc does for objc methods andFariborz Jahanian2010-04-131-3/+8
| | | | | | blocks. Fixes PR6468. llvm-svn: 101196
* Use ASTVector instead of std::vector for the Exprs in InitListExpr. PerformanceTed Kremenek2010-04-131-9/+10
| | | | | | | measurements of '-fsyntax-only' on combine.c (403.gcc) shows no real performance change, but now the vector isn't leaked. llvm-svn: 101195
* Fix an embarrasing memory error. I was apparently very tired when I wrote thisJohn McCall2010-04-131-1/+1
| | | | | | | | code the first time. Fixes PR6827. llvm-svn: 101184
* Remove unnecessary cast.Daniel Dunbar2010-04-131-1/+1
| | | | llvm-svn: 101176
* Teach HasSideEffect about InitListExprs. Not havingChris Lattner2010-04-131-0/+7
| | | | | | | | | | | | | this caused us to codegen dead globals like this: struct foo { int a; int b; }; static struct foo fooarray[] = { {1, 2}, {4}, }; llvm-svn: 101150
* Have the CXXBaseOrMemberInitializer keep track of whether an initializer ↵Anders Carlsson2010-04-121-2/+2
| | | | | | initializes a virtual base or not. llvm-svn: 101004
* Fix another vbase layout bug.Anders Carlsson2010-04-101-1/+5
| | | | llvm-svn: 100952
* Add a simple debug-only verification pass to the record layout builder.Anders Carlsson2010-04-101-0/+25
| | | | llvm-svn: 100951
* Simplify the virtual base layout code and fix a bug where we wouldn't store ↵Anders Carlsson2010-04-101-24/+25
| | | | | | the offset for a virtual base. llvm-svn: 100940
* Fixes a regression caused by implementing cstyle methods Fariborz Jahanian2010-04-091-1/+2
| | | | | | for objc. llvm-svn: 100865
* 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
OpenPOWER on IntegriCloud