diff options
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 44 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTReaderInternals.h | 54 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriterDecl.cpp | 52 | ||||
-rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 24 | ||||
-rw-r--r-- | clang/lib/Serialization/Module.cpp | 24 | ||||
-rw-r--r-- | clang/lib/Serialization/ModuleManager.cpp | 10 |
7 files changed, 105 insertions, 105 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 9a3b9e1da39..b38c84d8e01 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -6032,7 +6032,7 @@ QualType ASTReader::readTypeRecord(unsigned Index) { } QualType ResultType = readType(*Loc.F, Record, Idx); FunctionType::ExtInfo Info(Record[1], Record[2], Record[3], - (CallingConv)Record[4], Record[5], Record[6], + (CallingConv)Record[4], Record[5], Record[6], Record[7]); return Context.getFunctionNoProtoType(ResultType, Info); } diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 7e2c4829b14..da30612b4f1 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -569,7 +569,7 @@ void ASTDeclReader::VisitDecl(Decl *D) { Reader.addPendingDeclContextInfo(D, SemaDCIDForTemplateParmDecl, LexicalDCIDForTemplateParmDecl); - D->setDeclContext(Reader.getContext().getTranslationUnitDecl()); + D->setDeclContext(Reader.getContext().getTranslationUnitDecl()); } else { auto *SemaDC = ReadDeclAs<DeclContext>(); auto *LexicalDC = ReadDeclAs<DeclContext>(); @@ -701,7 +701,7 @@ void ASTDeclReader::VisitTypeAliasDecl(TypeAliasDecl *TD) { ASTDeclReader::RedeclarableResult ASTDeclReader::VisitTagDecl(TagDecl *TD) { RedeclarableResult Redecl = VisitRedeclarable(TD); VisitTypeDecl(TD); - + TD->IdentifierNamespace = Record.readInt(); TD->setTagKind((TagDecl::TagKind)Record.readInt()); if (!isa<CXXRecordDecl>(TD)) @@ -710,7 +710,7 @@ ASTDeclReader::RedeclarableResult ASTDeclReader::VisitTagDecl(TagDecl *TD) { TD->setFreeStanding(Record.readInt()); TD->setCompleteDefinitionRequired(Record.readInt()); TD->setBraceRange(ReadSourceRange()); - + switch (Record.readInt()) { case 0: break; @@ -1717,7 +1717,7 @@ void ASTDeclReader::ReadCXXDefinitionData( bool IsImplicit = Record.readInt(); auto Kind = static_cast<LambdaCaptureKind>(Record.readInt()); switch (Kind) { - case LCK_StarThis: + case LCK_StarThis: case LCK_This: case LCK_VLAType: *ToCapture++ = Capture(Loc, IsImplicit, Kind, nullptr,SourceLocation()); @@ -2691,8 +2691,8 @@ static bool isConsumerInterestedIn(ASTContext &Ctx, Decl *D, bool HasBody) { return false; } - if (isa<FileScopeAsmDecl>(D) || - isa<ObjCProtocolDecl>(D) || + if (isa<FileScopeAsmDecl>(D) || + isa<ObjCProtocolDecl>(D) || isa<ObjCImplDecl>(D) || isa<ImportDecl>(D) || isa<PragmaCommentDecl>(D) || @@ -3274,7 +3274,7 @@ ASTDeclReader::FindExistingResult ASTDeclReader::findExisting(NamedDecl *D) { } } UpToDate(Name.getAsIdentifierInfo()); - for (IdentifierResolver::iterator I = IdResolver.begin(Name), + for (IdentifierResolver::iterator I = IdResolver.begin(Name), IEnd = IdResolver.end(); I != IEnd; ++I) { if (NamedDecl *Existing = getDeclForMerging(*I, TypedefNameForLinkage)) @@ -3759,7 +3759,7 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) { Error("attempt to read a C++ ctor initializer record as a declaration"); return nullptr; case DECL_IMPORT: - // Note: last entry of the ImportDecl record is the number of stored source + // Note: last entry of the ImportDecl record is the number of stored source // locations. D = ImportDecl::CreateDeserialized(Context, ID, Record.back()); break; @@ -3819,7 +3819,7 @@ Decl *ASTReader::ReadDeclRecord(DeclID ID) { if (Class->isThisDeclarationADefinition() || PendingDefinitions.count(Class)) loadObjCCategories(ID, Class); - + // If we have deserialized a declaration that has a definition the // AST consumer might need to know about, queue it. // We don't pass it to the consumer immediately because we may be in recursive @@ -3981,17 +3981,17 @@ namespace { llvm::DenseMap<DeclarationName, ObjCCategoryDecl *> NameCategoryMap; serialization::GlobalDeclID InterfaceID; unsigned PreviousGeneration; - + void add(ObjCCategoryDecl *Cat) { // Only process each category once. if (!Deserialized.erase(Cat)) return; - + // Check for duplicate categories. if (Cat->getDeclName()) { ObjCCategoryDecl *&Existing = NameCategoryMap[Cat->getDeclName()]; - if (Existing && - Reader.getOwningModuleFile(Existing) + if (Existing && + Reader.getOwningModuleFile(Existing) != Reader.getOwningModuleFile(Cat)) { // FIXME: We should not warn for duplicates in diamond: // @@ -4001,8 +4001,8 @@ namespace { // \ / // // MB // // - // If there are duplicates in ML/MR, there will be warning when - // creating MB *and* when importing MB. We should not warn when + // If there are duplicates in ML/MR, there will be warning when + // creating MB *and* when importing MB. We should not warn when // importing. Reader.Diag(Cat->getLocation(), diag::warn_dup_category_def) << Interface->getDeclName() << Cat->getDeclName(); @@ -4012,7 +4012,7 @@ namespace { Existing = Cat; } } - + // Add this category to the end of the chain. if (Tail) ASTDeclReader::setNextObjCCategory(Tail, Cat); @@ -4020,7 +4020,7 @@ namespace { Interface->setCategoryListRaw(Cat); Tail = Cat; } - + public: ObjCCategoriesVisitor(ASTReader &Reader, ObjCInterfaceDecl *Interface, @@ -4033,7 +4033,7 @@ namespace { for (auto *Cat : Interface->known_categories()) { if (Cat->getDeclName()) NameCategoryMap[Cat->getDeclName()] = Cat; - + // Keep track of the tail of the category list. Tail = Cat; } @@ -4044,8 +4044,8 @@ namespace { // this module file, we're done. if (M.Generation <= PreviousGeneration) return true; - - // Map global ID of the definition down to the local ID used in this + + // Map global ID of the definition down to the local ID used in this // module file. If there is no such mapping, we'll find nothing here // (or in any module it imports). DeclID LocalID = Reader.mapGlobalIDToModuleFileGlobalID(M, InterfaceID); @@ -4057,7 +4057,7 @@ namespace { const ObjCCategoriesInfo Compare = { LocalID, 0 }; const ObjCCategoriesInfo *Result = std::lower_bound(M.ObjCCategoriesMap, - M.ObjCCategoriesMap + M.LocalNumObjCCategoriesInMap, + M.ObjCCategoriesMap + M.LocalNumObjCCategoriesInMap, Compare); if (Result == M.ObjCCategoriesMap + M.LocalNumObjCCategoriesInMap || Result->DefinitionID != LocalID) { @@ -4066,7 +4066,7 @@ namespace { // so suppress further lookup. return Reader.isDeclIDFromModule(InterfaceID, M); } - + // We found something. Dig out all of the categories. unsigned Offset = Result->Offset; unsigned N = M.ObjCCategories[Offset]; diff --git a/clang/lib/Serialization/ASTReaderInternals.h b/clang/lib/Serialization/ASTReaderInternals.h index b5a1493a4f7..37a929907dc 100644 --- a/clang/lib/Serialization/ASTReaderInternals.h +++ b/clang/lib/Serialization/ASTReaderInternals.h @@ -33,7 +33,7 @@ struct HeaderFileInfo; class HeaderSearch; class IdentifierTable; class ObjCMethodDecl; - + namespace serialization { class ModuleFile; @@ -45,7 +45,7 @@ namespace reader { class ASTDeclContextNameLookupTrait { ASTReader &Reader; ModuleFile &F; - + public: // Maximum number of lookup tables we allow before condensing the tables. static const int MaxTables = 4; @@ -141,31 +141,31 @@ public: } static hash_value_type ComputeHash(const internal_key_type& a); - + static std::pair<unsigned, unsigned> ReadKeyDataLength(const unsigned char*& d); // This hopefully will just get inlined and removed by the optimizer. static const internal_key_type& GetInternalKey(const external_key_type& x) { return x; } - + // This hopefully will just get inlined and removed by the optimizer. static const external_key_type& GetExternalKey(const internal_key_type& x) { return x; } - static internal_key_type ReadKey(const unsigned char* d, unsigned n); + static internal_key_type ReadKey(const unsigned char* d, unsigned n); }; /// Class that performs lookup for an identifier stored in an AST file. class ASTIdentifierLookupTrait : public ASTIdentifierLookupTraitBase { ASTReader &Reader; ModuleFile &F; - + // If we know the IdentifierInfo in advance, it is here and we will // not build a new one. Used when deserializing information about an // identifier that was constructed before the AST file was read. IdentifierInfo *KnownII; - + public: using data_type = IdentifierInfo *; @@ -176,12 +176,12 @@ public: data_type ReadData(const internal_key_type& k, const unsigned char* d, unsigned DataLen); - + IdentID ReadIdentifierID(const unsigned char *d); ASTReader &getReader() const { return Reader; } }; - + /// The on-disk hash table used to contain information about /// all of the identifiers in the program. using ASTIdentifierLookupTable = @@ -192,7 +192,7 @@ using ASTIdentifierLookupTable = class ASTSelectorLookupTrait { ASTReader &Reader; ModuleFile &F; - + public: struct data_type { SelectorID ID; @@ -203,40 +203,40 @@ public: SmallVector<ObjCMethodDecl *, 2> Instance; SmallVector<ObjCMethodDecl *, 2> Factory; }; - + using external_key_type = Selector; using internal_key_type = external_key_type; using hash_value_type = unsigned; using offset_type = unsigned; - + ASTSelectorLookupTrait(ASTReader &Reader, ModuleFile &F) : Reader(Reader), F(F) {} - + static bool EqualKey(const internal_key_type& a, const internal_key_type& b) { return a == b; } - + static hash_value_type ComputeHash(Selector Sel); - + static const internal_key_type& GetInternalKey(const external_key_type& x) { return x; } - + static std::pair<unsigned, unsigned> ReadKeyDataLength(const unsigned char*& d); - + internal_key_type ReadKey(const unsigned char* d, unsigned); data_type ReadData(Selector, const unsigned char* d, unsigned DataLen); }; - + /// The on-disk hash table used for the global method pool. using ASTSelectorLookupTable = llvm::OnDiskChainedHashTable<ASTSelectorLookupTrait>; - + /// Trait class used to search the on-disk hash table containing all of /// the header search information. /// -/// The on-disk hash table contains a mapping from each header path to +/// The on-disk hash table contains a mapping from each header path to /// information about that header (how many times it has been included, its /// controlling macro, etc.). Note that we actually hash based on the size /// and mtime, and support "deep" comparisons of file names based on current @@ -259,31 +259,31 @@ public: }; using internal_key_ref = const internal_key_type &; - + using data_type = HeaderFileInfo; using hash_value_type = unsigned; using offset_type = unsigned; - + HeaderFileInfoTrait(ASTReader &Reader, ModuleFile &M, HeaderSearch *HS, const char *FrameworkStrings) : Reader(Reader), M(M), HS(HS), FrameworkStrings(FrameworkStrings) {} - + static hash_value_type ComputeHash(internal_key_ref ikey); internal_key_type GetInternalKey(const FileEntry *FE); bool EqualKey(internal_key_ref a, internal_key_ref b); - + static std::pair<unsigned, unsigned> ReadKeyDataLength(const unsigned char*& d); - + static internal_key_type ReadKey(const unsigned char *d, unsigned); - + data_type ReadData(internal_key_ref,const unsigned char *d, unsigned DataLen); }; /// The on-disk hash table used for known header files. using HeaderFileInfoLookupTable = llvm::OnDiskChainedHashTable<HeaderFileInfoTrait>; - + } // namespace reader } // namespace serialization diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index 77e578f6bc5..7286f2cac17 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -271,7 +271,7 @@ void ASTDeclWriter::Visit(Decl *D) { // Handle FunctionDecl's body here and write it after all other Stmts/Exprs // have been written. We want it last because we will not read it back when - // retrieving it from the AST, we'll just lazily set the offset. + // retrieving it from the AST, we'll just lazily set the offset. if (FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) { Record.push_back(FD->doesThisDeclarationHaveABody()); if (FD->doesThisDeclarationHaveABody()) @@ -526,10 +526,10 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { VisitDeclaratorDecl(D); Record.AddDeclarationNameLoc(D->DNLoc, D->getDeclName()); Record.push_back(D->getIdentifierNamespace()); - + // FunctionDecl's body is handled last at ASTWriterDecl::Visit, // after everything else is written. - + Record.push_back((int)D->SClass); // FIXME: stable encoding Record.push_back(D->IsInline); Record.push_back(D->IsInlineSpecified); @@ -576,10 +576,10 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { Record.AddDeclRef(FTSInfo->getTemplate()); Record.push_back(FTSInfo->getTemplateSpecializationKind()); - + // Template arguments. Record.AddTemplateArgumentList(FTSInfo->TemplateArguments); - + // Template args as written. Record.push_back(FTSInfo->TemplateArgumentsAsWritten != nullptr); if (FTSInfo->TemplateArgumentsAsWritten) { @@ -591,7 +591,7 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { Record.AddSourceLocation(FTSInfo->TemplateArgumentsAsWritten->LAngleLoc); Record.AddSourceLocation(FTSInfo->TemplateArgumentsAsWritten->RAngleLoc); } - + Record.AddSourceLocation(FTSInfo->getPointOfInstantiation()); if (D->isCanonicalDecl()) { @@ -604,12 +604,12 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { case FunctionDecl::TK_DependentFunctionTemplateSpecialization: { DependentFunctionTemplateSpecializationInfo * DFTSInfo = D->getDependentSpecializationInfo(); - + // Templates. Record.push_back(DFTSInfo->getNumTemplates()); for (int i=0, e = DFTSInfo->getNumTemplates(); i != e; ++i) Record.AddDeclRef(DFTSInfo->getTemplate(i)); - + // Templates args. Record.push_back(DFTSInfo->getNumTemplateArgs()); for (int i=0, e = DFTSInfo->getNumTemplateArgs(); i != e; ++i) @@ -707,7 +707,7 @@ void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { if (D->isThisDeclarationADefinition()) { // Write the DefinitionData ObjCInterfaceDecl::DefinitionData &Data = D->data(); - + Record.AddTypeSourceInfo(D->getSuperClassTInfo()); Record.AddSourceLocation(D->getEndOfDefinitionLoc()); Record.push_back(Data.HasDesignatedInitializers); @@ -718,7 +718,7 @@ void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { Record.AddDeclRef(P); for (const auto &PL : D->protocol_locs()) Record.AddSourceLocation(PL); - + // Write out the protocols that are transitively referenced. Record.push_back(Data.AllReferencedProtocols.size()); for (ObjCList<ObjCProtocolDecl>::iterator @@ -727,17 +727,17 @@ void ASTDeclWriter::VisitObjCInterfaceDecl(ObjCInterfaceDecl *D) { P != PEnd; ++P) Record.AddDeclRef(*P); - + if (ObjCCategoryDecl *Cat = D->getCategoryListRaw()) { // Ensure that we write out the set of categories for this class. Writer.ObjCClassesWithCategories.insert(D); - + // Make sure that the categories get serialized. for (; Cat; Cat = Cat->getNextClassCategoryRaw()) (void)Writer.GetDeclRef(Cat); } - } - + } + Code = serialization::DECL_OBJC_INTERFACE; } @@ -765,7 +765,7 @@ void ASTDeclWriter::VisitObjCIvarDecl(ObjCIvarDecl *D) { void ASTDeclWriter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { VisitRedeclarable(D); VisitObjCContainerDecl(D); - + Record.push_back(D->isThisDeclarationADefinition()); if (D->isThisDeclarationADefinition()) { Record.push_back(D->protocol_size()); @@ -774,7 +774,7 @@ void ASTDeclWriter::VisitObjCProtocolDecl(ObjCProtocolDecl *D) { for (const auto &PL : D->protocol_locs()) Record.AddSourceLocation(PL); } - + Code = serialization::DECL_OBJC_PROTOCOL; } @@ -964,7 +964,7 @@ void ASTDeclWriter::VisitVarDecl(VarDecl *D) { if (ModulesCodegen) Writer.ModularCodegenDecls.push_back(Writer.GetDeclRef(D)); } - + enum { VarNotTemplate = 0, VarTemplate, StaticDataMemberSpecialization }; @@ -1158,7 +1158,7 @@ void ASTDeclWriter::VisitNamespaceDecl(NamespaceDecl *D) { Record.AddDeclRef(D->getAnonymousNamespace()); Code = serialization::DECL_NAMESPACE; - if (Writer.hasChain() && D->isAnonymousNamespace() && + if (Writer.hasChain() && D->isAnonymousNamespace() && D == D->getMostRecentDecl()) { // This is a most recent reopening of the anonymous namespace. If its parent // is in a previous PCH (or is the TU), mark that parent for update, because @@ -1412,7 +1412,7 @@ void ASTDeclWriter::VisitRedeclarableTemplateDecl(RedeclarableTemplateDecl *D) { if (D->getInstantiatedFromMemberTemplate()) Record.push_back(D->isMemberSpecialization()); } - + VisitTemplateDecl(D); Record.push_back(D->getIdentifierNamespace()); } @@ -1447,7 +1447,7 @@ void ASTDeclWriter::VisitClassTemplateSpecializationDecl( Record.push_back(D->isCanonicalDecl()); if (D->isCanonicalDecl()) { - // When reading, we'll add it to the folding set of the following template. + // When reading, we'll add it to the folding set of the following template. Record.AddDeclRef(D->getSpecializedTemplate()->getCanonicalDecl()); } @@ -1573,18 +1573,18 @@ void ASTDeclWriter::VisitNonTypeTemplateParmDecl(NonTypeTemplateParmDecl *D) { // memory. if (D->isExpandedParameterPack()) Record.push_back(D->getNumExpansionTypes()); - + VisitDeclaratorDecl(D); // TemplateParmPosition. Record.push_back(D->getDepth()); Record.push_back(D->getPosition()); - + if (D->isExpandedParameterPack()) { for (unsigned I = 0, N = D->getNumExpansionTypes(); I != N; ++I) { Record.AddTypeRef(D->getExpansionType(I)); Record.AddTypeSourceInfo(D->getExpansionTypeSourceInfo(I)); } - + Code = serialization::DECL_EXPANDED_NON_TYPE_TEMPLATE_PARM_PACK; } else { // Rest of NonTypeTemplateParmDecl. @@ -1709,7 +1709,7 @@ void ASTDeclWriter::VisitRedeclarable(Redeclarable<T> *D) { Record.AddDeclRef(FirstLocal); } - // Make sure that we serialize both the previous and the most-recent + // Make sure that we serialize both the previous and the most-recent // declarations, which (transitively) ensures that all declarations in the // chain get serialized. // @@ -2252,11 +2252,11 @@ void ASTWriter::WriteDecl(ASTContext &Context, Decl *D) { serialization::DeclID &IDR = DeclIDs[D]; if (IDR == 0) IDR = NextDeclID++; - + ID = IDR; assert(ID >= FirstDeclID && "invalid decl ID"); - + RecordData Record; ASTDeclWriter W(*this, Context, Record); diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 3efb6482dd4..48c3f79a438 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -247,7 +247,7 @@ void ASTStmtWriter::VisitGCCAsmStmt(GCCAsmStmt *S) { Record.AddStmt(S->getAsmString()); // Outputs - for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) { + for (unsigned I = 0, N = S->getNumOutputs(); I != N; ++I) { Record.AddIdentifierRef(S->getOutputIdentifier(I)); Record.AddStmt(S->getOutputConstraintLiteral(I)); Record.AddStmt(S->getOutputExpr(I)); @@ -1000,7 +1000,7 @@ void ASTStmtWriter::VisitObjCDictionaryLiteral(ObjCDictionaryLiteral *E) { Record.push_back(NumExpansions); } } - + Record.AddDeclRef(E->getDictWithObjectsMethod()); Record.AddSourceRange(E->getSourceRange()); Code = serialization::EXPR_OBJC_DICTIONARY_LITERAL; @@ -1064,7 +1064,7 @@ void ASTStmtWriter::VisitObjCPropertyRefExpr(ObjCPropertyRefExpr *E) { Record.push_back(2); Record.AddDeclRef(E->getClassReceiver()); } - + Code = serialization::EXPR_OBJC_PROPERTY_REF_EXPR; } @@ -1075,7 +1075,7 @@ void ASTStmtWriter::VisitObjCSubscriptRefExpr(ObjCSubscriptRefExpr *E) { Record.AddStmt(E->getKeyExpr()); Record.AddDeclRef(E->getAtIndexMethodDecl()); Record.AddDeclRef(E->setAtIndexMethodDecl()); - + Code = serialization::EXPR_OBJC_SUBSCRIPT_REF_EXPR; } @@ -1108,9 +1108,9 @@ void ASTStmtWriter::VisitObjCMessageExpr(ObjCMessageExpr *E) { Record.AddDeclRef(E->getMethodDecl()); } else { Record.push_back(0); - Record.AddSelectorRef(E->getSelector()); + Record.AddSelectorRef(E->getSelector()); } - + Record.AddSourceLocation(E->getLeftLoc()); Record.AddSourceLocation(E->getRightLoc()); @@ -1296,14 +1296,14 @@ void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) { Record.push_back(E->ExplicitParams); Record.push_back(E->ExplicitResultType); Record.AddSourceLocation(E->ClosingBrace); - + // Add capture initializers. for (LambdaExpr::capture_init_iterator C = E->capture_init_begin(), CEnd = E->capture_init_end(); C != CEnd; ++C) { Record.AddStmt(*C); } - + Code = serialization::EXPR_LAMBDA; } @@ -1450,7 +1450,7 @@ void ASTStmtWriter::VisitCXXDeleteExpr(CXXDeleteExpr *E) { Record.AddDeclRef(E->getOperatorDelete()); Record.AddStmt(E->getArgument()); Record.AddSourceLocation(E->getSourceRange().getBegin()); - + Code = serialization::EXPR_CXX_DELETE; } @@ -2691,7 +2691,7 @@ void ASTWriter::WriteSubStmt(Stmt *S) { RecordData Record; ASTStmtWriter Writer(*this, Record); ++NumStatements; - + if (!S) { Stream.EmitRecord(serialization::STMT_NULL_PTR, Record); return; @@ -2724,7 +2724,7 @@ void ASTWriter::WriteSubStmt(Stmt *S) { #endif Writer.Visit(S); - + uint64_t Offset = Writer.Emit(); SubStmtEntries[S] = Offset; } @@ -2739,7 +2739,7 @@ void ASTRecordWriter::FlushStmts() { for (unsigned I = 0, N = StmtsToEmit.size(); I != N; ++I) { Writer->WriteSubStmt(StmtsToEmit[I]); - + assert(N == StmtsToEmit.size() && "record modified while being written!"); // Note that we are at the end of a full expression. Any diff --git a/clang/lib/Serialization/Module.cpp b/clang/lib/Serialization/Module.cpp index f0ada809ad9..580e46e4f24 100644 --- a/clang/lib/Serialization/Module.cpp +++ b/clang/lib/Serialization/Module.cpp @@ -30,16 +30,16 @@ ModuleFile::~ModuleFile() { } template<typename Key, typename Offset, unsigned InitialCapacity> -static void +static void dumpLocalRemap(StringRef Name, const ContinuousRangeMap<Key, Offset, InitialCapacity> &Map) { if (Map.begin() == Map.end()) return; - + using MapType = ContinuousRangeMap<Key, Offset, InitialCapacity>; llvm::errs() << " " << Name << ":\n"; - for (typename MapType::const_iterator I = Map.begin(), IEnd = Map.end(); + for (typename MapType::const_iterator I = Map.begin(), IEnd = Map.end(); I != IEnd; ++I) { llvm::errs() << " " << I->first << " -> " << I->second << "\n"; } @@ -56,12 +56,12 @@ LLVM_DUMP_METHOD void ModuleFile::dump() { } llvm::errs() << "\n"; } - + // Remapping tables. - llvm::errs() << " Base source location offset: " << SLocEntryBaseOffset + llvm::errs() << " Base source location offset: " << SLocEntryBaseOffset << '\n'; dumpLocalRemap("Source location offset local -> global map", SLocRemap); - + llvm::errs() << " Base identifier ID: " << BaseIdentifierID << '\n' << " Number of identifiers: " << LocalNumIdentifiers << '\n'; dumpLocalRemap("Identifier ID local -> global map", IdentifierRemap); @@ -77,18 +77,18 @@ LLVM_DUMP_METHOD void ModuleFile::dump() { llvm::errs() << " Base selector ID: " << BaseSelectorID << '\n' << " Number of selectors: " << LocalNumSelectors << '\n'; dumpLocalRemap("Selector ID local -> global map", SelectorRemap); - + llvm::errs() << " Base preprocessed entity ID: " << BasePreprocessedEntityID - << '\n' - << " Number of preprocessed entities: " + << '\n' + << " Number of preprocessed entities: " << NumPreprocessedEntities << '\n'; - dumpLocalRemap("Preprocessed entity ID local -> global map", + dumpLocalRemap("Preprocessed entity ID local -> global map", PreprocessedEntityRemap); - + llvm::errs() << " Base type index: " << BaseTypeIndex << '\n' << " Number of types: " << LocalNumTypes << '\n'; dumpLocalRemap("Type index local -> global map", TypeRemap); - + llvm::errs() << " Base decl ID: " << BaseDeclID << '\n' << " Number of decls: " << LocalNumDecls << '\n'; dumpLocalRemap("Decl ID local -> global map", DeclRemap); diff --git a/clang/lib/Serialization/ModuleManager.cpp b/clang/lib/Serialization/ModuleManager.cpp index b512fa452cc..57ebaca10c9 100644 --- a/clang/lib/Serialization/ModuleManager.cpp +++ b/clang/lib/Serialization/ModuleManager.cpp @@ -340,7 +340,7 @@ void ModuleManager::visit(llvm::function_ref<bool(ModuleFile &M)> Visitor, unsigned N = size(); VisitOrder.clear(); VisitOrder.reserve(N); - + // Record the number of incoming edges for each module. When we // encounter a module with no incoming edges, push it into the queue // to seed the queue. @@ -477,21 +477,21 @@ namespace llvm { static ChildIteratorType child_end(NodeRef Node) { return Node->Imports.end(); } - + static nodes_iterator nodes_begin(const ModuleManager &Manager) { return nodes_iterator(Manager.begin()); } - + static nodes_iterator nodes_end(const ModuleManager &Manager) { return nodes_iterator(Manager.end()); } }; - + template<> struct DOTGraphTraits<ModuleManager> : public DefaultDOTGraphTraits { explicit DOTGraphTraits(bool IsSimple = false) : DefaultDOTGraphTraits(IsSimple) {} - + static bool renderGraphFromBottomUp() { return true; } std::string getNodeLabel(ModuleFile *M, const ModuleManager&) { |