diff options
author | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-21 10:50:08 +0000 |
---|---|---|
committer | Roman Divacky <rdivacky@FreeBSD.org> | 2010-03-21 10:50:08 +0000 |
commit | c0c7bca4e5b8d12699dc93a0da49e9e4bb79671b (patch) | |
tree | 508d4388db78f87d35bf26a0400b4b03bc4c1f13 /include/clang/AST | |
parent | 4a37f65f1c1373c9956d118a012943de2f61edb0 (diff) | |
download | src-c0c7bca4e5b8d12699dc93a0da49e9e4bb79671b.tar.gz src-c0c7bca4e5b8d12699dc93a0da49e9e4bb79671b.zip |
Notes
Diffstat (limited to 'include/clang/AST')
-rw-r--r-- | include/clang/AST/ASTContext.h | 33 | ||||
-rw-r--r-- | include/clang/AST/Expr.h | 2 | ||||
-rw-r--r-- | include/clang/AST/ExternalASTSource.h | 8 | ||||
-rw-r--r-- | include/clang/AST/Stmt.h | 4 | ||||
-rw-r--r-- | include/clang/AST/UnresolvedSet.h | 1 |
5 files changed, 15 insertions, 33 deletions
diff --git a/include/clang/AST/ASTContext.h b/include/clang/AST/ASTContext.h index d12a182078e4..e77dcf86cca6 100644 --- a/include/clang/AST/ASTContext.h +++ b/include/clang/AST/ASTContext.h @@ -259,19 +259,11 @@ class ASTContext { /// this ASTContext object. LangOptions LangOpts; - /// \brief Whether we have already loaded comment source ranges from an - /// external source. - bool LoadedExternalComments; - /// MallocAlloc/BumpAlloc - The allocator objects used to create AST objects. bool FreeMemory; llvm::MallocAllocator MallocAlloc; llvm::BumpPtrAllocator BumpAlloc; - /// \brief Mapping from declarations to their comments, once we have - /// already looked up the comment associated with a given declaration. - llvm::DenseMap<const Decl *, std::string> DeclComments; - public: const TargetInfo &Target; IdentifierTable &Idents; @@ -287,10 +279,6 @@ public: QualType ObjCClassRedefinitionType; QualType ObjCSelRedefinitionType; - /// \brief Source ranges for all of the comments in the source file, - /// sorted in order of appearance in the translation unit. - std::vector<SourceRange> Comments; - SourceManager& getSourceManager() { return SourceMgr; } const SourceManager& getSourceManager() const { return SourceMgr; } void *Allocate(unsigned Size, unsigned Align = 8) { @@ -357,8 +345,6 @@ public: TranslationUnitDecl *getTranslationUnitDecl() const { return TUDecl; } - const char *getCommentForDecl(const Decl *D); - // Builtin Types. CanQualType VoidTy; CanQualType BoolTy; @@ -1161,6 +1147,8 @@ public: /// Compatibility predicates used to check assignment expressions. bool typesAreCompatible(QualType, QualType); // C99 6.2.7p1 + bool typesAreBlockPointerCompatible(QualType, QualType); + bool isObjCIdType(QualType T) const { return T == ObjCIdTypedefType; } @@ -1179,13 +1167,16 @@ public: const ObjCObjectPointerType *RHSOPT); bool canAssignObjCInterfaces(const ObjCInterfaceType *LHS, const ObjCInterfaceType *RHS); + bool canAssignObjCInterfacesInBlockPointer( + const ObjCObjectPointerType *LHSOPT, + const ObjCObjectPointerType *RHSOPT); bool areComparableObjCPointerTypes(QualType LHS, QualType RHS); QualType areCommonBaseCompatible(const ObjCObjectPointerType *LHSOPT, const ObjCObjectPointerType *RHSOPT); // Functions for calculating composite types - QualType mergeTypes(QualType, QualType); - QualType mergeFunctionTypes(QualType, QualType); + QualType mergeTypes(QualType, QualType, bool OfBlockPointer=false); + QualType mergeFunctionTypes(QualType, QualType, bool OfBlockPointer=false); /// UsualArithmeticConversionsType - handles the various conversions /// that are common to binary operators (C99 6.3.1.8, C++ [expr]p9) @@ -1312,10 +1303,10 @@ static inline Selector GetUnarySelector(const char* name, ASTContext& Ctx) { /// this ever changes, this operator will have to be changed, too.) /// Usage looks like this (assuming there's an ASTContext 'Context' in scope): /// @code -/// // Default alignment (16) +/// // Default alignment (8) /// IntegerLiteral *Ex = new (Context) IntegerLiteral(arguments); /// // Specific alignment -/// IntegerLiteral *Ex2 = new (Context, 8) IntegerLiteral(arguments); +/// IntegerLiteral *Ex2 = new (Context, 4) IntegerLiteral(arguments); /// @endcode /// Please note that you cannot use delete on the pointer; it must be /// deallocated using an explicit destructor call followed by @@ -1346,10 +1337,10 @@ inline void operator delete(void *Ptr, clang::ASTContext &C, size_t) /// null on error. /// Usage looks like this (assuming there's an ASTContext 'Context' in scope): /// @code -/// // Default alignment (16) +/// // Default alignment (8) /// char *data = new (Context) char[10]; /// // Specific alignment -/// char *data = new (Context, 8) char[10]; +/// char *data = new (Context, 4) char[10]; /// @endcode /// Please note that you cannot use delete on the pointer; it must be /// deallocated using an explicit destructor call followed by @@ -1361,7 +1352,7 @@ inline void operator delete(void *Ptr, clang::ASTContext &C, size_t) /// allocator supports it). /// @return The allocated memory. Could be NULL. inline void *operator new[](size_t Bytes, clang::ASTContext& C, - size_t Alignment = 16) throw () { + size_t Alignment = 8) throw () { return C.Allocate(Bytes, Alignment); } diff --git a/include/clang/AST/Expr.h b/include/clang/AST/Expr.h index 23076b93e13b..6b14e47cbef5 100644 --- a/include/clang/AST/Expr.h +++ b/include/clang/AST/Expr.h @@ -150,7 +150,6 @@ public: LV_InvalidExpression, LV_MemberFunction, LV_SubObjCPropertySetting, - LV_SubObjCPropertyGetterSetting, LV_ClassTemporary }; isLvalueResult isLvalue(ASTContext &Ctx) const; @@ -182,7 +181,6 @@ public: MLV_NoSetterProperty, MLV_MemberFunction, MLV_SubObjCPropertySetting, - MLV_SubObjCPropertyGetterSetting, MLV_ClassTemporary }; isModifiableLvalueResult isModifiableLvalue(ASTContext &Ctx, diff --git a/include/clang/AST/ExternalASTSource.h b/include/clang/AST/ExternalASTSource.h index 0670d1a62094..b8d80bc8978d 100644 --- a/include/clang/AST/ExternalASTSource.h +++ b/include/clang/AST/ExternalASTSource.h @@ -58,14 +58,6 @@ public: virtual ~ExternalASTSource(); - /// \brief Reads the source ranges that correspond to comments from - /// an external AST source. - /// - /// \param Comments the contents of this vector will be - /// replaced with the sorted set of source ranges corresponding to - /// comments in the source code. - virtual void ReadComments(std::vector<SourceRange> &Comments) = 0; - /// \brief Resolve a type ID into a type, potentially building a new /// type. virtual QualType GetType(uint32_t ID) = 0; diff --git a/include/clang/AST/Stmt.h b/include/clang/AST/Stmt.h index 94caa6faad66..466848976cb3 100644 --- a/include/clang/AST/Stmt.h +++ b/include/clang/AST/Stmt.h @@ -126,12 +126,12 @@ public: // Only allow allocation of Stmts using the allocator in ASTContext // or by doing a placement new. void* operator new(size_t bytes, ASTContext& C, - unsigned alignment = 16) throw() { + unsigned alignment = 8) throw() { return ::operator new(bytes, C, alignment); } void* operator new(size_t bytes, ASTContext* C, - unsigned alignment = 16) throw() { + unsigned alignment = 8) throw() { return ::operator new(bytes, *C, alignment); } diff --git a/include/clang/AST/UnresolvedSet.h b/include/clang/AST/UnresolvedSet.h index 9c59229e3134..553f04d76aec 100644 --- a/include/clang/AST/UnresolvedSet.h +++ b/include/clang/AST/UnresolvedSet.h @@ -94,6 +94,7 @@ public: NamedDecl *getDecl() const { return ir->getDecl(); } AccessSpecifier getAccess() const { return ir->getAccess(); } + DeclAccessPair getPair() const { return *ir; } NamedDecl *operator*() const { return getDecl(); } |