diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2018-08-02 17:33:11 +0000 | 
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2018-08-02 17:33:11 +0000 | 
| commit | c7e70c433efc6953dc3888b9fbf9f3512d7da2b0 (patch) | |
| tree | 27425930fc0c91650a7f3527fcac8e0f92907b90 /include/clang/Serialization | |
| parent | 486754660bb926339aefcf012a3f848592babb8b (diff) | |
Diffstat (limited to 'include/clang/Serialization')
| -rw-r--r-- | include/clang/Serialization/ASTBitCodes.h | 68 | ||||
| -rw-r--r-- | include/clang/Serialization/ASTReader.h | 36 | ||||
| -rw-r--r-- | include/clang/Serialization/ASTWriter.h | 6 | ||||
| -rw-r--r-- | include/clang/Serialization/ContinuousRangeMap.h | 10 | ||||
| -rw-r--r-- | include/clang/Serialization/GlobalModuleIndex.h | 4 | ||||
| -rw-r--r-- | include/clang/Serialization/Module.h | 16 | ||||
| -rw-r--r-- | include/clang/Serialization/ModuleFileExtension.h | 4 | ||||
| -rw-r--r-- | include/clang/Serialization/ModuleManager.h | 14 | 
8 files changed, 79 insertions, 79 deletions
diff --git a/include/clang/Serialization/ASTBitCodes.h b/include/clang/Serialization/ASTBitCodes.h index 76bc818557a9..430fc48379fe 100644 --- a/include/clang/Serialization/ASTBitCodes.h +++ b/include/clang/Serialization/ASTBitCodes.h @@ -55,16 +55,16 @@ namespace serialization {      const unsigned VERSION_MINOR = 0;      /// An ID number that refers to an identifier in an AST file. -    ///  +    ///      /// The ID numbers of identifiers are consecutive (in order of discovery)      /// and start at 1. 0 is reserved for NULL.      using IdentifierID = uint32_t; -     +      /// An ID number that refers to a declaration in an AST file.      ///      /// The ID numbers of declarations are consecutive (in order of -    /// discovery), with values below NUM_PREDEF_DECL_IDS being reserved.  -    /// At the start of a chain of precompiled headers, declaration ID 1 is  +    /// discovery), with values below NUM_PREDEF_DECL_IDS being reserved. +    /// At the start of a chain of precompiled headers, declaration ID 1 is      /// used for the translation unit declaration.      using DeclID = uint32_t; @@ -98,14 +98,14 @@ namespace serialization {        TypeID asTypeID(unsigned FastQuals) const {          if (Idx == uint32_t(-1))            return TypeID(-1); -         +          return (Idx << Qualifiers::FastWidth) | FastQuals;        }        static TypeIdx fromTypeID(TypeID ID) {          if (ID == TypeID(-1))            return TypeIdx(-1); -         +          return TypeIdx(ID >> Qualifiers::FastWidth);        }      }; @@ -124,7 +124,7 @@ namespace serialization {        }        static unsigned getHashValue(QualType T) { -        assert(!T.getLocalFastQualifiers() &&  +        assert(!T.getLocalFastQualifiers() &&                 "hash invalid for types with fast quals");          uintptr_t v = reinterpret_cast<uintptr_t>(T.getAsOpaquePtr());          return (unsigned(v) >> 4) ^ (unsigned(v) >> 9); @@ -155,8 +155,8 @@ namespace serialization {      /// The number of predefined selector IDs.      const unsigned int NUM_PREDEF_SELECTOR_IDS = 1; -     -    /// An ID number that refers to a set of CXXBaseSpecifiers in an  + +    /// An ID number that refers to a set of CXXBaseSpecifiers in an      /// AST file.      using CXXBaseSpecifiersID = uint32_t; @@ -170,7 +170,7 @@ namespace serialization {      /// An ID number that refers to a submodule in a module file.      using SubmoduleID = uint32_t; -     +      /// The number of predefined submodule IDs.      const unsigned int NUM_PREDEF_SUBMODULE_IDS = 1; @@ -311,7 +311,7 @@ namespace serialization {        /// generate the AST file, including both its file ID and its        /// name.        ORIGINAL_FILE, -       +        /// The directory that the PCH was originally created in.        ORIGINAL_PCH_DIR, @@ -706,15 +706,15 @@ namespace serialization {      enum PreprocessorDetailRecordTypes {        /// Describes a macro expansion within the preprocessing record.        PPD_MACRO_EXPANSION = 0, -       +        /// Describes a macro definition within the preprocessing record.        PPD_MACRO_DEFINITION = 1, -       +        /// Describes an inclusion directive within the preprocessing        /// record.        PPD_INCLUSION_DIRECTIVE = 2      }; -     +      /// Record types used within a submodule description block.      enum SubmoduleRecordTypes {        /// Metadata for submodules as a whole. @@ -737,11 +737,11 @@ namespace serialization {        /// Specifies an umbrella directory.        SUBMODULE_UMBRELLA_DIR = 5, -      /// Specifies the submodules that are imported by this  +      /// Specifies the submodules that are imported by this        /// submodule.        SUBMODULE_IMPORTS = 6, -      /// Specifies the submodules that are re-exported from this  +      /// Specifies the submodules that are re-exported from this        /// submodule.        SUBMODULE_EXPORTS = 7, @@ -1203,7 +1203,7 @@ namespace serialization {        /// C ucontext_t typedef type        SPECIAL_TYPE_UCONTEXT_T                  = 7      }; -     +      /// The number of special type IDs.      const unsigned NumSpecialTypeIDs = 8; @@ -1211,7 +1211,7 @@ namespace serialization {      ///      /// These declaration IDs correspond to predefined declarations in the AST      /// context, such as the NULL declaration ID. Such declarations are never -    /// actually serialized, since they will be built by the AST context when  +    /// actually serialized, since they will be built by the AST context when      /// it is created.      enum PredefinedDeclIDs {        /// The NULL declaration. @@ -1279,7 +1279,7 @@ namespace serialization {      /// Record code for a list of local redeclarations of a declaration.      /// This can occur within DECLTYPES_BLOCK_ID.      const unsigned int LOCAL_REDECLARATIONS = 50; -     +      /// Record codes for each kind of declaration.      ///      /// These constants describe the declaration records that can occur within @@ -1539,7 +1539,7 @@ namespace serialization {      ///      /// These constants describe the records that describe statements      /// or expressions. These records  occur within type and declarations -    /// block, so they begin with record values of 128.  Each constant  +    /// block, so they begin with record values of 128.  Each constant      /// describes a record for a specific statement or expression class in the      /// AST.      enum StmtCode { @@ -1741,7 +1741,7 @@ namespace serialization {        EXPR_OBJC_BOXED_EXPRESSION,        EXPR_OBJC_ARRAY_LITERAL,        EXPR_OBJC_DICTIONARY_LITERAL, -    +        /// An ObjCEncodeExpr record.        EXPR_OBJC_ENCODE, @@ -1800,7 +1800,7 @@ namespace serialization {        EXPR_OBJC_AVAILABILITY_CHECK,        // C++ -       +        /// A CXXCatchStmt record.        STMT_CXX_CATCH, @@ -1862,9 +1862,9 @@ namespace serialization {        EXPR_CXX_NEW,               // CXXNewExpr        EXPR_CXX_DELETE,            // CXXDeleteExpr        EXPR_CXX_PSEUDO_DESTRUCTOR, // CXXPseudoDestructorExpr -       +        EXPR_EXPR_WITH_CLEANUPS,    // ExprWithCleanups -       +        EXPR_CXX_DEPENDENT_SCOPE_MEMBER,   // CXXDependentScopeMemberExpr        EXPR_CXX_DEPENDENT_SCOPE_DECL_REF, // DependentScopeDeclRefExpr        EXPR_CXX_UNRESOLVED_CONSTRUCT,     // CXXUnresolvedConstructExpr @@ -1878,7 +1878,7 @@ namespace serialization {        EXPR_BINARY_CONDITIONAL_OPERATOR,  // BinaryConditionalOperator        EXPR_TYPE_TRAIT,            // TypeTraitExpr        EXPR_ARRAY_TYPE_TRAIT,      // ArrayTypeTraitIntExpr -       +        EXPR_PACK_EXPANSION,        // PackExpansionExpr        EXPR_SIZEOF_PACK,           // SizeOfPackExpr        EXPR_SUBST_NON_TYPE_TEMPLATE_PARM, // SubstNonTypeTemplateParmExpr @@ -1888,7 +1888,7 @@ namespace serialization {        EXPR_CXX_FOLD,              // CXXFoldExpr        // CUDA -      EXPR_CUDA_KERNEL_CALL,       // CUDAKernelCallExpr       +      EXPR_CUDA_KERNEL_CALL,       // CUDAKernelCallExpr        // OpenCL        EXPR_ASTYPE,                 // AsTypeExpr @@ -1998,22 +1998,22 @@ namespace serialization {        // Offset into the array of redeclaration chains.        unsigned Offset; -       +        friend bool operator<(const LocalRedeclarationsInfo &X,                              const LocalRedeclarationsInfo &Y) {          return X.FirstID < Y.FirstID;        } -       +        friend bool operator>(const LocalRedeclarationsInfo &X,                              const LocalRedeclarationsInfo &Y) {          return X.FirstID > Y.FirstID;        } -       +        friend bool operator<=(const LocalRedeclarationsInfo &X,                               const LocalRedeclarationsInfo &Y) {          return X.FirstID <= Y.FirstID;        } -       +        friend bool operator>=(const LocalRedeclarationsInfo &X,                               const LocalRedeclarationsInfo &Y) {          return X.FirstID >= Y.FirstID; @@ -2027,22 +2027,22 @@ namespace serialization {        // Offset into the array of category lists.        unsigned Offset; -       +        friend bool operator<(const ObjCCategoriesInfo &X,                              const ObjCCategoriesInfo &Y) {          return X.DefinitionID < Y.DefinitionID;        } -       +        friend bool operator>(const ObjCCategoriesInfo &X,                              const ObjCCategoriesInfo &Y) {          return X.DefinitionID > Y.DefinitionID;        } -       +        friend bool operator<=(const ObjCCategoriesInfo &X,                               const ObjCCategoriesInfo &Y) {          return X.DefinitionID <= Y.DefinitionID;        } -       +        friend bool operator>=(const ObjCCategoriesInfo &X,                               const ObjCCategoriesInfo &Y) {          return X.DefinitionID >= Y.DefinitionID; diff --git a/include/clang/Serialization/ASTReader.h b/include/clang/Serialization/ASTReader.h index 82a74a64443d..0eecb6f5d65a 100644 --- a/include/clang/Serialization/ASTReader.h +++ b/include/clang/Serialization/ASTReader.h @@ -591,7 +591,7 @@ private:    llvm::DenseMap<serialization::DeclID, DeclContextVisibleUpdates>        PendingVisibleUpdates; -  /// The set of C++ or Objective-C classes that have forward  +  /// The set of C++ or Objective-C classes that have forward    /// declarations that have not yet been linked to their definitions.    llvm::SmallPtrSet<Decl *, 4> PendingDefinitions; @@ -662,10 +662,10 @@ private:    /// This vector is indexed by the Submodule ID (-1). NULL submodule entries    /// indicate that the particular submodule ID has not yet been loaded.    SmallVector<Module *, 2> SubmodulesLoaded; -   +    using GlobalSubmoduleMapType =        ContinuousRangeMap<serialization::SubmoduleID, ModuleFile *, 4>; -   +    /// Mapping from global submodule IDs to the module file in which the    /// submodule resides along with the offset that should be added to the    /// global submodule ID to produce a local ID. @@ -678,12 +678,12 @@ private:    /// A mapping from each of the hidden submodules to the deserialized    /// declarations in that submodule that could be made visible.    HiddenNamesMapType HiddenNamesMap; -   +    /// A module import, export, or conflict that hasn't yet been resolved.    struct UnresolvedModuleRef {      /// The file in which this module resides.      ModuleFile *File; -     +      /// The module that is importing or exporting.      Module *Mod; @@ -699,11 +699,11 @@ private:      /// String data.      StringRef String;    }; -   -  /// The set of module imports and exports that still need to be  + +  /// The set of module imports and exports that still need to be    /// resolved.    SmallVector<UnresolvedModuleRef, 2> UnresolvedModuleRefs; -   +    /// A vector containing selectors that have already been loaded.    ///    /// This vector is indexed by the Selector ID (-1). NULL selector @@ -1056,7 +1056,7 @@ private:    /// Objective-C protocols.    std::deque<InterestingDecl> PotentiallyInterestingDecls; -  /// The list of redeclaration chains that still need to be  +  /// The list of redeclaration chains that still need to be    /// reconstructed, and the local offset to the corresponding list    /// of redeclarations.    SmallVector<std::pair<Decl *, uint64_t>, 16> PendingDeclChains; @@ -1117,14 +1117,14 @@ private:    using KeyDeclsMap =        llvm::DenseMap<Decl *, SmallVector<serialization::DeclID, 2>>; -     +    /// A mapping from canonical declarations to the set of global    /// declaration IDs for key declaration that have been merged with that    /// canonical declaration. A key declaration is a formerly-canonical    /// declaration whose module did not import any other key declaration for that    /// entity. These are the IDs that we use as keys when finding redecl chains.    KeyDeclsMap KeyDecls; -   +    /// A mapping from DeclContexts to the semantic DeclContext that we    /// are treating as the definition of the entity. This is used, for instance,    /// when merging implicit instantiations of class templates across modules. @@ -1625,7 +1625,7 @@ public:    /// Determine whether we tried to load the global index, but failed,    /// e.g., because it is out-of-date or does not exist.    bool isGlobalIndexUnavailable() const; -   +    /// Initializes the ASTContext    void InitializeContext(); @@ -1654,7 +1654,7 @@ public:    /// Retrieve the name of the original source file name for the primary    /// module file.    StringRef getOriginalSourceFile() { -    return ModuleMgr.getPrimaryModule().OriginalSourceFileName;  +    return ModuleMgr.getPrimaryModule().OriginalSourceFileName;    }    /// Retrieve the name of the original source file name directly from @@ -1741,7 +1741,7 @@ public:    unsigned getTotalNumSubmodules() const {      return static_cast<unsigned>(SubmodulesLoaded.size());    } -   +    /// Returns the number of selectors found in the chain.    unsigned getTotalNumSelectors() const {      return static_cast<unsigned>(SelectorsLoaded.size()); @@ -1839,15 +1839,15 @@ public:      return cast_or_null<T>(GetLocalDecl(F, LocalID));    } -  /// Map a global declaration ID into the declaration ID used to  +  /// Map a global declaration ID into the declaration ID used to    /// refer to this declaration within the given module fule.    ///    /// \returns the global ID of the given declaration as known in the given    /// module file. -  serialization::DeclID  +  serialization::DeclID    mapGlobalIDToModuleFileGlobalID(ModuleFile &M,                                    serialization::DeclID GlobalID); -   +    /// Reads a declaration ID from the given position in a record in the    /// given module.    /// @@ -2067,7 +2067,7 @@ public:    /// Retrieve the global submodule ID given a module and its local ID    /// number. -  serialization::SubmoduleID  +  serialization::SubmoduleID    getGlobalSubmoduleID(ModuleFile &M, unsigned LocalID);    /// Retrieve the submodule that corresponds to a global submodule ID. diff --git a/include/clang/Serialization/ASTWriter.h b/include/clang/Serialization/ASTWriter.h index a93579930ff5..7ff5d65bd7d0 100644 --- a/include/clang/Serialization/ASTWriter.h +++ b/include/clang/Serialization/ASTWriter.h @@ -416,7 +416,7 @@ private:    /// The set of Objective-C class that have categories we    /// should serialize.    llvm::SetVector<ObjCInterfaceDecl *> ObjCClassesWithCategories; -                     +    /// The set of declarations that may have redeclaration chains that    /// need to be serialized.    llvm::SmallVector<const Decl *, 16> Redeclarations; @@ -424,7 +424,7 @@ private:    /// A cache of the first local declaration for "interesting"    /// redeclaration chains.    llvm::DenseMap<const Decl *, const Decl *> FirstLocalDeclCache; -                                       +    /// Mapping from SwitchCase statements to IDs.    llvm::DenseMap<SwitchCase *, unsigned> SwitchCaseIDs; @@ -475,7 +475,7 @@ private:    void WriteHeaderSearch(const HeaderSearch &HS);    void WritePreprocessorDetail(PreprocessingRecord &PPRec);    void WriteSubmodules(Module *WritingModule); -                                         +    void WritePragmaDiagnosticMappings(const DiagnosticsEngine &Diag,                                       bool isModule); diff --git a/include/clang/Serialization/ContinuousRangeMap.h b/include/clang/Serialization/ContinuousRangeMap.h index 2f909965db7e..73bf2ed10f04 100644 --- a/include/clang/Serialization/ContinuousRangeMap.h +++ b/include/clang/Serialization/ContinuousRangeMap.h @@ -72,14 +72,14 @@ public:             "Must insert keys in order.");      Rep.push_back(Val);    } -   +    void insertOrReplace(const value_type &Val) {      iterator I = std::lower_bound(Rep.begin(), Rep.end(), Val, Compare());      if (I != Rep.end() && I->first == Val.first) {        I->second = Val.second;        return;      } -     +      Rep.insert(I, Val);    } @@ -106,7 +106,7 @@ public:    reference back() { return Rep.back(); }    const_reference back() const { return Rep.back(); } -   +    /// An object that helps properly build a continuous range map    /// from a set of values.    class Builder { @@ -116,7 +116,7 @@ public:      explicit Builder(ContinuousRangeMap &Self) : Self(Self) {}      Builder(const Builder&) = delete;      Builder &operator=(const Builder&) = delete; -     +      ~Builder() {        llvm::sort(Self.Rep.begin(), Self.Rep.end(), Compare());        std::unique(Self.Rep.begin(), Self.Rep.end(), @@ -128,7 +128,7 @@ public:          return A == B;        });      } -     +      void insert(const value_type &Val) {        Self.Rep.push_back(Val);      } diff --git a/include/clang/Serialization/GlobalModuleIndex.h b/include/clang/Serialization/GlobalModuleIndex.h index f48d0cf17c49..d47fe9517d76 100644 --- a/include/clang/Serialization/GlobalModuleIndex.h +++ b/include/clang/Serialization/GlobalModuleIndex.h @@ -115,7 +115,7 @@ class GlobalModuleIndex {    /// The number of identifier lookup hits, where we recognize the    /// identifier.    unsigned NumIdentifierLookupHits; -   +    /// Internal constructor. Use \c readIndex() to read an index.    explicit GlobalModuleIndex(std::unique_ptr<llvm::MemoryBuffer> Buffer,                               llvm::BitstreamCursor Cursor); @@ -167,7 +167,7 @@ public:    /// A set of module files in which we found a result.    typedef llvm::SmallPtrSet<ModuleFile *, 4> HitSet; -   +    /// Look for all of the module files with information about the given    /// identifier, e.g., a global function, variable, or type with that name.    /// diff --git a/include/clang/Serialization/Module.h b/include/clang/Serialization/Module.h index 653981b1427c..d6e78e693109 100644 --- a/include/clang/Serialization/Module.h +++ b/include/clang/Serialization/Module.h @@ -173,7 +173,7 @@ public:    /// The generation of which this module file is a part.    unsigned Generation; -   +    /// The memory buffer that stores the data associated with    /// this AST file, owned by the PCMCache in the ModuleManager.    llvm::MemoryBuffer *Buffer; @@ -358,17 +358,17 @@ public:    /// the header files.    void *HeaderFileInfoTable = nullptr; -  // === Submodule information ===   +  // === Submodule information ===    /// The number of submodules in this module.    unsigned LocalNumSubmodules = 0; -   +    /// Base submodule ID for submodules local to this module.    serialization::SubmoduleID BaseSubmoduleID = 0; -   +    /// Remapping table for submodule IDs in this module.    ContinuousRangeMap<uint32_t, int, 2> SubmoduleRemap; -   +    // === Selectors ===    /// The number of selectors new to this file. @@ -431,13 +431,13 @@ public:    const serialization::DeclID *FileSortedDecls = nullptr;    unsigned NumFileSortedDecls = 0; -  /// Array of category list location information within this  +  /// Array of category list location information within this    /// module file, sorted by the definition ID.    const serialization::ObjCCategoriesInfo *ObjCCategoriesMap = nullptr; -   +    /// The number of redeclaration info entries in ObjCCategoriesMap.    unsigned LocalNumObjCCategoriesInMap = 0; -   +    /// The Objective-C category lists for categories known to this    /// module.    SmallVector<uint64_t, 1> ObjCCategories; diff --git a/include/clang/Serialization/ModuleFileExtension.h b/include/clang/Serialization/ModuleFileExtension.h index f7bdcec598f1..f70218e329af 100644 --- a/include/clang/Serialization/ModuleFileExtension.h +++ b/include/clang/Serialization/ModuleFileExtension.h @@ -26,7 +26,7 @@ namespace clang {  class ASTReader;  class ASTWriter;  class Sema; -   +  namespace serialization {    class ModuleFile;  } // end namespace serialization @@ -128,7 +128,7 @@ public:  /// Abstract base class that reads a module file extension block from  /// a module file.  /// -/// Subclasses  +/// Subclasses  class ModuleFileExtensionReader {    ModuleFileExtension *Extension; diff --git a/include/clang/Serialization/ModuleManager.h b/include/clang/Serialization/ModuleManager.h index e101e60b21a3..cfc9a2ef112c 100644 --- a/include/clang/Serialization/ModuleManager.h +++ b/include/clang/Serialization/ModuleManager.h @@ -82,7 +82,7 @@ class ModuleManager {    /// The visitation order.    SmallVector<ModuleFile *, 4> VisitOrder; -       +    /// The list of module files that both we and the global module index    /// know about.    /// @@ -150,13 +150,13 @@ public:    /// Forward iterator end-point to traverse all loaded modules    ModuleIterator end() { return Chain.end(); } -   +    /// Const forward iterator to traverse all loaded modules.    ModuleConstIterator begin() const { return Chain.begin(); }    /// Const forward iterator end-point to traverse all loaded modules    ModuleConstIterator end() const { return Chain.end(); } -   +    /// Reverse iterator to traverse all loaded modules.    ModuleReverseIterator rbegin() { return Chain.rbegin(); } @@ -172,14 +172,14 @@ public:    /// Returns the primary module associated with the manager, that is,    /// the first module loaded    ModuleFile &getPrimaryModule() { return *Chain[0]; } -   +    /// Returns the primary module associated with the manager, that is,    /// the first module loaded.    ModuleFile &getPrimaryModule() const { return *Chain[0]; } -   +    /// Returns the module associated with the given index    ModuleFile &operator[](unsigned Index) const { return *Chain[Index]; } -   +    /// Returns the module associated with the given file name.    ModuleFile *lookupByFileName(StringRef FileName) const; @@ -191,7 +191,7 @@ public:    /// Returns the in-memory (virtual file) buffer with the given name    std::unique_ptr<llvm::MemoryBuffer> lookupBuffer(StringRef Name); -   +    /// Number of modules loaded    unsigned size() const { return Chain.size(); }  | 
