diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-07-15 17:07:12 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-07-15 17:07:12 +0000 |
commit | f1752835b9d5f0da31f34b18c9f1eb8dcb799ba8 (patch) | |
tree | 5e946d69177464379cb1a38ac18206180d763639 /include/clang/AST | |
parent | 1928da94b55683957759d5c5ff4593a118773394 (diff) | |
download | FreeBSD-src-f1752835b9d5f0da31f34b18c9f1eb8dcb799ba8.zip FreeBSD-src-f1752835b9d5f0da31f34b18c9f1eb8dcb799ba8.tar.gz |
Update clang to r108428.
Diffstat (limited to 'include/clang/AST')
-rw-r--r-- | include/clang/AST/DeclBase.h | 14 | ||||
-rw-r--r-- | include/clang/AST/DeclObjC.h | 2 | ||||
-rw-r--r-- | include/clang/AST/Expr.h | 5 | ||||
-rw-r--r-- | include/clang/AST/Type.h | 29 |
4 files changed, 34 insertions, 16 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 2d2407f..be30b8e 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -92,7 +92,7 @@ public: /// These are meant as bitmasks, so that searches in /// C++ can look into the "tag" namespace during ordinary lookup. /// - /// Decl currently provides 16 bits of IDNS bits. + /// Decl currently provides 15 bits of IDNS bits. enum IdentifierNamespace { /// Labels, declared with 'x:' and referenced with 'goto x'. IDNS_Label = 0x0001, @@ -225,10 +225,10 @@ protected: // PCHLevel - the "level" of precompiled header/AST file from which this // declaration was built. - unsigned PCHLevel : 2; + unsigned PCHLevel : 3; /// IdentifierNamespace - This specifies what IDNS_* namespace this lives in. - unsigned IdentifierNamespace : 16; + unsigned IdentifierNamespace : 15; private: #ifndef NDEBUG @@ -358,14 +358,14 @@ public: unsigned getPCHLevel() const { return PCHLevel; } /// \brief The maximum PCH level that any declaration may have. - static const unsigned MaxPCHLevel = 3; - + static const unsigned MaxPCHLevel = 7; + /// \brief Set the PCH level of this declaration. void setPCHLevel(unsigned Level) { - assert(Level < MaxPCHLevel && "PCH level exceeds the maximum"); + assert(Level <= MaxPCHLevel && "PCH level exceeds the maximum"); PCHLevel = Level; } - + unsigned getIdentifierNamespace() const { return IdentifierNamespace; } diff --git a/include/clang/AST/DeclObjC.h b/include/clang/AST/DeclObjC.h index fb8596f..30f63d8 100644 --- a/include/clang/AST/DeclObjC.h +++ b/include/clang/AST/DeclObjC.h @@ -242,7 +242,7 @@ public: /// \brief Determine the type of an expression that sends a message to this /// function. QualType getSendResultType() const { - return getResultType().getCallResultType(getASTContext()); + return getResultType().getNonLValueExprType(getASTContext()); } TypeSourceInfo *getResultTypeSourceInfo() const { return ResultTInfo; } diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 8076443..ade2b09 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -1854,6 +1854,10 @@ public: /// CK_BitCast - Used for reinterpret_cast. CK_BitCast, + /// CK_LValueBitCast - Used for reinterpret_cast of expressions to + /// a reference type. + CK_LValueBitCast, + /// CK_NoOp - Used for const_cast. CK_NoOp, @@ -1957,6 +1961,7 @@ private: // These should not have an inheritance path. case CK_Unknown: case CK_BitCast: + case CK_LValueBitCast: case CK_NoOp: case CK_Dynamic: case CK_ToUnion: diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h index a1a29e6..4c148e8 100644 --- a/include/clang/AST/Type.h +++ b/include/clang/AST/Type.h @@ -629,13 +629,15 @@ public: bool isAtLeastAsQualifiedAs(QualType Other) const; QualType getNonReferenceType() const; - /// \brief Determine the type of an expression that calls a function of - /// with the given result type. + /// \brief Determine the type of a (typically non-lvalue) expression with the + /// specified result type. /// - /// This routine removes a top-level reference (since there are no + /// This routine should be used for expressions for which the return type is + /// explicitly specified (e.g., in a cast or call) and isn't necessarily + /// an lvalue. It removes a top-level reference (since there are no /// expressions of reference type) and deletes top-level cvr-qualifiers /// from non-class types (in C++) or all types (in C). - QualType getCallResultType(ASTContext &Context) const; + QualType getNonLValueExprType(ASTContext &Context) const; /// getDesugaredType - Return the specified type with any "sugar" removed from /// the type. This takes off typedefs, typeof's etc. If the outer level of @@ -784,19 +786,27 @@ private: /// \brief Linkage of this type. mutable unsigned CachedLinkage : 2; - + + /// \brief FromPCH - Whether this type comes from a PCH file. + mutable bool FromPCH : 1; + + /// \brief Set whether this type comes from a PCH file. + void setFromPCH(bool V = true) const { + FromPCH = V; + } + protected: /// \brief Compute the linkage of this type. virtual Linkage getLinkageImpl() const; - enum { BitsRemainingInType = 20 }; + enum { BitsRemainingInType = 19 }; // silence VC++ warning C4355: 'this' : used in base member initializer list Type *this_() { return this; } Type(TypeClass tc, QualType Canonical, bool dependent) : CanonicalType(Canonical.isNull() ? QualType(this_(), 0) : Canonical), TC(tc), Dependent(dependent), LinkageKnown(false), - CachedLinkage(NoLinkage) {} + CachedLinkage(NoLinkage), FromPCH(false) {} virtual ~Type() {} virtual void Destroy(ASTContext& C); friend class ASTContext; @@ -804,6 +814,9 @@ protected: public: TypeClass getTypeClass() const { return static_cast<TypeClass>(TC); } + /// \brief Whether this type comes from a PCH file. + bool isFromPCH() const { return FromPCH; } + bool isCanonicalUnqualified() const { return CanonicalType.getTypePtr() == this; } @@ -1907,7 +1920,7 @@ public: /// \brief Determine the type of an expression that calls a function of /// this type. QualType getCallResultType(ASTContext &Context) const { - return getResultType().getCallResultType(Context); + return getResultType().getNonLValueExprType(Context); } static llvm::StringRef getNameForCallConv(CallingConv CC); |