diff options
Diffstat (limited to 'include/clang/Lex')
22 files changed, 166 insertions, 166 deletions
diff --git a/include/clang/Lex/CodeCompletionHandler.h b/include/clang/Lex/CodeCompletionHandler.h index be153cc1ad508..87089fd7d50b0 100644 --- a/include/clang/Lex/CodeCompletionHandler.h +++ b/include/clang/Lex/CodeCompletionHandler.h @@ -18,13 +18,13 @@ namespace clang { class IdentifierInfo; class MacroInfo; - -/// Callback handler that receives notifications when performing code + +/// Callback handler that receives notifications when performing code /// completion within the preprocessor. class CodeCompletionHandler { public: virtual ~CodeCompletionHandler(); - + /// Callback invoked when performing code completion for a preprocessor /// directive. /// @@ -34,23 +34,23 @@ public: /// \param InConditional Whether we're inside a preprocessor conditional /// already. virtual void CodeCompleteDirective(bool InConditional) { } - + /// Callback invoked when performing code completion within a block of /// code that was excluded due to preprocessor conditionals. virtual void CodeCompleteInConditionalExclusion() { } - + /// Callback invoked when performing code completion in a context /// where the name of a macro is expected. /// /// \param IsDefinition Whether this is the definition of a macro, e.g., /// in a \#define. virtual void CodeCompleteMacroName(bool IsDefinition) { } - + /// Callback invoked when performing code completion in a preprocessor /// expression, such as the condition of an \#if or \#elif directive. virtual void CodeCompletePreprocessorExpression() { } - - /// Callback invoked when performing code completion inside a + + /// Callback invoked when performing code completion inside a /// function-like macro argument. /// /// There will be another callback invocation after the macro arguments are @@ -61,11 +61,11 @@ public: unsigned ArgumentIndex) { } /// Callback invoked when performing code completion in a part of the - /// file where we expect natural language, e.g., a comment, string, or + /// file where we expect natural language, e.g., a comment, string, or /// \#error directive. virtual void CodeCompleteNaturalLanguage() { } }; - + } #endif // LLVM_CLANG_LEX_CODECOMPLETIONHANDLER_H diff --git a/include/clang/Lex/DirectoryLookup.h b/include/clang/Lex/DirectoryLookup.h index 222ebf025ac04..55065b7d8547d 100644 --- a/include/clang/Lex/DirectoryLookup.h +++ b/include/clang/Lex/DirectoryLookup.h @@ -24,7 +24,7 @@ class DirectoryEntry; class FileEntry; class HeaderSearch; class Module; - + /// DirectoryLookup - This class represents one entry in the search list that /// specifies the search order for directories in \#include directives. It /// represents either a directory, a framework, or a headermap. @@ -54,14 +54,14 @@ private: /// LookupType - This indicates whether this DirectoryLookup object is a /// normal directory, a framework, or a headermap. unsigned LookupType : 2; - + /// Whether this is a header map used when building a framework. unsigned IsIndexHeaderMap : 1; /// Whether we've performed an exhaustive search for module maps /// within the subdirectories of this directory. unsigned SearchedAllModuleMaps : 1; - + public: /// DirectoryLookup ctor - Note that this ctor *does not take ownership* of /// 'dir'. @@ -140,10 +140,10 @@ public: } /// Whether this header map is building a framework or not. - bool isIndexHeaderMap() const { - return isHeaderMap() && IsIndexHeaderMap; + bool isIndexHeaderMap() const { + return isHeaderMap() && IsIndexHeaderMap; } - + /// LookupFile - Lookup the specified file in this search path, returning it /// if it exists or returning null if not. /// diff --git a/include/clang/Lex/ExternalPreprocessorSource.h b/include/clang/Lex/ExternalPreprocessorSource.h index f34be682617cd..d849bbd76188c 100644 --- a/include/clang/Lex/ExternalPreprocessorSource.h +++ b/include/clang/Lex/ExternalPreprocessorSource.h @@ -19,18 +19,18 @@ namespace clang { class IdentifierInfo; class Module; -/// Abstract interface for external sources of preprocessor +/// Abstract interface for external sources of preprocessor /// information. /// -/// This abstract class allows an external sources (such as the \c ASTReader) +/// This abstract class allows an external sources (such as the \c ASTReader) /// to provide additional preprocessing information. class ExternalPreprocessorSource { public: virtual ~ExternalPreprocessorSource(); - + /// Read the set of macros defined by this external macro source. virtual void ReadDefinedMacros() = 0; - + /// Update an out-of-date identifier. virtual void updateOutOfDateIdentifier(IdentifierInfo &II) = 0; @@ -42,7 +42,7 @@ public: /// Map a module ID to a module. virtual Module *getModule(unsigned ModuleID) = 0; }; - + } #endif diff --git a/include/clang/Lex/HeaderSearch.h b/include/clang/Lex/HeaderSearch.h index b7147c54faacd..6bb0f58f2db9d 100644 --- a/include/clang/Lex/HeaderSearch.h +++ b/include/clang/Lex/HeaderSearch.h @@ -74,9 +74,9 @@ struct HeaderFileInfo { /// Whether this structure is considered to already have been /// "resolved", meaning that it was loaded from the external source. unsigned Resolved : 1; - + /// Whether this is a header inside a framework that is currently - /// being built. + /// being built. /// /// When a framework is being built, the headers have not yet been placed /// into the appropriate framework subdirectories, and therefore are @@ -86,7 +86,7 @@ struct HeaderFileInfo { /// Whether this file has been looked up as a header. unsigned IsValid : 1; - + /// The number of times the file has been included already. unsigned short NumIncludes = 0; @@ -110,9 +110,9 @@ struct HeaderFileInfo { /// If this header came from a framework include, this is the name /// of the framework. StringRef Framework; - + HeaderFileInfo() - : isImport(false), isPragmaOnce(false), DirInfo(SrcMgr::C_User), + : isImport(false), isPragmaOnce(false), DirInfo(SrcMgr::C_User), External(false), isModuleHeader(false), isCompilingModuleHeader(false), Resolved(false), IndexHeaderMapHeader(false), IsValid(false) {} @@ -124,7 +124,7 @@ struct HeaderFileInfo { /// Determine whether this is a non-default header file info, e.g., /// it corresponds to an actual header we've included or tried to include. bool isNonDefault() const { - return isImport || isPragmaOnce || NumIncludes || ControllingMacro || + return isImport || isPragmaOnce || NumIncludes || ControllingMacro || ControllingMacroID; } }; @@ -134,15 +134,15 @@ struct HeaderFileInfo { class ExternalHeaderFileInfoSource { public: virtual ~ExternalHeaderFileInfoSource(); - + /// Retrieve the header file information for the given file entry. /// /// \returns Header file information for the given file entry, with the - /// \c External bit set. If the file entry is not known, return a + /// \c External bit set. If the file entry is not known, return a /// default-constructed \c HeaderFileInfo. virtual HeaderFileInfo GetHeaderFileInfo(const FileEntry *FE) = 0; }; - + /// Encapsulates the information needed to find the file referenced /// by a \#include or \#include_next, (sub-)framework lookup, etc. class HeaderSearch { @@ -186,7 +186,7 @@ class HeaderSearch { /// The path to the module cache. std::string ModuleCachePath; - + /// All of the preprocessor-specific data about files that are /// included, indexed by the FileEntry's UID. mutable std::vector<HeaderFileInfo> FileInfo; @@ -232,7 +232,7 @@ class HeaderSearch { /// The mapping between modules and headers. mutable ModuleMap ModMap; - + /// Describes whether a given directory has a module map in it. llvm::DenseMap<const DirectoryEntry *, bool> DirectoryHasModuleMap; @@ -240,10 +240,10 @@ class HeaderSearch { /// whether they were valid or not. llvm::DenseMap<const FileEntry *, bool> LoadedModuleMaps; - /// Uniqued set of framework names, which is used to track which + /// Uniqued set of framework names, which is used to track which /// headers were included as framework headers. llvm::StringSet<llvm::BumpPtrAllocator> FrameworkNames; - + /// Entity used to resolve the identifier IDs of controlling /// macros into IdentifierInfo pointers, and keep the identifire up to date, /// as needed. @@ -251,7 +251,7 @@ class HeaderSearch { /// Entity used to look up stored header file information. ExternalHeaderFileInfoSource *ExternalSource = nullptr; - + // Various statistics we track for performance analysis. unsigned NumIncluded = 0; unsigned NumMultiIncludeFileOptzn = 0; @@ -269,7 +269,7 @@ public: /// Retrieve the header-search options with which this header search /// was initialized. HeaderSearchOptions &getHeaderSearchOpts() const { return *HSOpts; } - + FileManager &getFileMgr() const { return FileMgr; } DiagnosticsEngine &getDiags() const { return Diags; } @@ -306,7 +306,7 @@ public: /// Map the source include name to the dest include name. /// - /// The Source should include the angle brackets or quotes, the dest + /// The Source should include the angle brackets or quotes, the dest /// should not. This allows for distinction between <> and "" headers. void AddIncludeAlias(StringRef Source, StringRef Dest) { if (!IncludeAliases) @@ -332,7 +332,7 @@ public: void setModuleCachePath(StringRef CachePath) { ModuleCachePath = CachePath; } - + /// Retrieve the path to the module cache. StringRef getModuleCachePath() const { return ModuleCachePath; } @@ -340,7 +340,7 @@ public: void setDirectoryHasModuleMap(const DirectoryEntry* Dir) { DirectoryHasModuleMap[Dir] = true; } - + /// Forget everything we know about headers so far. void ClearFileInfo() { FileInfo.clear(); @@ -353,16 +353,16 @@ public: ExternalPreprocessorSource *getExternalLookup() const { return ExternalLookup; } - + /// Set the external source of header information. void SetExternalSource(ExternalHeaderFileInfoSource *ES) { ExternalSource = ES; } - + /// Set the target information for the header search, if not /// already known. void setTarget(const TargetInfo &Target); - + /// Given a "foo" or \<foo> reference, look up the indicated file, /// return null on failure. /// @@ -540,7 +540,7 @@ public: /// \c nullptr if none is found. const FileEntry *lookupModuleMapFile(const DirectoryEntry *Dir, bool IsFramework); - + void IncrementFrameworkLookupCount() { ++NumFrameworkLookups; } /// Determine whether there is a module map that may map the header @@ -556,7 +556,7 @@ public: /// header directories. bool hasModuleMap(StringRef Filename, const DirectoryEntry *Root, bool IsSystem); - + /// Retrieve the module that corresponds to the given file, if any. /// /// \param File The header that we wish to map to a module. @@ -617,7 +617,7 @@ private: /// frameworks. /// /// \returns The module, if found; otherwise, null. - Module *loadFrameworkModule(StringRef Name, + Module *loadFrameworkModule(StringRef Name, const DirectoryEntry *Dir, bool IsSystem); @@ -655,10 +655,10 @@ private: public: /// Retrieve the module map. ModuleMap &getModuleMap() { return ModMap; } - + /// Retrieve the module map. const ModuleMap &getModuleMap() const { return ModMap; } - + unsigned header_file_size() const { return FileInfo.size(); } /// Return the HeaderFileInfo structure for the specified FileEntry, @@ -722,7 +722,7 @@ public: bool *IsSystem = nullptr); void PrintStats(); - + size_t getTotalMemory() const; private: diff --git a/include/clang/Lex/HeaderSearchOptions.h b/include/clang/Lex/HeaderSearchOptions.h index 298179e91a6fd..e5b52b30323fa 100644 --- a/include/clang/Lex/HeaderSearchOptions.h +++ b/include/clang/Lex/HeaderSearchOptions.h @@ -14,7 +14,7 @@ #include "llvm/ADT/CachedHashString.h" #include "llvm/ADT/SetVector.h" #include "llvm/ADT/StringRef.h" -#include <cstdint> +#include <cstdint> #include <string> #include <vector> #include <map> @@ -36,7 +36,7 @@ enum IncludeDirGroup { Angled, /// Like Angled, but marks header maps used when building frameworks. - IndexHeaderMap, + IndexHeaderMap, /// Like Angled, but marks system directories. System, @@ -70,7 +70,7 @@ public: std::string Path; frontend::IncludeDirGroup Group; unsigned IsFramework : 1; - + /// IgnoreSysRoot - This is false if an absolute path should be treated /// relative to the sysroot, or true if it should always be the absolute /// path. diff --git a/include/clang/Lex/LiteralSupport.h b/include/clang/Lex/LiteralSupport.h index 1b6bf6bcffb0e..3843a5afd2b0e 100644 --- a/include/clang/Lex/LiteralSupport.h +++ b/include/clang/Lex/LiteralSupport.h @@ -208,7 +208,7 @@ class StringLiteralParser { const LangOptions &Features; const TargetInfo &Target; DiagnosticsEngine *Diags; - + unsigned MaxTokenLength; unsigned SizeBound; unsigned CharByteWidth; @@ -230,7 +230,7 @@ public: ResultPtr(ResultBuf.data()), hadError(false), Pascal(false) { init(StringToks); } - + bool hadError; bool Pascal; diff --git a/include/clang/Lex/MacroArgs.h b/include/clang/Lex/MacroArgs.h index a202550da3b3c..853eee2fd7792 100644 --- a/include/clang/Lex/MacroArgs.h +++ b/include/clang/Lex/MacroArgs.h @@ -27,7 +27,7 @@ namespace clang { /// MacroArgs - An instance of this class captures information about /// the formal arguments specified to a function-like macro invocation. -class MacroArgs final +class MacroArgs final : private llvm::TrailingObjects<MacroArgs, Token> { friend TrailingObjects; @@ -43,7 +43,7 @@ class MacroArgs final /// if in strict mode and the C99 varargs macro had only a ... argument, this /// is false. bool VarargsElided; - + /// PreExpArgTokens - Pre-expanded tokens for arguments that need them. Empty /// if not yet computed. This includes the EOF marker at the end of the /// stream. @@ -115,7 +115,7 @@ public: /// Returns true if the macro was defined with a variadic (ellipsis) parameter /// AND was invoked with at least one token supplied as a variadic argument. /// - /// \code + /// \code /// #define F(a) a /// #define V(a, ...) __VA_OPT__(a) /// F() <-- returns false on this invocation. @@ -123,7 +123,7 @@ public: /// V(,) <-- returns false on this invocation. /// \endcode /// - + bool invokedWithVariadicArgument(const MacroInfo *const MI) const; /// StringifyArgument - Implement C99 6.10.3.2p2, converting a sequence of @@ -135,8 +135,8 @@ public: Preprocessor &PP, bool Charify, SourceLocation ExpansionLocStart, SourceLocation ExpansionLocEnd); - - + + /// deallocate - This should only be called by the Preprocessor when managing /// its freelist. MacroArgs *deallocate(); diff --git a/include/clang/Lex/MacroInfo.h b/include/clang/Lex/MacroInfo.h index 13e5313a9c301..0cc1cb92e67e7 100644 --- a/include/clang/Lex/MacroInfo.h +++ b/include/clang/Lex/MacroInfo.h @@ -174,7 +174,7 @@ public: std::copy(List.begin(), List.end(), ParameterList); } - /// Parameters - The list of parameters for a function-like macro. This can + /// Parameters - The list of parameters for a function-like macro. This can /// be empty, for, e.g. "#define X()". using param_iterator = IdentifierInfo *const *; bool param_empty() const { return NumParameters == 0; } diff --git a/include/clang/Lex/ModuleLoader.h b/include/clang/Lex/ModuleLoader.h index a2766fa35984f..05396dd205970 100644 --- a/include/clang/Lex/ModuleLoader.h +++ b/include/clang/Lex/ModuleLoader.h @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// // -// This file defines the ModuleLoader interface, which is responsible for +// This file defines the ModuleLoader interface, which is responsible for // loading named modules. // //===----------------------------------------------------------------------===// @@ -80,7 +80,7 @@ public: : BuildingModule(BuildingModule) {} virtual ~ModuleLoader(); - + /// Returns true if this instance is building a module. bool buildingModule() const { return BuildingModule; @@ -90,17 +90,17 @@ public: void setBuildingModule(bool BuildingModuleFlag) { BuildingModule = BuildingModuleFlag; } - + /// Attempt to load the given module. /// - /// This routine attempts to load the module described by the given + /// This routine attempts to load the module described by the given /// parameters. /// /// \param ImportLoc The location of the 'import' keyword. /// /// \param Path The identifiers (and their locations) of the module /// "path", e.g., "std.vector" would be split into "std" and "vector". - /// + /// /// \param Visibility The visibility provided for the names in the loaded /// module. /// @@ -108,7 +108,7 @@ public: /// implicitly, due to the presence of an inclusion directive. Otherwise, /// it is being loaded due to an import declaration. /// - /// \returns If successful, returns the loaded module. Otherwise, returns + /// \returns If successful, returns the loaded module. Otherwise, returns /// NULL to indicate that the module could not be loaded. virtual ModuleLoadResult loadModule(SourceLocation ImportLoc, ModuleIdPath Path, @@ -177,7 +177,7 @@ public: return false; } }; - + } // namespace clang #endif // LLVM_CLANG_LEX_MODULELOADER_H diff --git a/include/clang/Lex/ModuleMap.h b/include/clang/Lex/ModuleMap.h index 577f4008978ea..aa519891c1ce8 100644 --- a/include/clang/Lex/ModuleMap.h +++ b/include/clang/Lex/ModuleMap.h @@ -69,7 +69,7 @@ public: virtual void moduleMapAddUmbrellaHeader(FileManager *FileMgr, const FileEntry *Header) {} }; - + class ModuleMap { SourceManager &SourceMgr; DiagnosticsEngine &Diags; @@ -78,11 +78,11 @@ class ModuleMap { HeaderSearch &HeaderInfo; llvm::SmallVector<std::unique_ptr<ModuleMapCallbacks>, 1> Callbacks; - + /// The directory used for Clang-supplied, builtin include headers, /// such as "stdint.h". const DirectoryEntry *BuiltinIncludeDir = nullptr; - + /// Language options used to parse the module map itself. /// /// These are always simple C language options. @@ -285,7 +285,7 @@ private: /// /// \returns The resolved export declaration, which will have a NULL pointer /// if the export could not be resolved. - Module::ExportDecl + Module::ExportDecl resolveExport(Module *Mod, const Module::UnresolvedExportDecl &Unresolved, bool Complain) const; @@ -494,13 +494,13 @@ public: /// using direct (qualified) name lookup. /// /// \param Name The name of the module to look up. - /// + /// /// \param Context The module for which we will look for a submodule. If /// null, we will look for a top-level module. /// /// \returns The named submodule, if known; otherwose, returns null. Module *lookupModuleQualified(StringRef Name, Module *Context) const; - + /// Find a new module or submodule, or create it if it does not already /// exist. /// @@ -645,7 +645,7 @@ public: /// Marks this header as being excluded from the given module. void excludeHeader(Module *Mod, Module::Header Header); - /// Parse the given module map file, and record any modules we + /// Parse the given module map file, and record any modules we /// encounter. /// /// \param File The file to be parsed. @@ -672,13 +672,13 @@ public: /// Dump the contents of the module map, for debugging purposes. void dump(); - + using module_iterator = llvm::StringMap<Module *>::const_iterator; module_iterator module_begin() const { return Modules.begin(); } module_iterator module_end() const { return Modules.end(); } }; - + } // namespace clang #endif // LLVM_CLANG_LEX_MODULEMAP_H diff --git a/include/clang/Lex/PPCallbacks.h b/include/clang/Lex/PPCallbacks.h index eb85bda840afe..45c2d18da6e2b 100644 --- a/include/clang/Lex/PPCallbacks.h +++ b/include/clang/Lex/PPCallbacks.h @@ -66,10 +66,10 @@ public: /// Callback invoked whenever an inclusion directive results in a /// file-not-found error. /// - /// \param FileName The name of the file being included, as written in the + /// \param FileName The name of the file being included, as written in the /// source code. /// - /// \param RecoveryPath If this client indicates that it can recover from + /// \param RecoveryPath If this client indicates that it can recover from /// this missing file, the client should set this as an additional header /// search patch. /// @@ -84,13 +84,13 @@ public: /// any kind (\c \#include, \c \#import, etc.) has been processed, regardless /// of whether the inclusion will actually result in an inclusion. /// - /// \param HashLoc The location of the '#' that starts the inclusion + /// \param HashLoc The location of the '#' that starts the inclusion /// directive. /// - /// \param IncludeTok The token that indicates the kind of inclusion + /// \param IncludeTok The token that indicates the kind of inclusion /// directive, e.g., 'include' or 'import'. /// - /// \param FileName The name of the file being included, as written in the + /// \param FileName The name of the file being included, as written in the /// source code. /// /// \param IsAngled Whether the file name was enclosed in angle brackets; @@ -99,7 +99,7 @@ public: /// \param FilenameRange The character range of the quotes or angle brackets /// for the written file name. /// - /// \param File The actual file that may be included by this inclusion + /// \param File The actual file that may be included by this inclusion /// directive. /// /// \param SearchPath Contains the search path which was used to find the file @@ -222,7 +222,7 @@ public: /// Called when an OpenCL extension is either disabled or /// enabled with a pragma. - virtual void PragmaOpenCLExtension(SourceLocation NameLoc, + virtual void PragmaOpenCLExtension(SourceLocation NameLoc, const IdentifierInfo *Name, SourceLocation StateLoc, unsigned State) { } @@ -269,13 +269,13 @@ public: const MacroDefinition &MD, const MacroDirective *Undef) { } - + /// Hook called whenever the 'defined' operator is seen. /// \param MD The MacroDirective if the name was a macro, null otherwise. virtual void Defined(const Token &MacroNameTok, const MacroDefinition &MD, SourceRange Range) { } - + /// Hook called when a source range is skipped. /// \param Range The SourceRange that was skipped. The range begins at the /// \#if/\#else directive and ends after the \#endif/\#else directive. diff --git a/include/clang/Lex/PPConditionalDirectiveRecord.h b/include/clang/Lex/PPConditionalDirectiveRecord.h index a653b8339948d..a2ccf1407f79c 100644 --- a/include/clang/Lex/PPConditionalDirectiveRecord.h +++ b/include/clang/Lex/PPConditionalDirectiveRecord.h @@ -20,12 +20,12 @@ #include <vector> namespace clang { - + /// Records preprocessor conditional directive regions and allows /// querying in which region source locations belong to. class PPConditionalDirectiveRecord : public PPCallbacks { SourceManager &SourceMgr; - + SmallVector<SourceLocation, 6> CondDirectiveStack; class CondDirectiveLoc { diff --git a/include/clang/Lex/PTHLexer.h b/include/clang/Lex/PTHLexer.h index f122a008e4aa1..0b84df1434aec 100644 --- a/include/clang/Lex/PTHLexer.h +++ b/include/clang/Lex/PTHLexer.h @@ -49,7 +49,7 @@ class PTHLexer : public PreprocessorLexer { /// ReadToken - Used by PTHLexer to read tokens TokBuf. void ReadToken(Token &T); - + bool LexEndOfFile(Token &Result); /// PTHMgr - The PTHManager object that created this PTHLexer. diff --git a/include/clang/Lex/Pragma.h b/include/clang/Lex/Pragma.h index 9348388bc28cf..4d74face52756 100644 --- a/include/clang/Lex/Pragma.h +++ b/include/clang/Lex/Pragma.h @@ -34,19 +34,19 @@ class Token; * The pragma was introduced via \#pragma. */ PIK_HashPragma, - + /** * The pragma was introduced via the C99 _Pragma(string-literal). */ PIK__Pragma, - + /** - * The pragma was introduced via the Microsoft + * The pragma was introduced via the Microsoft * __pragma(token-string). */ PIK___pragma }; - + /// PragmaHandler - Instances of this interface defined to handle the various /// pragmas that the language front-end uses. Each handler optionally has a /// name (e.g. "pack") and the HandlePragma method is invoked when a pragma with diff --git a/include/clang/Lex/PreprocessingRecord.h b/include/clang/Lex/PreprocessingRecord.h index 54e28a52f5b36..44d79d9b62290 100644 --- a/include/clang/Lex/PreprocessingRecord.h +++ b/include/clang/Lex/PreprocessingRecord.h @@ -66,13 +66,13 @@ class Token; /// A macro expansion. MacroExpansionKind, - + /// \defgroup Preprocessing directives /// @{ - + /// A macro definition. MacroDefinitionKind, - + /// An inclusion directive, such as \c \#include, \c /// \#import, or \c \#include_next. InclusionDirectiveKind, @@ -86,10 +86,10 @@ class Token; private: /// The kind of preprocessed entity that this object describes. EntityKind Kind; - + /// The source range that covers this preprocessed entity. SourceRange Range; - + protected: friend class PreprocessingRecord; @@ -99,8 +99,8 @@ class Token; public: /// Retrieve the kind of preprocessed entity stored in this object. EntityKind getKind() const { return Kind; } - - /// Retrieve the source range that covers this entire preprocessed + + /// Retrieve the source range that covers this entire preprocessed /// entity. SourceRange getSourceRange() const LLVM_READONLY { return Range; } @@ -108,7 +108,7 @@ class Token; /// entity. bool isInvalid() const { return Kind == InvalidKind; } - // Only allow allocation of preprocessed entities using the allocator + // Only allow allocation of preprocessed entities using the allocator // in PreprocessingRecord or by doing a placement new. void *operator new(size_t bytes, PreprocessingRecord &PR, unsigned alignment = 8) noexcept { @@ -130,15 +130,15 @@ class Token; void *operator new(size_t bytes) noexcept; void operator delete(void *data) noexcept; }; - + /// Records the presence of a preprocessor directive. class PreprocessingDirective : public PreprocessedEntity { public: - PreprocessingDirective(EntityKind Kind, SourceRange Range) + PreprocessingDirective(EntityKind Kind, SourceRange Range) : PreprocessedEntity(Kind, Range) {} - + // Implement isa/cast/dyncast/etc. - static bool classof(const PreprocessedEntity *PD) { + static bool classof(const PreprocessedEntity *PD) { return PD->getKind() >= FirstPreprocessingDirective && PD->getKind() <= LastPreprocessingDirective; } @@ -159,13 +159,13 @@ class Token; /// Retrieve the location of the macro name in the definition. SourceLocation getLocation() const { return getSourceRange().getBegin(); } - + // Implement isa/cast/dyncast/etc. static bool classof(const PreprocessedEntity *PE) { return PE->getKind() == MacroDefinitionKind; } }; - + /// Records the location of a macro expansion. class MacroExpansion : public PreprocessedEntity { /// The definition of this macro or the name of the macro if it is @@ -246,16 +246,16 @@ class Token; public: InclusionDirective(PreprocessingRecord &PPRec, - InclusionKind Kind, StringRef FileName, + InclusionKind Kind, StringRef FileName, bool InQuotes, bool ImportedModule, const FileEntry *File, SourceRange Range); - + /// Determine what kind of inclusion directive this is. InclusionKind getKind() const { return static_cast<InclusionKind>(Kind); } - + /// Retrieve the included file name as it was written in the source. StringRef getFileName() const { return FileName; } - + /// Determine whether the included file name was written in quotes; /// otherwise, it was written in angle brackets. bool wasInQuotes() const { return InQuotes; } @@ -263,23 +263,23 @@ class Token; /// Determine whether the inclusion directive was automatically /// turned into a module import. bool importedModule() const { return ImportedModule; } - + /// Retrieve the file entry for the actual file that was included /// by this directive. const FileEntry *getFile() const { return File; } - + // Implement isa/cast/dyncast/etc. static bool classof(const PreprocessedEntity *PE) { return PE->getKind() == InclusionDirectiveKind; } }; - + /// An abstract class that should be subclassed by any external source /// of preprocessing record entries. class ExternalPreprocessingRecordSource { public: virtual ~ExternalPreprocessingRecordSource(); - + /// Read a preallocated preprocessed entity from the external source. /// /// \returns null if an error occurred that prevented the preprocessed @@ -301,20 +301,20 @@ class Token; /// Read a preallocated skipped range from the external source. virtual SourceRange ReadSkippedRange(unsigned Index) = 0; }; - + /// A record of the steps taken while preprocessing a source file, - /// including the various preprocessing directives processed, macros + /// including the various preprocessing directives processed, macros /// expanded, etc. class PreprocessingRecord : public PPCallbacks { SourceManager &SourceMgr; - + /// Allocator used to store preprocessing objects. llvm::BumpPtrAllocator BumpAlloc; /// The set of preprocessed entities in this record, in order they /// were seen. std::vector<PreprocessedEntity *> PreprocessedEntities; - + /// The set of preprocessed entities in this record that have been /// loaded from external sources. /// @@ -362,7 +362,7 @@ class Token; /// Retrieve the loaded preprocessed entity at the given index. PreprocessedEntity *getLoadedPreprocessedEntity(unsigned Index); - + /// Determine the number of preprocessed entities that were /// loaded (or can be loaded) from an external source. unsigned getNumLoadedPreprocessedEntities() const { @@ -403,7 +403,7 @@ class Token; void *Allocate(unsigned Size, unsigned Align = 8) { return BumpAlloc.Allocate(Size, Align); } - + /// Deallocate memory in the preprocessing record. void Deallocate(void *Ptr) {} @@ -518,7 +518,7 @@ class Token; ensureSkippedRangesLoaded(); return SkippedRanges; } - + private: friend class ASTReader; friend class ASTWriter; diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 4ec29fe8f331c..e718f5b6bbd00 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -255,7 +255,7 @@ class Preprocessor { /// with this preprocessor. std::vector<CommentHandler *> CommentHandlers; - /// True if we want to ignore EOF token and continue later on (thus + /// True if we want to ignore EOF token and continue later on (thus /// avoid tearing the Lexer and etc. down). bool IncrementalProcessing = false; @@ -281,7 +281,7 @@ class Preprocessor { /// for preprocessing. SourceLocation CodeCompletionFileLoc; - /// The source location of the \c import contextual keyword we just + /// The source location of the \c import contextual keyword we just /// lexed, if any. SourceLocation ModuleImportLoc; @@ -294,7 +294,7 @@ class Preprocessor { /// Whether the module import expects an identifier next. Otherwise, /// it expects a '.' or ';'. bool ModuleImportExpectsIdentifier = false; - + /// The source location of the currently-active /// \#pragma clang arc_cf_code_audited begin. SourceLocation PragmaARCCFCodeAuditedLoc; @@ -814,7 +814,7 @@ public: /// Retrieve the preprocessor options used to initialize this /// preprocessor. PreprocessorOptions &getPreprocessorOpts() const { return *PPOpts; } - + DiagnosticsEngine &getDiagnostics() const { return *Diags; } void setDiagnostics(DiagnosticsEngine &D) { Diags = &D; } @@ -852,7 +852,7 @@ public: } /// True if we are currently preprocessing a #if or #elif directive - bool isParsingIfOrElifDirective() const { + bool isParsingIfOrElifDirective() const { return ParsingIfOrElifDirective; } @@ -1439,7 +1439,7 @@ public: void enableIncrementalProcessing(bool value = true) { IncrementalProcessing = value; } - + /// Specify the point at which code-completion will be performed. /// /// \param File the file in which code completion should occur. If @@ -1630,7 +1630,7 @@ public: } /// Plop the specified string into a scratch buffer and set the - /// specified token's location and length to it. + /// specified token's location and length to it. /// /// If specified, the source location provides a location of the expansion /// point of the token. @@ -1769,7 +1769,7 @@ public: void PoisonSEHIdentifiers(bool Poison = true); // Borland /// Callback invoked when the lexer reads an identifier and has - /// filled in the tokens IdentifierInfo member. + /// filled in the tokens IdentifierInfo member. /// /// This callback potentially macro expands it or turns it into a named /// token (like 'for'). @@ -1817,12 +1817,12 @@ public: /// Retrieves the module that we're currently building, if any. Module *getCurrentModule(); - + /// Allocate a new MacroInfo object with the provided SourceLocation. MacroInfo *AllocateMacroInfo(SourceLocation L); /// Turn the specified lexer token into a fully checked and spelled - /// filename, e.g. as an operand of \#include. + /// filename, e.g. as an operand of \#include. /// /// The caller is expected to provide a buffer that is large enough to hold /// the spelling of the filename, but is also expected to handle the case @@ -1846,7 +1846,7 @@ public: bool *IsMapped, bool SkipCache = false); /// Get the DirectoryLookup structure used to find the current - /// FileEntry, if CurLexer is non-null and if applicable. + /// FileEntry, if CurLexer is non-null and if applicable. /// /// This allows us to implement \#include_next and find directory-specific /// properties. @@ -1856,7 +1856,7 @@ public: bool isInPrimaryFile() const; /// Handle cases where the \#include name is expanded - /// from a macro as multiple tokens, which need to be glued together. + /// from a macro as multiple tokens, which need to be glued together. /// /// This occurs for code like: /// \code @@ -1939,7 +1939,7 @@ private: /// - # (stringization) is followed by a macro parameter /// \param MacroNameTok - Token that represents the macro name /// \param ImmediatelyAfterHeaderGuard - Macro follows an #ifdef header guard - /// + /// /// Either returns a pointer to a MacroInfo object OR emits a diagnostic and /// returns a nullptr if an invalid sequence of tokens is encountered. MacroInfo *ReadOptionalMacroParameterListAndBody( diff --git a/include/clang/Lex/PreprocessorLexer.h b/include/clang/Lex/PreprocessorLexer.h index bb02725b116f0..b619f192f5306 100644 --- a/include/clang/Lex/PreprocessorLexer.h +++ b/include/clang/Lex/PreprocessorLexer.h @@ -169,12 +169,12 @@ public: using conditional_iterator = SmallVectorImpl<PPConditionalInfo>::const_iterator; - conditional_iterator conditional_begin() const { - return ConditionalStack.begin(); + conditional_iterator conditional_begin() const { + return ConditionalStack.begin(); } - conditional_iterator conditional_end() const { - return ConditionalStack.end(); + conditional_iterator conditional_end() const { + return ConditionalStack.end(); } void setConditionalLevels(ArrayRef<PPConditionalInfo> CL) { diff --git a/include/clang/Lex/PreprocessorOptions.h b/include/clang/Lex/PreprocessorOptions.h index 3d7e5ab4a8dc7..5134aeaa6a297 100644 --- a/include/clang/Lex/PreprocessorOptions.h +++ b/include/clang/Lex/PreprocessorOptions.h @@ -13,7 +13,7 @@ #include "clang/Basic/LLVM.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringSet.h" -#include <memory> +#include <memory> #include <set> #include <string> #include <utility> @@ -27,7 +27,7 @@ class MemoryBuffer; namespace clang { -/// Enumerate the kinds of standard library that +/// Enumerate the kinds of standard library that enum ObjCXXARCStandardLibraryKind { ARCXX_nolib, @@ -37,7 +37,7 @@ enum ObjCXXARCStandardLibraryKind { /// libstdc++ ARCXX_libstdcxx }; - + /// PreprocessorOptions - This class is used for passing the various options /// used in preprocessor initialization to InitializePreprocessor(). class PreprocessorOptions { @@ -136,15 +136,15 @@ public: /// the buffers associated with remapped files. /// /// This flag defaults to false; it can be set true only through direct - /// manipulation of the compiler invocation object, in cases where the + /// manipulation of the compiler invocation object, in cases where the /// compiler invocation and its buffers will be reused. bool RetainRemappedFileBuffers = false; - + /// The Objective-C++ ARC standard library that we should support, /// by providing appropriate definitions to retrofit the standard library /// with support for lifetime-qualified pointers. ObjCXXARCStandardLibraryKind ObjCXXARCStandardLibrary = ARCXX_nolib; - + /// Records the set of modules class FailedModulesSet { llvm::StringSet<> Failed; @@ -158,7 +158,7 @@ public: Failed.insert(module); } }; - + /// The set of modules that failed to build. /// /// This pointer will be shared among all of the compiler instances created @@ -185,7 +185,7 @@ public: RemappedFiles.clear(); RemappedFileBuffers.clear(); } - + /// Reset any options that are not considered when building a /// module. void resetNonModularOptions() { diff --git a/include/clang/Lex/Token.h b/include/clang/Lex/Token.h index 633e1d15697b9..85bef728197d8 100644 --- a/include/clang/Lex/Token.h +++ b/include/clang/Lex/Token.h @@ -73,7 +73,7 @@ public: enum TokenFlags { StartOfLine = 0x01, // At start of line or only after whitespace // (considering the line after macro expansion). - LeadingSpace = 0x02, // Whitespace exists before this token (considering + LeadingSpace = 0x02, // Whitespace exists before this token (considering // whitespace after macro expansion). DisableExpand = 0x04, // This identifier may never be macro expanded. NeedsCleaning = 0x08, // Contained an escaped newline or trigraph. diff --git a/include/clang/Lex/TokenConcatenation.h b/include/clang/Lex/TokenConcatenation.h index a2d98b0d473a3..60c182b509a4d 100644 --- a/include/clang/Lex/TokenConcatenation.h +++ b/include/clang/Lex/TokenConcatenation.h @@ -58,8 +58,8 @@ namespace clang { public: TokenConcatenation(Preprocessor &PP); - bool AvoidConcat(const Token &PrevPrevTok, - const Token &PrevTok, + bool AvoidConcat(const Token &PrevPrevTok, + const Token &PrevTok, const Token &Tok) const; private: diff --git a/include/clang/Lex/TokenLexer.h b/include/clang/Lex/TokenLexer.h index e616d497eec69..98935ad9c4fa2 100644 --- a/include/clang/Lex/TokenLexer.h +++ b/include/clang/Lex/TokenLexer.h @@ -65,7 +65,7 @@ class TokenLexer { /// Source location pointing at the source location entry chunk that /// was reserved for the current macro expansion. SourceLocation MacroExpansionStart; - + /// The offset of the macro expansion in the /// "source location address space". unsigned MacroStartSLocOffset; diff --git a/include/clang/Lex/VariadicMacroSupport.h b/include/clang/Lex/VariadicMacroSupport.h index 55202ffc34d75..3a7a955953f4f 100644 --- a/include/clang/Lex/VariadicMacroSupport.h +++ b/include/clang/Lex/VariadicMacroSupport.h @@ -71,10 +71,10 @@ namespace clang { class VAOptDefinitionContext { /// Contains all the locations of so far unmatched lparens. SmallVector<SourceLocation, 8> UnmatchedOpeningParens; - + const IdentifierInfo *const Ident__VA_OPT__; - - + + public: VAOptDefinitionContext(Preprocessor &PP) : Ident__VA_OPT__(PP.Ident__VA_OPT__) {} @@ -86,12 +86,12 @@ namespace clang { /// Returns true if we have seen the __VA_OPT__ and '(' but before having /// seen the matching ')'. bool isInVAOpt() const { return UnmatchedOpeningParens.size(); } - + /// Call this function as soon as you see __VA_OPT__ and '('. void sawVAOptFollowedByOpeningParens(const SourceLocation LParenLoc) { assert(!isInVAOpt() && "Must NOT be within VAOPT context to call this"); UnmatchedOpeningParens.push_back(LParenLoc); - + } SourceLocation getUnmatchedOpeningParenLoc() const { @@ -107,13 +107,13 @@ namespace clang { UnmatchedOpeningParens.pop_back(); return !UnmatchedOpeningParens.size(); } - + /// Call this function each time an lparen is seen. void sawOpeningParen(SourceLocation LParenLoc) { assert(isInVAOpt() && "Must be within VAOPT context to call this"); UnmatchedOpeningParens.push_back(LParenLoc); } - + }; /// A class for tracking whether we're inside a VA_OPT during a @@ -133,11 +133,11 @@ namespace clang { int NumOfTokensPriorToVAOpt = -1; unsigned LeadingSpaceForStringifiedToken : 1; - + unsigned StringifyBefore : 1; unsigned CharifyBefore : 1; - - + + bool hasStringifyBefore() const { assert(!isReset() && "Must only be called if the state has not been reset"); @@ -169,14 +169,14 @@ namespace clang { void sawHashOrHashAtBefore(const bool HasLeadingSpace, const bool IsHashAt) { - + StringifyBefore = !IsHashAt; CharifyBefore = IsHashAt; LeadingSpaceForStringifiedToken = HasLeadingSpace; } - - + + bool hasCharifyBefore() const { assert(!isReset() && "Must only be called if the state has not been reset"); @@ -185,13 +185,13 @@ namespace clang { bool hasStringifyOrCharifyBefore() const { return hasStringifyBefore() || hasCharifyBefore(); } - + unsigned int getNumberOfTokensPriorToVAOpt() const { assert(!isReset() && "Must only be called if the state has not been reset"); return NumOfTokensPriorToVAOpt; } - + bool getLeadingSpaceForStringifiedToken() const { assert(hasStringifyBefore() && "Must only be called if this has been marked for stringification"); @@ -219,7 +219,7 @@ namespace clang { using VAOptDefinitionContext::isInVAOpt; using VAOptDefinitionContext::sawClosingParen; using VAOptDefinitionContext::sawOpeningParen; - + }; } // end namespace clang |