diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-03-30 22:58:21 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-03-30 22:58:21 +0000 |
| commit | dc572a326610eaf0972ece1790f61e5b6404727e (patch) | |
| tree | 0f0b61400e94133bf93faefaff187749159c3a6c /clang/lib/CodeGen | |
| parent | adccd30533683045338fa4af186245638da0e17a (diff) | |
| download | bcm5719-llvm-dc572a326610eaf0972ece1790f61e5b6404727e.tar.gz bcm5719-llvm-dc572a326610eaf0972ece1790f61e5b6404727e.zip | |
Improve the representation of template names in the AST. This
representation handles the various ways in which one can name a
template, including unqualified references ("vector"), qualified
references ("std::vector"), and dependent template names
("MetaFun::template apply").
One immediate effect of this change is that the representation of
nested-name-specifiers in type names for class template
specializations (e.g., std::vector<int>) is more accurate. Rather than
representing std::vector<int> as
std::(vector<int>)
we represent it as
(std::vector)<int>
which more closely follows the C++ grammar.
Additionally, templates are no longer represented as declarations
(DeclPtrTy) in Parse-Sema interactions. Instead, I've introduced a new
OpaquePtr type (TemplateTy) that holds the representation of a
TemplateName. This will simplify the handling of dependent
template-names, once we get there.
llvm-svn: 68074
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenTypes.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 7233bbf8e23..bde6fba137f 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -561,7 +561,7 @@ llvm::DIType CGDebugInfo::getOrCreateType(QualType Ty, case Type::FixedWidthInt: case Type::BlockPointer: case Type::MemberPointer: - case Type::ClassTemplateSpecialization: + case Type::TemplateSpecialization: case Type::QualifiedName: case Type::ObjCQualifiedClass: // Unsupported types diff --git a/clang/lib/CodeGen/CodeGenTypes.cpp b/clang/lib/CodeGen/CodeGenTypes.cpp index 85d7384c6c7..5367c71b2cf 100644 --- a/clang/lib/CodeGen/CodeGenTypes.cpp +++ b/clang/lib/CodeGen/CodeGenTypes.cpp @@ -392,6 +392,9 @@ const llvm::Type *CodeGenTypes::ConvertNewType(QualType T) { // http://gcc.gnu.org/onlinedocs/gccint/Type-Layout.html#Type-Layout assert(0 && "FIXME: We can't handle member pointers yet."); return llvm::OpaqueType::get(); + + case Type::TemplateSpecialization: + assert(false && "Dependent types can't get here"); } // FIXME: implement. |

