diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-12-30 03:24:14 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-12-30 03:24:14 +0000 |
commit | 21c9060e61e265b925a20930687b99f721fb11f6 (patch) | |
tree | d736f9b47556e6f8b57e92159db50c8846426906 /clang/lib/AST/DeclCXX.cpp | |
parent | 6c6c78ff18318240d6a183b774d58b97025e104a (diff) | |
download | bcm5719-llvm-21c9060e61e265b925a20930687b99f721fb11f6.tar.gz bcm5719-llvm-21c9060e61e265b925a20930687b99f721fb11f6.zip |
[ptr-traits] Move methods manipulating PointerUnions, DenseMap pointer
keys, and PointerIntPairs where the pointee types are incomplete
out-of-line to where we have the complete type.
This is the standard pattern used throughout the AST library to address
the inherently mutually cross referenced nature of the AST.
This is part of a series of patches to allow LLVM to check for complete
pointee types when computing its pointer traits. This is absolutely
necessary to get correct (or reproducible) results for things like how
many low bits are guaranteed to be zero.
llvm-svn: 256612
Diffstat (limited to 'clang/lib/AST/DeclCXX.cpp')
-rw-r--r-- | clang/lib/AST/DeclCXX.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclCXX.cpp b/clang/lib/AST/DeclCXX.cpp index 71bc247a007..4f24fdc28f7 100644 --- a/clang/lib/AST/DeclCXX.cpp +++ b/clang/lib/AST/DeclCXX.cpp @@ -1218,6 +1218,10 @@ CXXRecordDecl *CXXRecordDecl::getInstantiatedFromMemberClass() const { return nullptr; } +MemberSpecializationInfo *CXXRecordDecl::getMemberSpecializationInfo() const { + return TemplateOrInstantiation.dyn_cast<MemberSpecializationInfo *>(); +} + void CXXRecordDecl::setInstantiationOfMemberClass(CXXRecordDecl *RD, TemplateSpecializationKind TSK) { @@ -1228,6 +1232,14 @@ CXXRecordDecl::setInstantiationOfMemberClass(CXXRecordDecl *RD, = new (getASTContext()) MemberSpecializationInfo(RD, TSK); } +ClassTemplateDecl *CXXRecordDecl::getDescribedClassTemplate() const { + return TemplateOrInstantiation.dyn_cast<ClassTemplateDecl *>(); +} + +void CXXRecordDecl::setDescribedClassTemplate(ClassTemplateDecl *Template) { + TemplateOrInstantiation = Template; +} + TemplateSpecializationKind CXXRecordDecl::getTemplateSpecializationKind() const{ if (const ClassTemplateSpecializationDecl *Spec = dyn_cast<ClassTemplateSpecializationDecl>(this)) @@ -2016,6 +2028,22 @@ NamespaceDecl *NamespaceDecl::CreateDeserialized(ASTContext &C, unsigned ID) { SourceLocation(), nullptr, nullptr); } +NamespaceDecl *NamespaceDecl::getOriginalNamespace() { + if (isFirstDecl()) + return this; + + return AnonOrFirstNamespaceAndInline.getPointer(); +} + +const NamespaceDecl *NamespaceDecl::getOriginalNamespace() const { + if (isFirstDecl()) + return this; + + return AnonOrFirstNamespaceAndInline.getPointer(); +} + +bool NamespaceDecl::isOriginalNamespace() const { return isFirstDecl(); } + NamespaceDecl *NamespaceDecl::getNextRedeclarationImpl() { return getNextRedeclaration(); } |