summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Be sure to zero-extend. And refactor.Mike Stump2009-10-261-6/+1
| | | | llvm-svn: 85140
* __builtin_object_size refinements. WIP.Mike Stump2009-10-261-0/+30
| | | | llvm-svn: 85136
* Update location of DataTypes.h to reflect move in LLVM with r85086.Chandler Carruth2009-10-261-1/+1
| | | | llvm-svn: 85087
* Audit the code for places where it is assumed that every base specifier ↵Sebastian Redl2009-10-252-16/+32
| | | | | | refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector. llvm-svn: 85055
* Switch alloca/sprintf to SmallString/raw_ostream.Benjamin Kramer2009-10-241-9/+10
| | | | llvm-svn: 84996
* Preserve type source information in TypedefDecls. Preserve it acrossJohn McCall2009-10-241-3/+3
| | | | | | | | | template instantiation. Preserve it through PCH. Show it off to the indexer. I'm healthily ignoring the vector type cases because we don't have a sensible TypeLoc implementation for them anyway. llvm-svn: 84994
* Fix overload resolution when calling a member template or taking theDouglas Gregor2009-10-241-0/+12
| | | | | | | address of a member template when explicit template arguments are provided. llvm-svn: 84991
* Make the local buffer overflow safe.Fariborz Jahanian2009-10-241-8/+6
| | | | llvm-svn: 84981
* Fixe a buffer overflow problem which causes a crashFariborz Jahanian2009-10-231-2/+6
| | | | | | | in a certain project. Need to have a permananent fix later (FIXME added). llvm-svn: 84980
* Store the builtin types as CanQualTypes. Expand a bit on the CanQual API,John McCall2009-10-231-5/+5
| | | | | | | but also remove some methods that cause ambiguities, and generally make CanQual<blah> more analogous to QualType. llvm-svn: 84976
* Correct a comment.Sebastian Redl2009-10-231-1/+1
| | | | llvm-svn: 84973
* Remove OriginalTypeParmDecl; the original type is the one specifiedJohn McCall2009-10-233-22/+1
| | | | | | | | | | | | | in the DeclaratorInfo, if one is present. Preserve source information through template instantiation. This is made more complicated by the possibility that ParmVarDecls don't have DIs, which is possibly worth fixing in the future. Also preserve source information for function parameters in ObjC method declarations. llvm-svn: 84971
* Add ASTContext::getTrivialDeclaratorInfo, which initializes a newJohn McCall2009-10-231-0/+7
| | | | | | source info block with a single location. llvm-svn: 84970
* Eliminate QualifiedDeclRefExpr, which captured the notion of aDouglas Gregor2009-10-233-17/+96
| | | | | | | | | | | | | | | | | | | | | | | | qualified reference to a declaration that is not a non-static data member or non-static member function, e.g., namespace N { int i; } int j = N::i; Instead, extend DeclRefExpr to optionally store the qualifier. Most clients won't see or care about the difference (since QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the number of top-level expression types that clients need to cope with, brings the implementation of DeclRefExpr into line with MemberExpr, and simplifies and unifies our handling of declaration references. Extended DeclRefExpr to (optionally) store explicitly-specified template arguments. This occurs when naming a declaration via a template-id (which will be stored in a TemplateIdRefExpr) that, following template argument deduction and (possibly) overload resolution, is replaced with a DeclRefExpr that refers to a template specialization but maintains the template arguments as written. llvm-svn: 84962
* When building types from declarators, instead of building two types (one forJohn McCall2009-10-222-89/+91
| | | | | | | | | | | | | | | | | | | | | the DeclaratorInfo, one for semantic analysis), just build a single type whose canonical type will reflect the semantic analysis (assuming the type is well-formed, of course). To make that work, make a few changes to the type system: * allow the nominal pointee type of a reference type to be a (possibly sugared) reference type. Also, preserve the original spelling of the reference type. Both of these can be ignored on canonical reference types. * Remove ObjCProtocolListType and preserve the associated source information on the various ObjC TypeLocs. Preserve the spelling of protocol lists except in the canonical form. * Preserve some level of source type structure on parameter types, but canonicalize on the canonical function type. This is still a WIP. Drops code size, makes strides towards accurate source location representation, slight (~1.7%) progression on Cocoa.h because of complexity drop. llvm-svn: 84907
* Canonicality is a property of qualified types, not unqualified types.John McCall2009-10-223-18/+18
| | | | llvm-svn: 84891
* fix PR5265: the size of a float3 should be rounded up to its alignment. Chris Lattner2009-10-221-10/+11
| | | | | | This ensures that arrays of float3 are correctly padded. llvm-svn: 84833
* Extend out the block descriptor structure for debug information withMike Stump2009-10-221-3/+54
| | | | | | the copy/dispose helpers as appropriate. llvm-svn: 84817
* Refine collection of BlockDeclRefExprs. WIP.Mike Stump2009-10-211-2/+2
| | | | llvm-svn: 84787
* Complete out debug info generation for captured __block variables. WIP.Mike Stump2009-10-211-7/+63
| | | | llvm-svn: 84768
* Prep work to always preallocate BlockDeclRefExprs so that we canMike Stump2009-10-211-32/+39
| | | | | | | generate the debug information for the first parameter to the block invoke functions. WIP. llvm-svn: 84737
* Add TypeLocBuilder, an API for incrementally creating TypeLocs. ChangeJohn McCall2009-10-211-2/+8
| | | | | | | the API for creating DeclaratorInfos to allow callers to provide an exact size. llvm-svn: 84715
* Refine the type of the first parameter to block invoke functions.Mike Stump2009-10-201-1/+108
| | | | | | | WIP. I have yet to find the magic incantation to get the structure type to be defined. If someone has a pointer, love to hear it. llvm-svn: 84590
* Suppress build warning.Daniel Dunbar2009-10-191-1/+1
| | | | llvm-svn: 84453
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-184-5/+6
| | | | | | are updated. llvm-svn: 84447
* Move misc clients to IdentifierInfo StringRef API.Daniel Dunbar2009-10-182-4/+4
| | | | | | | | | - strcmp -> == - OS.write(II->getName() ...) -> OS << II->getNameStr() - Avoid std::string concatenation - Use getNameStr().str() when an std::string is really needed. llvm-svn: 84437
* Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar2009-10-184-8/+10
| | | | llvm-svn: 84436
* Add FloatingCast to getCastKindName's list.Benjamin Kramer2009-10-181-0/+2
| | | | llvm-svn: 84427
* Add some more cast kinds.Anders Carlsson2009-10-181-0/+6
| | | | llvm-svn: 84423
* When performing template-substitution into a type, don't just replace theJohn McCall2009-10-182-0/+33
| | | | | | | | | | | | | | | | | | TemplateTypeParmType with the substituted type directly; instead, replace it with a SubstTemplateTypeParmType which will note that the type was originally written as a template type parameter. This makes it reasonable to preserve source information even through template substitution. Also define the new SubstTemplateTypeParmType class, obviously. For consistency with current behavior, we stringize these types as if they were the underlying type. I'm not sure this is the right thing to do. At any rate, I paled at adding yet another clause to the don't-desugar 'if' statement, so I extracted a function to do it. The new function also does The Right Thing more often, I think: e.g. if we have a chain of typedefs leading to a vector type, we will now desugar all but the last one. llvm-svn: 84412
* Switch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.Daniel Dunbar2009-10-181-8/+8
| | | | | | - Really this should be simplified by the FIXME above, but I'm too deep in DFS. llvm-svn: 84392
* Add FIXME... maybe Nate will get bored? :)Daniel Dunbar2009-10-181-0/+2
| | | | llvm-svn: 84389
* Clone the full Type hierarchy into the TypeLoc hierarchy. NormalizeJohn McCall2009-10-182-174/+47
| | | | | | | | | | | | | TypeLoc class names to be $(Type classname)Loc. Rewrite the visitor. Provide skeleton implementations for all the new TypeLocs. Handle all cases in PCH. Handle a few more cases when inserting location information in SemaType. It should be extremely straightforward to add new location information to existing TypeLoc objects now. llvm-svn: 84386
* Simplify ExtVectorElementExpr::containsDuplicateElements().Daniel Dunbar2009-10-171-13/+7
| | | | llvm-svn: 84380
* teach getCorrespondingUnsignedType how to handle vectors of integers,Chris Lattner2009-10-171-4/+12
| | | | | | fixing PR4838. llvm-svn: 84353
* Write the preprocessor block after we write out types + declarations,Douglas Gregor2009-10-171-1/+1
| | | | | | | | so that we catch any macros used within the declarations and types. Also, properly store a NULL selector. llvm-svn: 84334
* While writing source-location entries to a PCH file, go through anDouglas Gregor2009-10-161-1/+1
| | | | | | | interface that can load those source-location entries on demand (from another PCH file). llvm-svn: 84287
* Allow TypeLocs to be fully initialized with a single SourceLocation. ThisJohn McCall2009-10-161-12/+27
| | | | | | will be the keystone of converting existing rewrites to be rewrites on TypeLocs. llvm-svn: 84286
* Add CK_VectorSplat and use it for casting non-pointer scalars to ExtVectors.Anders Carlsson2009-10-161-0/+2
| | | | llvm-svn: 84245
* Add a ToVoid cast kind and start using it.Anders Carlsson2009-10-161-0/+2
| | | | llvm-svn: 84241
* Remove the ConstantArrayType subtypes. This information is preserved in theJohn McCall2009-10-162-86/+0
| | | | | | | | | | TypeLoc records for declarations; it should not be necessary to represent it directly in the type system. Please complain if you were using these classes and feel you can't replicate previous functionality using the TypeLoc API. llvm-svn: 84222
* Simplify checking of explicit template specialization/explicitDouglas Gregor2009-10-151-6/+32
| | | | | | | | | instantiation redeclaration semantics for function template specializations and member functions of class template specializations. Also, record the point of instantiation for explicit-instantiated functions and static data members. llvm-svn: 84188
* Better living through metaprogramming. Create a base class which abstractsJohn McCall2009-10-151-184/+29
| | | | | | | | | | | most of the unsafe boilerplate out of TypeLoc. Create a QualifiedLoc class to represent the idea that we *might* start representing source locations of qualifiers. Dealing with qualifiers explicitly like this also lets us efficiently ignore them in all the concrete cases. This should make it obvious and easy to add new TypeLoc subclasses. llvm-svn: 84168
* Give explicit and implicit instantiations of static data members ofDouglas Gregor2009-10-141-3/+18
| | | | | | | | class templates the proper linkage. Daniel, please look over the CodeGenModule bits. llvm-svn: 84140
* Testing and some minor fixes for explicit template instantiation.Douglas Gregor2009-10-142-3/+3
| | | | llvm-svn: 84129
* Member function templates (and instantiations/specializations thereof)Douglas Gregor2009-10-131-2/+10
| | | | | | are never copy constructors or copy assignment operators. llvm-svn: 84057
* fix test/CodeGen/statements.c on 32-bit hosts.Chris Lattner2009-10-131-0/+7
| | | | llvm-svn: 84039
* When explicitly specializing a member that is a template, mark theDouglas Gregor2009-10-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | template as a specialization. For example, this occurs with: template<typename T> struct X { template<typename U> struct Inner { /* ... */ }; }; template<> template<typename T> struct X<int>::Inner { T member; }; We need to treat templates that are member specializations as special in two contexts: - When looking for a definition of a member template, we look through the instantiation chain until we hit the primary template *or a member specialization*. This allows us to distinguish between the primary "Inner" definition and the X<int>::Inner definition, above. - When computing all of the levels of template arguments needed to instantiate a member template, don't add template arguments from contexts outside of the instantiation of a member specialization, since the user has already manually substituted those arguments. Fix up the existing test for p18, which was actually wrong (but we didn't diagnose it because of our poor handling of member specializations of templates), and add a new test for member specializations of templates. llvm-svn: 83974
* Teach sema and codegen about the difference between address of labels,Chris Lattner2009-10-131-2/+11
| | | | | | | | | | which is a common idiom to improve PIC'ness of code using the addr of label extension. This implementation is a gross hack, but the only other alternative would be to teach evalutate about this horrid combination. While GCC allows things like "&&foo - &&bar + 1", people don't use this in practice. This implements PR5131. llvm-svn: 83957
* make the diagnostic in the 'unused result' warning more preciseChris Lattner2009-10-131-13/+14
| | | | | | about the reason, rdar://7186119. llvm-svn: 83940
OpenPOWER on IntegriCloud