From: Rafael Espindola Date: Wed, 21 May 2014 14:19:22 +0000 (+0000) Subject: Move virtual methods out of line. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b077ab75d5eba3daf1240a62cd307433f7fe7b8;p=clang Move virtual methods out of line. This is generally a good thing and in this case should also fix the BUILD_SHARED_LIBS=ON build (see pr19774). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209300 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/ExternalASTSource.h b/include/clang/AST/ExternalASTSource.h index 691e838807..1e8eff38d3 100644 --- a/include/clang/AST/ExternalASTSource.h +++ b/include/clang/AST/ExternalASTSource.h @@ -180,49 +180,50 @@ public: /// \brief Get the decls that are contained in a file in the Offset/Length /// range. \p Length can be 0 to indicate a point at \p Offset instead of - /// a range. - virtual void FindFileRegionDecls(FileID File, unsigned Offset,unsigned Length, - SmallVectorImpl &Decls) {} + /// a range. + virtual void FindFileRegionDecls(FileID File, unsigned Offset, + unsigned Length, + SmallVectorImpl &Decls); /// \brief Gives the external AST source an opportunity to complete /// the redeclaration chain for a declaration. Called each time we /// need the most recent declaration of a declaration after the /// generation count is incremented. - virtual void CompleteRedeclChain(const Decl *D) {} + virtual void CompleteRedeclChain(const Decl *D); /// \brief Gives the external AST source an opportunity to complete /// an incomplete type. - virtual void CompleteType(TagDecl *Tag) {} + virtual void CompleteType(TagDecl *Tag); /// \brief Gives the external AST source an opportunity to complete an /// incomplete Objective-C class. /// /// This routine will only be invoked if the "externally completed" bit is - /// set on the ObjCInterfaceDecl via the function + /// set on the ObjCInterfaceDecl via the function /// \c ObjCInterfaceDecl::setExternallyCompleted(). - virtual void CompleteType(ObjCInterfaceDecl *Class) { } + virtual void CompleteType(ObjCInterfaceDecl *Class); /// \brief Loads comment ranges. - virtual void ReadComments() { } + virtual void ReadComments(); /// \brief Notify ExternalASTSource that we started deserialization of /// a decl or type so until FinishedDeserializing is called there may be /// decls that are initializing. Must be paired with FinishedDeserializing. /// /// The default implementation of this method is a no-op. - virtual void StartedDeserializing() { } + virtual void StartedDeserializing(); /// \brief Notify ExternalASTSource that we finished the deserialization of /// a decl or type. Must be paired with StartedDeserializing. /// /// The default implementation of this method is a no-op. - virtual void FinishedDeserializing() { } + virtual void FinishedDeserializing(); /// \brief Function that will be invoked when we begin parsing a new /// translation unit involving this external AST source. /// /// The default implementation of this method is a no-op. - virtual void StartTranslationUnit(ASTConsumer *Consumer) { } + virtual void StartTranslationUnit(ASTConsumer *Consumer); /// \brief Print any statistics that have been gathered regarding /// the external AST source. @@ -258,16 +259,12 @@ public: /// out according to the ABI. /// /// \returns true if the record layout was provided, false otherwise. - virtual bool - layoutRecordType(const RecordDecl *Record, - uint64_t &Size, uint64_t &Alignment, - llvm::DenseMap &FieldOffsets, - llvm::DenseMap &BaseOffsets, - llvm::DenseMap &VirtualBaseOffsets) - { - return false; - } - + virtual bool layoutRecordType( + const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, + llvm::DenseMap &FieldOffsets, + llvm::DenseMap &BaseOffsets, + llvm::DenseMap &VirtualBaseOffsets); + //===--------------------------------------------------------------------===// // Queries for performance analysis. //===--------------------------------------------------------------------===// diff --git a/lib/AST/ExternalASTSource.cpp b/lib/AST/ExternalASTSource.cpp index ae8297cecd..88941075dd 100644 --- a/lib/AST/ExternalASTSource.cpp +++ b/lib/AST/ExternalASTSource.cpp @@ -22,8 +22,34 @@ using namespace clang; ExternalASTSource::~ExternalASTSource() { } +void ExternalASTSource::FindFileRegionDecls(FileID File, unsigned Offset, + unsigned Length, + SmallVectorImpl &Decls) {} + +void ExternalASTSource::CompleteRedeclChain(const Decl *D) {} + +void ExternalASTSource::CompleteType(TagDecl *Tag) {} + +void ExternalASTSource::CompleteType(ObjCInterfaceDecl *Class) {} + +void ExternalASTSource::ReadComments() {} + +void ExternalASTSource::StartedDeserializing() {} + +void ExternalASTSource::FinishedDeserializing() {} + +void ExternalASTSource::StartTranslationUnit(ASTConsumer *Consumer) {} + void ExternalASTSource::PrintStats() { } +bool ExternalASTSource::layoutRecordType( + const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, + llvm::DenseMap &FieldOffsets, + llvm::DenseMap &BaseOffsets, + llvm::DenseMap &VirtualBaseOffsets) { + return false; +} + Decl *ExternalASTSource::GetExternalDecl(uint32_t ID) { return nullptr; }