diff options
author | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-02 13:20:44 +0000 |
commit | 056abd2059c65a3e908193aeae16fad98017437c (patch) | |
tree | 2732d02d7d51218d6eed98ac7fcfc5b8794896b5 /include/clang/Sema/DeclSpec.h | |
parent | cc73504950eb7b5dff2dded9bedd67bc36d64641 (diff) | |
download | FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.zip FreeBSD-src-056abd2059c65a3e908193aeae16fad98017437c.tar.gz |
Vendor import of clang release_32 branch r168974 (effectively, 3.2 RC2):
http://llvm.org/svn/llvm-project/cfe/branches/release_32@168974
Diffstat (limited to 'include/clang/Sema/DeclSpec.h')
-rw-r--r-- | include/clang/Sema/DeclSpec.h | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/include/clang/Sema/DeclSpec.h b/include/clang/Sema/DeclSpec.h index 792b0c6..0728e87 100644 --- a/include/clang/Sema/DeclSpec.h +++ b/include/clang/Sema/DeclSpec.h @@ -266,6 +266,7 @@ public: static const TST TST_enum = clang::TST_enum; static const TST TST_union = clang::TST_union; static const TST TST_struct = clang::TST_struct; + static const TST TST_interface = clang::TST_interface; static const TST TST_class = clang::TST_class; static const TST TST_typename = clang::TST_typename; static const TST TST_typeofType = clang::TST_typeofType; @@ -378,11 +379,12 @@ private: } static bool isDeclRep(TST T) { return (T == TST_enum || T == TST_struct || - T == TST_union || T == TST_class); + T == TST_interface || T == TST_union || + T == TST_class); } - DeclSpec(const DeclSpec&); // DO NOT IMPLEMENT - void operator=(const DeclSpec&); // DO NOT IMPLEMENT + DeclSpec(const DeclSpec &) LLVM_DELETED_FUNCTION; + void operator=(const DeclSpec &) LLVM_DELETED_FUNCTION; public: DeclSpec(AttributeFactory &attrFactory) @@ -598,8 +600,7 @@ public: } bool SetTypeQual(TQ T, SourceLocation Loc, const char *&PrevSpec, - unsigned &DiagID, const LangOptions &Lang, - bool IsTypeSpec); + unsigned &DiagID, const LangOptions &Lang); bool SetFunctionSpecInline(SourceLocation Loc, const char *&PrevSpec, unsigned &DiagID); @@ -781,8 +782,9 @@ private: /// \brief Represents a C++ unqualified-id that has been parsed. class UnqualifiedId { private: - const UnqualifiedId &operator=(const UnqualifiedId &); // DO NOT IMPLEMENT - + UnqualifiedId(const UnqualifiedId &Other) LLVM_DELETED_FUNCTION; + const UnqualifiedId &operator=(const UnqualifiedId &) LLVM_DELETED_FUNCTION; + public: /// \brief Describes the kind of unqualified-id parsed. enum IdKind { @@ -857,17 +859,6 @@ public: UnqualifiedId() : Kind(IK_Identifier), Identifier(0) { } - /// \brief Do not use this copy constructor. It is temporary, and only - /// exists because we are holding FieldDeclarators in a SmallVector when we - /// don't actually need them. - /// - /// FIXME: Kill this copy constructor. - UnqualifiedId(const UnqualifiedId &Other) - : Kind(IK_Identifier), Identifier(Other.Identifier), - StartLocation(Other.StartLocation), EndLocation(Other.EndLocation) { - assert(Other.Kind == IK_Identifier && "Cannot copy non-identifiers"); - } - /// \brief Clear out this unqualified-id, setting it to default (invalid) /// state. void clear() { @@ -1110,7 +1101,7 @@ struct DeclaratorChunk { /// \brief Whether the ref-qualifier (if any) is an lvalue reference. /// Otherwise, it's an rvalue reference. unsigned RefQualifierIsLValueRef : 1; - + /// The type qualifiers: const/volatile/restrict. /// The qualifier bitmask values are the same as in QualType. unsigned TypeQuals : 3; @@ -1125,9 +1116,15 @@ struct DeclaratorChunk { /// specified. unsigned HasTrailingReturnType : 1; + /// The location of the left parenthesis in the source. + unsigned LParenLoc; + /// When isVariadic is true, the location of the ellipsis in the source. unsigned EllipsisLoc; + /// The location of the right parenthesis in the source. + unsigned RParenLoc; + /// NumArgs - This is the number of formal arguments provided for the /// declarator. unsigned NumArgs; @@ -1202,10 +1199,19 @@ struct DeclaratorChunk { bool isKNRPrototype() const { return !hasPrototype && NumArgs != 0; } - + + SourceLocation getLParenLoc() const { + return SourceLocation::getFromRawEncoding(LParenLoc); + } + SourceLocation getEllipsisLoc() const { return SourceLocation::getFromRawEncoding(EllipsisLoc); } + + SourceLocation getRParenLoc() const { + return SourceLocation::getFromRawEncoding(RParenLoc); + } + SourceLocation getExceptionSpecLoc() const { return SourceLocation::getFromRawEncoding(ExceptionSpecLoc); } @@ -1358,11 +1364,13 @@ struct DeclaratorChunk { /// DeclaratorChunk::getFunction - Return a DeclaratorChunk for a function. /// "TheDeclarator" is the declarator that this will be added to. - static DeclaratorChunk getFunction(bool hasProto, bool isVariadic, + static DeclaratorChunk getFunction(bool hasProto, bool isAmbiguous, - SourceLocation EllipsisLoc, + SourceLocation LParenLoc, ParamInfo *ArgInfo, unsigned NumArgs, - unsigned TypeQuals, + SourceLocation EllipsisLoc, + SourceLocation RParenLoc, + unsigned TypeQuals, bool RefQualifierIsLvalueRef, SourceLocation RefQualifierLoc, SourceLocation ConstQualifierLoc, |