diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-07 06:41:52 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-07 06:41:52 +0000 |
commit | 25a3ef7cc5fd55dc8cc67c6e6770c8595657e082 (patch) | |
tree | 9d0b8da3f04c8523d04d964c5fad080a3889cc5a /include/clang | |
parent | 4d3cbf0335dc43a281377052afa180af28f39e7f (diff) |
Start canonicalizing template names. This is not yet complete, but it
improves type identity with dependent types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/AST/ASTContext.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index 800fb5b0d0..8199affc83 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -604,6 +604,26 @@ public: NestedNameSpecifier * getCanonicalNestedNameSpecifier(NestedNameSpecifier *NNS); + /// \brief Retrieves the "canonical" template name that refers to a + /// given template. + /// + /// The canonical template name is the simplest expression that can + /// be used to refer to a given template. For most templates, this + /// expression is just the template declaration itself. For example, + /// the template std::vector can be referred to via a variety of + /// names---std::vector, ::std::vector, vector (if vector is in + /// scope), etc.---but all of these names map down to the same + /// TemplateDecl, which is used to form the canonical template name. + /// + /// Dependent template names are more interesting. Here, the + /// template name could be something like T::template apply or + /// std::allocator<T>::template rebind, where the nested name + /// specifier itself is dependent. In this case, the canonical + /// template name uses the shortest form of the dependent + /// nested-name-specifier, which itself contains all canonical + /// types, values, and templates. + TemplateName getCanonicalTemplateName(TemplateName Name); + /// Type Query functions. If the type is an instance of the specified class, /// return the Type pointer for the underlying maximally pretty type. This /// is a member of ASTContext because this may need to do some amount of |