Commit Graph

1427 Commits

Author SHA1 Message Date
Douglas Gregor f9bd4ecea2 Fix canonical type construction for function types with the noreturn
attribute. Fixes PR4865.

llvm-svn: 78224
2009-08-05 19:03:35 +00:00
Douglas Gregor 2211d345d2 Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.

llvm-svn: 78164
2009-08-05 05:36:45 +00:00
Fariborz Jahanian 800f37262c Support for use of default argument in constructors.
work in progress.

llvm-svn: 78132
2009-08-05 00:26:10 +00:00
Douglas Gregor 9dc8bd327f Keep track of the template arguments deduced when matching a class
template partial specialization. Then, use those template arguments
when instantiating members of that class template partial
specialization. Fixes PR4607.

llvm-svn: 77925
2009-08-02 23:24:31 +00:00
Daniel Dunbar a4a341b9b0 Compute end_overridden_methods in a way that keeps ENABLE_EXPENSIVE_CHECKS
happy.

llvm-svn: 77850
2009-08-02 01:48:29 +00:00
Daniel Dunbar 36741c8a29 Avoid accessing invalid std::vector element; this makes clang
ENABLE_EXPENSIVE_CHECKS clean on x86_64-.*-darwin10.

llvm-svn: 77831
2009-08-01 23:40:20 +00:00
Mike Stump bc78a728ee Add code to setup the vtable pointer in the constructor. Work in progress.
llvm-svn: 77699
2009-07-31 18:25:34 +00:00
Douglas Gregor 1d1d16c43e Make canonicalization of overloaded function declarations match the
Itanium C++ ABI's name mangling, since both are related to the notion
of "equivalent" function templates.

llvm-svn: 77678
2009-07-31 16:07:31 +00:00
Douglas Gregor c97f09f565 Canonicalize template template parameters. We can't test this yet, but
it's "obviously correct" :) 

llvm-svn: 77677
2009-07-31 15:46:56 +00:00
Douglas Gregor 70317123c9 Canonicalize function parameters
llvm-svn: 77676
2009-07-31 15:45:02 +00:00
Douglas Gregor 802a030d6e Canonicalization and profiling for overloaded function declarations,
for those extra-esoteric cases. Not that any two given C++ compilers
agree on this test case, but this change gives us a strong definition
of equivalent types.

llvm-svn: 77664
2009-07-31 05:24:01 +00:00
Douglas Gregor 352169aed4 Canonicalize dependent extended vector types.
llvm-svn: 77663
2009-07-31 03:54:25 +00:00
Mike Stump e9c6ffc7d1 Whitespace around else canonicalization and fix 80-col violations.
llvm-svn: 77655
2009-07-31 02:02:20 +00:00
Douglas Gregor f3f955279b Build canonical types for dependently-sized array types.
llvm-svn: 77647
2009-07-31 00:23:35 +00:00
Douglas Gregor a21f6c3c71 Canonicalization of dependent C++0x decltype types.
llvm-svn: 77643
2009-07-30 23:36:40 +00:00
Douglas Gregor a5dd9f858f Canonicalization for dependent typeof(expr) types.
llvm-svn: 77639
2009-07-30 23:18:24 +00:00
Mike Stump 57724c2f7e Update based upon comments. Explain why we have an assert.
llvm-svn: 77612
2009-07-30 18:01:44 +00:00
Mike Stump 44b8e90369 We'll also need a vtable pointer if we have virtual bases.
llvm-svn: 77610
2009-07-30 17:53:53 +00:00
Douglas Gregor 1530138fd0 Support out-of-line definitions of the members of class template
partial specializations.

llvm-svn: 77606
2009-07-30 17:40:51 +00:00
Mike Stump 776d3401d2 Fix type to be consistent with the rest of the code.
llvm-svn: 77560
2009-07-30 01:02:10 +00:00
Mike Stump 3dc7eb9440 Add ability to layout the vtable pointer in trivial cases. I noticed
that we would silently do bad things with virtual bases in the layout
code, so, we just turn them off.  When people do better things with
them, we can turn them back on.

llvm-svn: 77556
2009-07-30 00:22:38 +00:00
Douglas Gregor 82c80a59ee There's no point in going through the getAs<TagType> stuff to find the definition of a tag, since tags rarely have more than one or two declarations
llvm-svn: 77546
2009-07-29 23:41:44 +00:00
Douglas Gregor b6b8f9e291 Make tag declarations redeclarable. This change has three purposes:
1) Allow the Index library (and any other interested client) to walk
  the set of declarations for a given tag (enum, union, class,
  whatever). At the moment, this information is not readily available.

  2) Reduce our dependence on TagDecl::TypeForDecl being mapped down
  to a TagType (for which getDecl() will return the tag definition, if
  one exists). This property won't exist for class template partial
  specializations.

  3) Make the canonical declaration of a TagDecl actually canonical,
  e.g., so that it does not change when the tag is defined.

llvm-svn: 77523
2009-07-29 23:36:44 +00:00
Ted Kremenek c23c7e6a51 Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsRecordType() -> Type::getAs<RecordType>()
  Type::getAsPointerType() -> Type::getAs<PointerType>()
  Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
  Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
  Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
  Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
  Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
  Type::getAsTagType() -> Type::getAs<TagType>()
  
And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.

llvm-svn: 77510
2009-07-29 21:53:49 +00:00
Fariborz Jahanian 7be1ad814b No longer need to keep base class offsets in the offset
table as it has its own place now.

llvm-svn: 77491
2009-07-29 18:50:06 +00:00
Douglas Gregor aa87ebc0c1 [llvm up]
A template name can refer to a set of overloaded function
templates. Model this in TemplateName, which can now refer to an
OverloadedFunctionDecl that contains function templates. This removes
an unspeakable hack in Sema::isTemplateName.

llvm-svn: 77488
2009-07-29 18:26:50 +00:00
Douglas Gregor 0004417e81 Use the new statement/expression profiling code to unique dependent
template arguments, as in template specialization types. This permits
matching out-of-line definitions of members for class templates that
involve non-type template parameters.

llvm-svn: 77462
2009-07-29 16:09:57 +00:00
Fariborz Jahanian 82e2874270 Code refactoring to define getCXXRecordDeclForPointerType
and use it in several places.

llvm-svn: 77411
2009-07-29 00:44:13 +00:00
Mike Stump 93246cc475 Some minor cleanups, thanks Chris.
llvm-svn: 77402
2009-07-28 23:57:15 +00:00
Mike Stump 2adb4dab54 Some style fixes, thanks Chris.
llvm-svn: 77400
2009-07-28 23:47:15 +00:00
Douglas Gregor a8e02e7863 Refactor the code that produces a TemplateSpecializationType, so that
canonicalization for dependent TemplateSpecializationTypes occurs
within ASTContext::getTemplateSpecializationType. Also, move template
argument canonicalization into ASTContext::getCanonicalTemplateArgument.

llvm-svn: 77388
2009-07-28 23:00:59 +00:00
Chris Lattner a58b3af802 remove extraneous braces
llvm-svn: 77386
2009-07-28 22:49:34 +00:00
Anders Carlsson fc8cfa8b9f Add a field for C++ specific data to ASTRecordLayout. Use it to store the non-virtual size and alignment + base offsets.
llvm-svn: 77352
2009-07-28 19:24:15 +00:00
Chris Lattner 2706a55071 fix PR4633: cast to void should silence the 'unused expression' warning.
llvm-svn: 77344
2009-07-28 18:25:28 +00:00
Douglas Gregor 32615a13f4 Fix a typo in a comment
llvm-svn: 77324
2009-07-28 16:39:25 +00:00
Douglas Gregor d9aedfaa5a Profiling the pointer of a canonical type is sufficient to uniquely identify the type
llvm-svn: 77321
2009-07-28 15:32:17 +00:00
Douglas Gregor 4488259d40 Finish profile support for statements.
llvm-svn: 77320
2009-07-28 15:27:13 +00:00
Douglas Gregor a709509f96 Complete profile support for C++ and Objective-C expressions
llvm-svn: 77318
2009-07-28 14:44:31 +00:00
Daniel Dunbar ec5ae3d75a CallExpr's SubExprs sometimes were allocated in the wrong place.
llvm-svn: 77302
2009-07-28 06:29:46 +00:00
John McCall 7be52a8179 Reimplement QualifierSet using a single word, as requested by dgregor.
llvm-svn: 77299
2009-07-28 05:41:20 +00:00
Argyrios Kyrtzidis f390c43c3c Implement ObjCMethodDecl::getCanonicalDecl().
llvm-svn: 77298
2009-07-28 05:11:17 +00:00
Argyrios Kyrtzidis a56fa19ac6 -Add ObjCCategoryImplDecl::getCategoryClass() which returns the category interface decl.
-Correct ObjCMethodDecl::getNextRedeclaration(); A method in a ObjCCategoryImplDecl should point to
a method in the associated ObjCCategoryDecl, not the ObjCInterfaceDecl.

llvm-svn: 77297
2009-07-28 05:11:05 +00:00
Argyrios Kyrtzidis 2cee40daa7 Use ObjCImplDecl in place of ObjCCategoryImplDecl/ObjCImplementationDecl.
llvm-svn: 77296
2009-07-28 05:10:52 +00:00
Mike Stump a4de80b8b1 Make longjmp a real builtin.
llvm-svn: 77291
2009-07-28 02:25:19 +00:00
Douglas Gregor 5c193b9e18 Add a Profile function for statements so that we can (eventually) determine
when statements and expressions are equivalent.

llvm-svn: 77284
2009-07-28 00:33:38 +00:00
Mike Stump 31d9254f7a Ensure we can work through typedefs.
llvm-svn: 77265
2009-07-27 22:25:19 +00:00
Mike Stump 9a9e0c2b17 Add builtin knowledge about longjmp being noreturn. Add printing for
the noreturn attribute.

llvm-svn: 77253
2009-07-27 21:33:40 +00:00
Argyrios Kyrtzidis 067c407c48 Make ObjCImplDecl inherit from ObjCContainerDecl.
ObjCContainerDecl now is the root class for objc decls that contain methods.

llvm-svn: 77235
2009-07-27 19:04:32 +00:00
Mike Stump 21e0f895a1 Fix PR4624.
llvm-svn: 77176
2009-07-27 00:44:23 +00:00
Mike Stump ea086c7263 Preserve qualifiers.
llvm-svn: 77097
2009-07-25 23:24:03 +00:00