diff options
Diffstat (limited to 'contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h')
-rw-r--r-- | contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h | 85 |
1 files changed, 41 insertions, 44 deletions
diff --git a/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h b/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h index d991c73..f28882b 100644 --- a/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h +++ b/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h @@ -14,8 +14,6 @@ #define LLVM_CLANG_AST_DECLARATIONNAME_H #include "clang/Basic/IdentifierTable.h" -#include "clang/AST/Type.h" -#include "clang/AST/CanonicalType.h" #include "clang/Basic/PartialDiagnostic.h" #include "llvm/Support/Compiler.h" @@ -24,14 +22,20 @@ namespace llvm { } namespace clang { - class CXXSpecialName; - class CXXOperatorIdName; + class ASTContext; class CXXLiteralOperatorIdName; + class CXXOperatorIdName; + class CXXSpecialName; class DeclarationNameExtra; class IdentifierInfo; class MultiKeywordSelector; - class UsingDirectiveDecl; + class QualType; + class Type; class TypeSourceInfo; + class UsingDirectiveDecl; + + template <typename> class CanQual; + typedef CanQual<Type> CanQualType; /// DeclarationName - The name of a declaration. In the common case, /// this just stores an IdentifierInfo pointer to a normal @@ -349,23 +353,15 @@ public: /// getCXXConstructorName - Returns the name of a C++ constructor /// for the given Type. - DeclarationName getCXXConstructorName(CanQualType Ty) { - return getCXXSpecialName(DeclarationName::CXXConstructorName, - Ty.getUnqualifiedType()); - } + DeclarationName getCXXConstructorName(CanQualType Ty); /// getCXXDestructorName - Returns the name of a C++ destructor /// for the given Type. - DeclarationName getCXXDestructorName(CanQualType Ty) { - return getCXXSpecialName(DeclarationName::CXXDestructorName, - Ty.getUnqualifiedType()); - } + DeclarationName getCXXDestructorName(CanQualType Ty); /// getCXXConversionFunctionName - Returns the name of a C++ /// conversion function for the given Type. - DeclarationName getCXXConversionFunctionName(CanQualType Ty) { - return getCXXSpecialName(DeclarationName::CXXConversionFunctionName, Ty); - } + DeclarationName getCXXConversionFunctionName(CanQualType Ty); /// getCXXSpecialName - Returns a declaration name for special kind /// of C++ name, e.g., for a constructor, destructor, or conversion @@ -386,32 +382,35 @@ public: /// for a declaration name. Needs a DeclarationName in order /// to be interpreted correctly. struct DeclarationNameLoc { + // The source location for identifier stored elsewhere. + // struct {} Identifier; + + // Type info for constructors, destructors and conversion functions. + // Locations (if any) for the tilde (destructor) or operator keyword + // (conversion) are stored elsewhere. + struct NT { + TypeSourceInfo* TInfo; + }; + + // The location (if any) of the operator keyword is stored elsewhere. + struct CXXOpName { + unsigned BeginOpNameLoc; + unsigned EndOpNameLoc; + }; + + // The location (if any) of the operator keyword is stored elsewhere. + struct CXXLitOpName { + unsigned OpNameLoc; + }; + + // struct {} CXXUsingDirective; + // struct {} ObjCZeroArgSelector; + // struct {} ObjCOneArgSelector; + // struct {} ObjCMultiArgSelector; union { - // The source location for identifier stored elsewhere. - // struct {} Identifier; - - // Type info for constructors, destructors and conversion functions. - // Locations (if any) for the tilde (destructor) or operator keyword - // (conversion) are stored elsewhere. - struct { - TypeSourceInfo* TInfo; - } NamedType; - - // The location (if any) of the operator keyword is stored elsewhere. - struct { - unsigned BeginOpNameLoc; - unsigned EndOpNameLoc; - } CXXOperatorName; - - // The location (if any) of the operator keyword is stored elsewhere. - struct { - unsigned OpNameLoc; - } CXXLiteralOperatorName; - - // struct {} CXXUsingDirective; - // struct {} ObjCZeroArgSelector; - // struct {} ObjCOneArgSelector; - // struct {} ObjCMultiArgSelector; + struct NT NamedType; + struct CXXOpName CXXOperatorName; + struct CXXLitOpName CXXLiteralOperatorName; }; DeclarationNameLoc(DeclarationName Name); @@ -525,9 +524,7 @@ public: SourceLocation getEndLoc() const; /// getSourceRange - The range of the declaration name. SourceRange getSourceRange() const LLVM_READONLY { - SourceLocation BeginLoc = getBeginLoc(); - SourceLocation EndLoc = getEndLoc(); - return SourceRange(BeginLoc, EndLoc.isValid() ? EndLoc : BeginLoc); + return SourceRange(getLocStart(), getLocEnd()); } SourceLocation getLocStart() const LLVM_READONLY { return getBeginLoc(); |