Remove trailing space

sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h}

llvm-svn: 338291
This commit is contained in:
Fangrui Song 2018-07-30 19:24:48 +00:00
parent ce9b3e084c
commit 6907ce2f8f
432 changed files with 7748 additions and 7748 deletions

View File

@ -160,7 +160,7 @@ typedef struct CXVersion {
int Major; int Major;
/** /**
* The minor version number, e.g., the '7' in '10.7.3'. This value * The minor version number, e.g., the '7' in '10.7.3'. This value
* will be negative if no minor version number was provided, e.g., for * will be negative if no minor version number was provided, e.g., for
* version '10'. * version '10'.
*/ */
int Minor; int Minor;
@ -387,7 +387,7 @@ CINDEX_LINKAGE int clang_getFileUniqueID(CXFile file, CXFileUniqueID *outID);
* multiple inclusions, either with the conventional * multiple inclusions, either with the conventional
* \#ifndef/\#define/\#endif macro guards or with \#pragma once. * \#ifndef/\#define/\#endif macro guards or with \#pragma once.
*/ */
CINDEX_LINKAGE unsigned CINDEX_LINKAGE unsigned
clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file); clang_isFileMultipleIncludeGuarded(CXTranslationUnit tu, CXFile file);
/** /**
@ -786,7 +786,7 @@ typedef void *CXDiagnostic;
* A group of CXDiagnostics. * A group of CXDiagnostics.
*/ */
typedef void *CXDiagnosticSet; typedef void *CXDiagnosticSet;
/** /**
* Determine the number of diagnostics in a CXDiagnosticSet. * Determine the number of diagnostics in a CXDiagnosticSet.
*/ */
@ -802,7 +802,7 @@ CINDEX_LINKAGE unsigned clang_getNumDiagnosticsInSet(CXDiagnosticSet Diags);
* via a call to \c clang_disposeDiagnostic(). * via a call to \c clang_disposeDiagnostic().
*/ */
CINDEX_LINKAGE CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags, CINDEX_LINKAGE CXDiagnostic clang_getDiagnosticInSet(CXDiagnosticSet Diags,
unsigned Index); unsigned Index);
/** /**
* Describes the kind of error that occurred (if any) in a call to * Describes the kind of error that occurred (if any) in a call to
@ -813,26 +813,26 @@ enum CXLoadDiag_Error {
* Indicates that no error occurred. * Indicates that no error occurred.
*/ */
CXLoadDiag_None = 0, CXLoadDiag_None = 0,
/** /**
* Indicates that an unknown error occurred while attempting to * Indicates that an unknown error occurred while attempting to
* deserialize diagnostics. * deserialize diagnostics.
*/ */
CXLoadDiag_Unknown = 1, CXLoadDiag_Unknown = 1,
/** /**
* Indicates that the file containing the serialized diagnostics * Indicates that the file containing the serialized diagnostics
* could not be opened. * could not be opened.
*/ */
CXLoadDiag_CannotLoad = 2, CXLoadDiag_CannotLoad = 2,
/** /**
* Indicates that the serialized diagnostics file is invalid or * Indicates that the serialized diagnostics file is invalid or
* corrupt. * corrupt.
*/ */
CXLoadDiag_InvalidFile = 3 CXLoadDiag_InvalidFile = 3
}; };
/** /**
* Deserialize a set of diagnostics from a Clang diagnostics bitcode * Deserialize a set of diagnostics from a Clang diagnostics bitcode
* file. * file.
@ -856,7 +856,7 @@ CINDEX_LINKAGE CXDiagnosticSet clang_loadDiagnostics(const char *file,
CINDEX_LINKAGE void clang_disposeDiagnosticSet(CXDiagnosticSet Diags); CINDEX_LINKAGE void clang_disposeDiagnosticSet(CXDiagnosticSet Diags);
/** /**
* Retrieve the child diagnostics of a CXDiagnostic. * Retrieve the child diagnostics of a CXDiagnostic.
* *
* This CXDiagnosticSet does not need to be released by * This CXDiagnosticSet does not need to be released by
* clang_disposeDiagnosticSet. * clang_disposeDiagnosticSet.
@ -888,7 +888,7 @@ CINDEX_LINKAGE CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit,
* \param Unit the translation unit to query. * \param Unit the translation unit to query.
*/ */
CINDEX_LINKAGE CXDiagnosticSet CINDEX_LINKAGE CXDiagnosticSet
clang_getDiagnosticSetFromTU(CXTranslationUnit Unit); clang_getDiagnosticSetFromTU(CXTranslationUnit Unit);
/** /**
* Destroy a diagnostic. * Destroy a diagnostic.
@ -934,7 +934,7 @@ enum CXDiagnosticDisplayOptions {
* \c -fdiagnostics-print-source-range-info. * \c -fdiagnostics-print-source-range-info.
*/ */
CXDiagnostic_DisplaySourceRanges = 0x04, CXDiagnostic_DisplaySourceRanges = 0x04,
/** /**
* Display the option name associated with this diagnostic, if any. * Display the option name associated with this diagnostic, if any.
* *
@ -943,12 +943,12 @@ enum CXDiagnosticDisplayOptions {
* \c -fdiagnostics-show-option. * \c -fdiagnostics-show-option.
*/ */
CXDiagnostic_DisplayOption = 0x08, CXDiagnostic_DisplayOption = 0x08,
/** /**
* Display the category number associated with this diagnostic, if any. * Display the category number associated with this diagnostic, if any.
* *
* The category number is displayed within brackets after the diagnostic text. * The category number is displayed within brackets after the diagnostic text.
* This option corresponds to the clang flag * This option corresponds to the clang flag
* \c -fdiagnostics-show-category=id. * \c -fdiagnostics-show-category=id.
*/ */
CXDiagnostic_DisplayCategoryId = 0x10, CXDiagnostic_DisplayCategoryId = 0x10,
@ -957,7 +957,7 @@ enum CXDiagnosticDisplayOptions {
* Display the category name associated with this diagnostic, if any. * Display the category name associated with this diagnostic, if any.
* *
* The category name is displayed within brackets after the diagnostic text. * The category name is displayed within brackets after the diagnostic text.
* This option corresponds to the clang flag * This option corresponds to the clang flag
* \c -fdiagnostics-show-category=name. * \c -fdiagnostics-show-category=name.
*/ */
CXDiagnostic_DisplayCategoryName = 0x20 CXDiagnostic_DisplayCategoryName = 0x20
@ -1019,7 +1019,7 @@ CINDEX_LINKAGE CXString clang_getDiagnosticSpelling(CXDiagnostic);
* diagnostic (if any). * diagnostic (if any).
* *
* \returns A string that contains the command-line option used to enable this * \returns A string that contains the command-line option used to enable this
* warning, such as "-Wconversion" or "-pedantic". * warning, such as "-Wconversion" or "-pedantic".
*/ */
CINDEX_LINKAGE CXString clang_getDiagnosticOption(CXDiagnostic Diag, CINDEX_LINKAGE CXString clang_getDiagnosticOption(CXDiagnostic Diag,
CXString *Disable); CXString *Disable);
@ -1028,7 +1028,7 @@ CINDEX_LINKAGE CXString clang_getDiagnosticOption(CXDiagnostic Diag,
* Retrieve the category number for this diagnostic. * Retrieve the category number for this diagnostic.
* *
* Diagnostics can be categorized into groups along with other, related * Diagnostics can be categorized into groups along with other, related
* diagnostics (e.g., diagnostics under the same warning flag). This routine * diagnostics (e.g., diagnostics under the same warning flag). This routine
* retrieves the category number for the given diagnostic. * retrieves the category number for the given diagnostic.
* *
* \returns The number of the category that contains this diagnostic, or zero * \returns The number of the category that contains this diagnostic, or zero
@ -1041,7 +1041,7 @@ CINDEX_LINKAGE unsigned clang_getDiagnosticCategory(CXDiagnostic);
* is now deprecated. Use clang_getDiagnosticCategoryText() * is now deprecated. Use clang_getDiagnosticCategoryText()
* instead. * instead.
* *
* \param Category A diagnostic category number, as returned by * \param Category A diagnostic category number, as returned by
* \c clang_getDiagnosticCategory(). * \c clang_getDiagnosticCategory().
* *
* \returns The name of the given diagnostic category. * \returns The name of the given diagnostic category.
@ -1055,7 +1055,7 @@ CXString clang_getDiagnosticCategoryName(unsigned Category);
* \returns The text of the given diagnostic category. * \returns The text of the given diagnostic category.
*/ */
CINDEX_LINKAGE CXString clang_getDiagnosticCategoryText(CXDiagnostic); CINDEX_LINKAGE CXString clang_getDiagnosticCategoryText(CXDiagnostic);
/** /**
* Determine the number of source ranges associated with the given * Determine the number of source ranges associated with the given
* diagnostic. * diagnostic.
@ -1242,9 +1242,9 @@ enum CXTranslationUnit_Flags {
* intent of producing a precompiled header. * intent of producing a precompiled header.
*/ */
CXTranslationUnit_Incomplete = 0x02, CXTranslationUnit_Incomplete = 0x02,
/** /**
* Used to indicate that the translation unit should be built with an * Used to indicate that the translation unit should be built with an
* implicit precompiled header for the preamble. * implicit precompiled header for the preamble.
* *
* An implicit precompiled header is used as an optimization when a * An implicit precompiled header is used as an optimization when a
@ -1258,7 +1258,7 @@ enum CXTranslationUnit_Flags {
* precompiled header to improve parsing performance. * precompiled header to improve parsing performance.
*/ */
CXTranslationUnit_PrecompiledPreamble = 0x04, CXTranslationUnit_PrecompiledPreamble = 0x04,
/** /**
* Used to indicate that the translation unit should cache some * Used to indicate that the translation unit should cache some
* code-completion results with each reparse of the source file. * code-completion results with each reparse of the source file.
@ -1343,7 +1343,7 @@ enum CXTranslationUnit_Flags {
* to indicate that the translation unit is likely to be reparsed many times, * to indicate that the translation unit is likely to be reparsed many times,
* either explicitly (via \c clang_reparseTranslationUnit()) or implicitly * either explicitly (via \c clang_reparseTranslationUnit()) or implicitly
* (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag * (e.g., by code completion (\c clang_codeCompletionAt())). The returned flag
* set contains an unspecified set of optimizations (e.g., the precompiled * set contains an unspecified set of optimizations (e.g., the precompiled
* preamble) geared toward improving the performance of these routines. The * preamble) geared toward improving the performance of these routines. The
* set of optimizations enabled may change from one version to the next. * set of optimizations enabled may change from one version to the next.
*/ */
@ -1374,7 +1374,7 @@ clang_parseTranslationUnit(CXIndex CIdx,
* command-line arguments so that the compilation can be configured in the same * command-line arguments so that the compilation can be configured in the same
* way that the compiler is configured on the command line. * way that the compiler is configured on the command line.
* *
* \param CIdx The index object with which the translation unit will be * \param CIdx The index object with which the translation unit will be
* associated. * associated.
* *
* \param source_filename The name of the source file to load, or NULL if the * \param source_filename The name of the source file to load, or NULL if the
@ -1383,7 +1383,7 @@ clang_parseTranslationUnit(CXIndex CIdx,
* \param command_line_args The command-line arguments that would be * \param command_line_args The command-line arguments that would be
* passed to the \c clang executable if it were being invoked out-of-process. * passed to the \c clang executable if it were being invoked out-of-process.
* These command-line options will be parsed and will affect how the translation * These command-line options will be parsed and will affect how the translation
* unit is parsed. Note that the following options are ignored: '-c', * unit is parsed. Note that the following options are ignored: '-c',
* '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'. * '-emit-ast', '-fsyntax-only' (which is the default), and '-o \<output file>'.
* *
* \param num_command_line_args The number of command-line arguments in * \param num_command_line_args The number of command-line arguments in
@ -1463,32 +1463,32 @@ enum CXSaveError {
* Indicates that no error occurred while saving a translation unit. * Indicates that no error occurred while saving a translation unit.
*/ */
CXSaveError_None = 0, CXSaveError_None = 0,
/** /**
* Indicates that an unknown error occurred while attempting to save * Indicates that an unknown error occurred while attempting to save
* the file. * the file.
* *
* This error typically indicates that file I/O failed when attempting to * This error typically indicates that file I/O failed when attempting to
* write the file. * write the file.
*/ */
CXSaveError_Unknown = 1, CXSaveError_Unknown = 1,
/** /**
* Indicates that errors during translation prevented this attempt * Indicates that errors during translation prevented this attempt
* to save the translation unit. * to save the translation unit.
* *
* Errors that prevent the translation unit from being saved can be * Errors that prevent the translation unit from being saved can be
* extracted using \c clang_getNumDiagnostics() and \c clang_getDiagnostic(). * extracted using \c clang_getNumDiagnostics() and \c clang_getDiagnostic().
*/ */
CXSaveError_TranslationErrors = 2, CXSaveError_TranslationErrors = 2,
/** /**
* Indicates that the translation unit to be saved was somehow * Indicates that the translation unit to be saved was somehow
* invalid (e.g., NULL). * invalid (e.g., NULL).
*/ */
CXSaveError_InvalidTU = 3 CXSaveError_InvalidTU = 3
}; };
/** /**
* Saves a translation unit into a serialized representation of * Saves a translation unit into a serialized representation of
* that translation unit on disk. * that translation unit on disk.
@ -1509,7 +1509,7 @@ enum CXSaveError {
* CXSaveTranslationUnit_XXX flags. * CXSaveTranslationUnit_XXX flags.
* *
* \returns A value that will match one of the enumerators of the CXSaveError * \returns A value that will match one of the enumerators of the CXSaveError
* enumeration. Zero (CXSaveError_None) indicates that the translation unit was * enumeration. Zero (CXSaveError_None) indicates that the translation unit was
* saved successfully, while a non-zero value indicates that a problem occurred. * saved successfully, while a non-zero value indicates that a problem occurred.
*/ */
CINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU, CINDEX_LINKAGE int clang_saveTranslationUnit(CXTranslationUnit TU,
@ -1543,7 +1543,7 @@ enum CXReparse_Flags {
*/ */
CXReparse_None = 0x0 CXReparse_None = 0x0
}; };
/** /**
* Returns the set of flags that is suitable for reparsing a translation * Returns the set of flags that is suitable for reparsing a translation
* unit. * unit.
@ -1551,7 +1551,7 @@ enum CXReparse_Flags {
* The set of flags returned provide options for * The set of flags returned provide options for
* \c clang_reparseTranslationUnit() by default. The returned flag * \c clang_reparseTranslationUnit() by default. The returned flag
* set contains an unspecified set of optimizations geared toward common uses * set contains an unspecified set of optimizations geared toward common uses
* of reparsing. The set of optimizations enabled may change from one version * of reparsing. The set of optimizations enabled may change from one version
* to the next. * to the next.
*/ */
CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU); CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU);
@ -1563,17 +1563,17 @@ CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU);
* created the given translation unit, for example because those source files * created the given translation unit, for example because those source files
* have changed (either on disk or as passed via \p unsaved_files). The * have changed (either on disk or as passed via \p unsaved_files). The
* source code will be reparsed with the same command-line options as it * source code will be reparsed with the same command-line options as it
* was originally parsed. * was originally parsed.
* *
* Reparsing a translation unit invalidates all cursors and source locations * Reparsing a translation unit invalidates all cursors and source locations
* that refer into that translation unit. This makes reparsing a translation * that refer into that translation unit. This makes reparsing a translation
* unit semantically equivalent to destroying the translation unit and then * unit semantically equivalent to destroying the translation unit and then
* creating a new translation unit with the same command-line arguments. * creating a new translation unit with the same command-line arguments.
* However, it may be more efficient to reparse a translation * However, it may be more efficient to reparse a translation
* unit using this routine. * unit using this routine.
* *
* \param TU The translation unit whose contents will be re-parsed. The * \param TU The translation unit whose contents will be re-parsed. The
* translation unit must originally have been built with * translation unit must originally have been built with
* \c clang_createTranslationUnitFromSourceFile(). * \c clang_createTranslationUnitFromSourceFile().
* *
* \param num_unsaved_files The number of unsaved file entries in \p * \param num_unsaved_files The number of unsaved file entries in \p
@ -1584,7 +1584,7 @@ CINDEX_LINKAGE unsigned clang_defaultReparseOptions(CXTranslationUnit TU);
* those files. The contents and name of these files (as specified by * those files. The contents and name of these files (as specified by
* CXUnsavedFile) are copied when necessary, so the client only needs to * CXUnsavedFile) are copied when necessary, so the client only needs to
* guarantee their validity until the call to this function returns. * guarantee their validity until the call to this function returns.
* *
* \param options A bitset of options composed of the flags in CXReparse_Flags. * \param options A bitset of options composed of the flags in CXReparse_Flags.
* The function \c clang_defaultReparseOptions() produces a default set of * The function \c clang_defaultReparseOptions() produces a default set of
* options recommended for most uses, based on the translation unit. * options recommended for most uses, based on the translation unit.
@ -1612,8 +1612,8 @@ enum CXTUResourceUsageKind {
CXTUResourceUsage_AST_SideTables = 6, CXTUResourceUsage_AST_SideTables = 6,
CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7, CXTUResourceUsage_SourceManager_Membuffer_Malloc = 7,
CXTUResourceUsage_SourceManager_Membuffer_MMap = 8, CXTUResourceUsage_SourceManager_Membuffer_MMap = 8,
CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9, CXTUResourceUsage_ExternalASTSource_Membuffer_Malloc = 9,
CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10, CXTUResourceUsage_ExternalASTSource_Membuffer_MMap = 10,
CXTUResourceUsage_Preprocessor = 11, CXTUResourceUsage_Preprocessor = 11,
CXTUResourceUsage_PreprocessingRecord = 12, CXTUResourceUsage_PreprocessingRecord = 12,
CXTUResourceUsage_SourceManager_DataStructures = 13, CXTUResourceUsage_SourceManager_DataStructures = 13,
@ -1635,8 +1635,8 @@ const char *clang_getTUResourceUsageName(enum CXTUResourceUsageKind kind);
typedef struct CXTUResourceUsageEntry { typedef struct CXTUResourceUsageEntry {
/* The memory usage category. */ /* The memory usage category. */
enum CXTUResourceUsageKind kind; enum CXTUResourceUsageKind kind;
/* Amount of resources used. /* Amount of resources used.
The units will depend on the resource kind. */ The units will depend on the resource kind. */
unsigned long amount; unsigned long amount;
} CXTUResourceUsageEntry; } CXTUResourceUsageEntry;
@ -1819,7 +1819,7 @@ enum CXCursorKind {
*/ */
CXCursor_TypeRef = 43, CXCursor_TypeRef = 43,
CXCursor_CXXBaseSpecifier = 44, CXCursor_CXXBaseSpecifier = 44,
/** /**
* A reference to a class template, function template, template * A reference to a class template, function template, template
* template parameter, or class template partial specialization. * template parameter, or class template partial specialization.
*/ */
@ -1829,14 +1829,14 @@ enum CXCursorKind {
*/ */
CXCursor_NamespaceRef = 46, CXCursor_NamespaceRef = 46,
/** /**
* A reference to a member of a struct, union, or class that occurs in * A reference to a member of a struct, union, or class that occurs in
* some non-expression context, e.g., a designated initializer. * some non-expression context, e.g., a designated initializer.
*/ */
CXCursor_MemberRef = 47, CXCursor_MemberRef = 47,
/** /**
* A reference to a labeled statement. * A reference to a labeled statement.
* *
* This cursor kind is used to describe the jump to "start_over" in the * This cursor kind is used to describe the jump to "start_over" in the
* goto statement in the following example: * goto statement in the following example:
* *
* \code * \code
@ -1849,7 +1849,7 @@ enum CXCursorKind {
* A label reference cursor refers to a label statement. * A label reference cursor refers to a label statement.
*/ */
CXCursor_LabelRef = 48, CXCursor_LabelRef = 48,
/** /**
* A reference to a set of overloaded functions or function templates * A reference to a set of overloaded functions or function templates
* that has not yet been resolved to a specific function or function template. * that has not yet been resolved to a specific function or function template.
@ -1882,18 +1882,18 @@ enum CXCursorKind {
* argument-dependent lookup (e.g., the "swap" function at the end of the * argument-dependent lookup (e.g., the "swap" function at the end of the
* example). * example).
* *
* The functions \c clang_getNumOverloadedDecls() and * The functions \c clang_getNumOverloadedDecls() and
* \c clang_getOverloadedDecl() can be used to retrieve the definitions * \c clang_getOverloadedDecl() can be used to retrieve the definitions
* referenced by this cursor. * referenced by this cursor.
*/ */
CXCursor_OverloadedDeclRef = 49, CXCursor_OverloadedDeclRef = 49,
/** /**
* A reference to a variable that occurs in some non-expression * A reference to a variable that occurs in some non-expression
* context, e.g., a C++ lambda capture list. * context, e.g., a C++ lambda capture list.
*/ */
CXCursor_VariableRef = 50, CXCursor_VariableRef = 50,
CXCursor_LastRef = CXCursor_VariableRef, CXCursor_LastRef = CXCursor_VariableRef,
/* Error conditions */ /* Error conditions */
@ -2153,7 +2153,7 @@ enum CXCursorKind {
* \endcode * \endcode
*/ */
CXCursor_LambdaExpr = 144, CXCursor_LambdaExpr = 144,
/** Objective-c Boolean Literal. /** Objective-c Boolean Literal.
*/ */
CXCursor_ObjCBoolLiteralExpr = 145, CXCursor_ObjCBoolLiteralExpr = 145,
@ -2189,10 +2189,10 @@ enum CXCursorKind {
* reported. * reported.
*/ */
CXCursor_UnexposedStmt = 200, CXCursor_UnexposedStmt = 200,
/** A labelled statement in a function. /** A labelled statement in a function.
* *
* This cursor kind is used to describe the "start_over:" label statement in * This cursor kind is used to describe the "start_over:" label statement in
* the following example: * the following example:
* *
* \code * \code
@ -2650,7 +2650,7 @@ CINDEX_LINKAGE int clang_Cursor_isNull(CXCursor cursor);
* Compute a hash value for the given cursor. * Compute a hash value for the given cursor.
*/ */
CINDEX_LINKAGE unsigned clang_hashCursor(CXCursor); CINDEX_LINKAGE unsigned clang_hashCursor(CXCursor);
/** /**
* Retrieve the kind of the given cursor. * Retrieve the kind of the given cursor.
*/ */
@ -2718,7 +2718,7 @@ CINDEX_LINKAGE unsigned clang_isTranslationUnit(enum CXCursorKind);
* element, such as a preprocessor directive or macro instantiation. * element, such as a preprocessor directive or macro instantiation.
*/ */
CINDEX_LINKAGE unsigned clang_isPreprocessing(enum CXCursorKind); CINDEX_LINKAGE unsigned clang_isPreprocessing(enum CXCursorKind);
/*** /***
* Determine whether the given cursor represents a currently * Determine whether the given cursor represents a currently
* unexposed piece of the AST (e.g., CXCursor_UnexposedStmt). * unexposed piece of the AST (e.g., CXCursor_UnexposedStmt).
@ -2785,7 +2785,7 @@ CINDEX_LINKAGE enum CXVisibilityKind clang_getCursorVisibility(CXCursor cursor);
* *
* \returns The availability of the cursor. * \returns The availability of the cursor.
*/ */
CINDEX_LINKAGE enum CXAvailabilityKind CINDEX_LINKAGE enum CXAvailabilityKind
clang_getCursorAvailability(CXCursor cursor); clang_getCursorAvailability(CXCursor cursor);
/** /**
@ -2831,10 +2831,10 @@ typedef struct CXPlatformAvailability {
* *
* \param cursor The cursor to query. * \param cursor The cursor to query.
* *
* \param always_deprecated If non-NULL, will be set to indicate whether the * \param always_deprecated If non-NULL, will be set to indicate whether the
* entity is deprecated on all platforms. * entity is deprecated on all platforms.
* *
* \param deprecated_message If non-NULL, will be set to the message text * \param deprecated_message If non-NULL, will be set to the message text
* provided along with the unconditional deprecation of this entity. The client * provided along with the unconditional deprecation of this entity. The client
* is responsible for deallocating this string. * is responsible for deallocating this string.
* *
@ -2842,7 +2842,7 @@ typedef struct CXPlatformAvailability {
* entity is unavailable on all platforms. * entity is unavailable on all platforms.
* *
* \param unavailable_message If non-NULL, will be set to the message text * \param unavailable_message If non-NULL, will be set to the message text
* provided along with the unconditional unavailability of this entity. The * provided along with the unconditional unavailability of this entity. The
* client is responsible for deallocating this string. * client is responsible for deallocating this string.
* *
* \param availability If non-NULL, an array of CXPlatformAvailability instances * \param availability If non-NULL, an array of CXPlatformAvailability instances
@ -2850,15 +2850,15 @@ typedef struct CXPlatformAvailability {
* the number of platforms for which availability information is available (as * the number of platforms for which availability information is available (as
* returned by this function) or \c availability_size, whichever is smaller. * returned by this function) or \c availability_size, whichever is smaller.
* *
* \param availability_size The number of elements available in the * \param availability_size The number of elements available in the
* \c availability array. * \c availability array.
* *
* \returns The number of platforms (N) for which availability information is * \returns The number of platforms (N) for which availability information is
* available (which is unrelated to \c availability_size). * available (which is unrelated to \c availability_size).
* *
* Note that the client is responsible for calling * Note that the client is responsible for calling
* \c clang_disposeCXPlatformAvailability to free each of the * \c clang_disposeCXPlatformAvailability to free each of the
* platform-availability structures returned. There are * platform-availability structures returned. There are
* \c min(N, availability_size) such structures. * \c min(N, availability_size) such structures.
*/ */
CINDEX_LINKAGE int CINDEX_LINKAGE int
@ -2875,7 +2875,7 @@ clang_getCursorPlatformAvailability(CXCursor cursor,
*/ */
CINDEX_LINKAGE void CINDEX_LINKAGE void
clang_disposeCXPlatformAvailability(CXPlatformAvailability *availability); clang_disposeCXPlatformAvailability(CXPlatformAvailability *availability);
/** /**
* Describe the "language" of the entity referred to by a cursor. * Describe the "language" of the entity referred to by a cursor.
*/ */
@ -2948,7 +2948,7 @@ CINDEX_LINKAGE unsigned clang_CXCursorSet_insert(CXCursorSet cset,
* *
* The semantic parent of a cursor is the cursor that semantically contains * The semantic parent of a cursor is the cursor that semantically contains
* the given \p cursor. For many declarations, the lexical and semantic parents * the given \p cursor. For many declarations, the lexical and semantic parents
* are equivalent (the lexical parent is returned by * are equivalent (the lexical parent is returned by
* \c clang_getCursorLexicalParent()). They diverge when declarations or * \c clang_getCursorLexicalParent()). They diverge when declarations or
* definitions are provided out-of-line. For example: * definitions are provided out-of-line. For example:
* *
@ -2983,7 +2983,7 @@ CINDEX_LINKAGE CXCursor clang_getCursorSemanticParent(CXCursor cursor);
* *
* The lexical parent of a cursor is the cursor in which the given \p cursor * The lexical parent of a cursor is the cursor in which the given \p cursor
* was actually written. For many declarations, the lexical and semantic parents * was actually written. For many declarations, the lexical and semantic parents
* are equivalent (the semantic parent is returned by * are equivalent (the semantic parent is returned by
* \c clang_getCursorSemanticParent()). They diverge when declarations or * \c clang_getCursorSemanticParent()). They diverge when declarations or
* definitions are provided out-of-line. For example: * definitions are provided out-of-line. For example:
* *
@ -3046,18 +3046,18 @@ CINDEX_LINKAGE CXCursor clang_getCursorLexicalParent(CXCursor cursor);
* \param cursor A cursor representing an Objective-C or C++ * \param cursor A cursor representing an Objective-C or C++
* method. This routine will compute the set of methods that this * method. This routine will compute the set of methods that this
* method overrides. * method overrides.
* *
* \param overridden A pointer whose pointee will be replaced with a * \param overridden A pointer whose pointee will be replaced with a
* pointer to an array of cursors, representing the set of overridden * pointer to an array of cursors, representing the set of overridden
* methods. If there are no overridden methods, the pointee will be * methods. If there are no overridden methods, the pointee will be
* set to NULL. The pointee must be freed via a call to * set to NULL. The pointee must be freed via a call to
* \c clang_disposeOverriddenCursors(). * \c clang_disposeOverriddenCursors().
* *
* \param num_overridden A pointer to the number of overridden * \param num_overridden A pointer to the number of overridden
* functions, will be set to the number of overridden functions in the * functions, will be set to the number of overridden functions in the
* array pointed to by \p overridden. * array pointed to by \p overridden.
*/ */
CINDEX_LINKAGE void clang_getOverriddenCursors(CXCursor cursor, CINDEX_LINKAGE void clang_getOverriddenCursors(CXCursor cursor,
CXCursor **overridden, CXCursor **overridden,
unsigned *num_overridden); unsigned *num_overridden);
@ -3072,7 +3072,7 @@ CINDEX_LINKAGE void clang_disposeOverriddenCursors(CXCursor *overridden);
* cursor. * cursor.
*/ */
CINDEX_LINKAGE CXFile clang_getIncludedFile(CXCursor cursor); CINDEX_LINKAGE CXFile clang_getIncludedFile(CXCursor cursor);
/** /**
* @} * @}
*/ */
@ -3133,7 +3133,7 @@ CINDEX_LINKAGE CXSourceRange clang_getCursorExtent(CXCursor);
/** /**
* @} * @}
*/ */
/** /**
* \defgroup CINDEX_TYPES Type information for CXCursors * \defgroup CINDEX_TYPES Type information for CXCursors
* *
@ -3582,7 +3582,7 @@ CINDEX_LINKAGE CXString clang_getDeclObjCTypeEncoding(CXCursor C);
/** /**
* Returns the Objective-C type encoding for the specified CXType. * Returns the Objective-C type encoding for the specified CXType.
*/ */
CINDEX_LINKAGE CXString clang_Type_getObjCEncoding(CXType type); CINDEX_LINKAGE CXString clang_Type_getObjCEncoding(CXType type);
/** /**
* Retrieve the spelling of a given CXTypeKind. * Retrieve the spelling of a given CXTypeKind.
@ -3842,7 +3842,7 @@ CINDEX_LINKAGE unsigned clang_Cursor_isBitField(CXCursor C);
* CX_CXXBaseSpecifier is virtual. * CX_CXXBaseSpecifier is virtual.
*/ */
CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor); CINDEX_LINKAGE unsigned clang_isVirtualBase(CXCursor);
/** /**
* Represents the C++ access control level to a base class for a * Represents the C++ access control level to a base class for a
* cursor with kind CX_CXXBaseSpecifier. * cursor with kind CX_CXXBaseSpecifier.
@ -3887,7 +3887,7 @@ enum CX_StorageClass {
CINDEX_LINKAGE enum CX_StorageClass clang_Cursor_getStorageClass(CXCursor); CINDEX_LINKAGE enum CX_StorageClass clang_Cursor_getStorageClass(CXCursor);
/** /**
* Determine the number of overloaded declarations referenced by a * Determine the number of overloaded declarations referenced by a
* \c CXCursor_OverloadedDeclRef cursor. * \c CXCursor_OverloadedDeclRef cursor.
* *
* \param cursor The cursor whose overloaded declarations are being queried. * \param cursor The cursor whose overloaded declarations are being queried.
@ -3906,18 +3906,18 @@ CINDEX_LINKAGE unsigned clang_getNumOverloadedDecls(CXCursor cursor);
* \param index The zero-based index into the set of overloaded declarations in * \param index The zero-based index into the set of overloaded declarations in
* the cursor. * the cursor.
* *
* \returns A cursor representing the declaration referenced by the given * \returns A cursor representing the declaration referenced by the given
* \c cursor at the specified \c index. If the cursor does not have an * \c cursor at the specified \c index. If the cursor does not have an
* associated set of overloaded declarations, or if the index is out of bounds, * associated set of overloaded declarations, or if the index is out of bounds,
* returns \c clang_getNullCursor(); * returns \c clang_getNullCursor();
*/ */
CINDEX_LINKAGE CXCursor clang_getOverloadedDecl(CXCursor cursor, CINDEX_LINKAGE CXCursor clang_getOverloadedDecl(CXCursor cursor,
unsigned index); unsigned index);
/** /**
* @} * @}
*/ */
/** /**
* \defgroup CINDEX_ATTRIBUTES Information for attributes * \defgroup CINDEX_ATTRIBUTES Information for attributes
* *
@ -4021,7 +4021,7 @@ CINDEX_LINKAGE unsigned clang_visitChildren(CXCursor parent,
* The visitor should return one of the \c CXChildVisitResult values * The visitor should return one of the \c CXChildVisitResult values
* to direct clang_visitChildrenWithBlock(). * to direct clang_visitChildrenWithBlock().
*/ */
typedef enum CXChildVisitResult typedef enum CXChildVisitResult
(^CXCursorVisitorBlock)(CXCursor cursor, CXCursor parent); (^CXCursorVisitorBlock)(CXCursor cursor, CXCursor parent);
/** /**
@ -4109,10 +4109,10 @@ CINDEX_LINKAGE CXString clang_getCursorSpelling(CXCursor);
* Most of the times there is only one range for the complete spelling but for * Most of the times there is only one range for the complete spelling but for
* Objective-C methods and Objective-C message expressions, there are multiple * Objective-C methods and Objective-C message expressions, there are multiple
* pieces for each selector identifier. * pieces for each selector identifier.
* *
* \param pieceIndex the index of the spelling name piece. If this is greater * \param pieceIndex the index of the spelling name piece. If this is greater
* than the actual number of pieces, it will return a NULL (invalid) range. * than the actual number of pieces, it will return a NULL (invalid) range.
* *
* \param options Reserved. * \param options Reserved.
*/ */
CINDEX_LINKAGE CXSourceRange clang_Cursor_getSpellingNameRange(CXCursor, CINDEX_LINKAGE CXSourceRange clang_Cursor_getSpellingNameRange(CXCursor,
@ -4206,11 +4206,11 @@ CINDEX_LINKAGE CXString clang_getCursorPrettyPrinted(CXCursor Cursor,
* Retrieve the display name for the entity referenced by this cursor. * Retrieve the display name for the entity referenced by this cursor.
* *
* The display name contains extra information that helps identify the cursor, * The display name contains extra information that helps identify the cursor,
* such as the parameters of a function or template or the arguments of a * such as the parameters of a function or template or the arguments of a
* class template specialization. * class template specialization.
*/ */
CINDEX_LINKAGE CXString clang_getCursorDisplayName(CXCursor); CINDEX_LINKAGE CXString clang_getCursorDisplayName(CXCursor);
/** For a cursor that is a reference, retrieve a cursor representing the /** For a cursor that is a reference, retrieve a cursor representing the
* entity that it references. * entity that it references.
* *
@ -4274,10 +4274,10 @@ CINDEX_LINKAGE unsigned clang_isCursorDefinition(CXCursor);
* }; * };
* \endcode * \endcode
* *
* The declarations and the definition of \c X are represented by three * The declarations and the definition of \c X are represented by three
* different cursors, all of which are declarations of the same underlying * different cursors, all of which are declarations of the same underlying
* entity. One of these cursor is considered the "canonical" cursor, which * entity. One of these cursor is considered the "canonical" cursor, which
* is effectively the representative for the underlying entity. One can * is effectively the representative for the underlying entity. One can
* determine if two cursors are declarations of the same underlying entity by * determine if two cursors are declarations of the same underlying entity by
* comparing their canonical cursors. * comparing their canonical cursors.
* *
@ -4301,11 +4301,11 @@ CINDEX_LINKAGE int clang_Cursor_getObjCSelectorIndex(CXCursor);
/** /**
* Given a cursor pointing to a C++ method call or an Objective-C * Given a cursor pointing to a C++ method call or an Objective-C
* message, returns non-zero if the method/message is "dynamic", meaning: * message, returns non-zero if the method/message is "dynamic", meaning:
* *
* For a C++ method: the call is virtual. * For a C++ method: the call is virtual.
* For an Objective-C message: the receiver is an object instance, not 'super' * For an Objective-C message: the receiver is an object instance, not 'super'
* or a specific class. * or a specific class.
* *
* If the method/message is "static" or the cursor does not point to a * If the method/message is "static" or the cursor does not point to a
* method/message, it will return zero. * method/message, it will return zero.
*/ */
@ -4575,7 +4575,7 @@ CINDEX_LINKAGE unsigned clang_CXXMethod_isDefaulted(CXCursor C);
CINDEX_LINKAGE unsigned clang_CXXMethod_isPureVirtual(CXCursor C); CINDEX_LINKAGE unsigned clang_CXXMethod_isPureVirtual(CXCursor C);
/** /**
* Determine if a C++ member function or member function template is * Determine if a C++ member function or member function template is
* declared 'static'. * declared 'static'.
*/ */
CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C); CINDEX_LINKAGE unsigned clang_CXXMethod_isStatic(CXCursor C);
@ -4622,16 +4622,16 @@ CINDEX_LINKAGE unsigned clang_CXXMethod_isConst(CXCursor C);
* \c CXCursor_NoDeclFound. * \c CXCursor_NoDeclFound.
*/ */
CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C); CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C);
/** /**
* Given a cursor that may represent a specialization or instantiation * Given a cursor that may represent a specialization or instantiation
* of a template, retrieve the cursor that represents the template that it * of a template, retrieve the cursor that represents the template that it
* specializes or from which it was instantiated. * specializes or from which it was instantiated.
* *
* This routine determines the template involved both for explicit * This routine determines the template involved both for explicit
* specializations of templates and for implicit instantiations of the template, * specializations of templates and for implicit instantiations of the template,
* both of which are referred to as "specializations". For a class template * both of which are referred to as "specializations". For a class template
* specialization (e.g., \c std::vector<bool>), this routine will return * specialization (e.g., \c std::vector<bool>), this routine will return
* either the primary template (\c std::vector) or, if the specialization was * either the primary template (\c std::vector) or, if the specialization was
* instantiated from a class template partial specialization, the class template * instantiated from a class template partial specialization, the class template
* partial specialization. For a class template partial specialization and a * partial specialization. For a class template partial specialization and a
@ -4639,7 +4639,7 @@ CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C);
* this routine will return the specialized template. * this routine will return the specialized template.
* *
* For members of a class template (e.g., member functions, member classes, or * For members of a class template (e.g., member functions, member classes, or
* static data members), returns the specialized or instantiated member. * static data members), returns the specialized or instantiated member.
* Although not strictly "templates" in the C++ language, members of class * Although not strictly "templates" in the C++ language, members of class
* templates have the same notions of specializations and instantiations that * templates have the same notions of specializations and instantiations that
* templates do, so this routine treats them similarly. * templates do, so this routine treats them similarly.
@ -4647,7 +4647,7 @@ CINDEX_LINKAGE enum CXCursorKind clang_getTemplateCursorKind(CXCursor C);
* \param C A cursor that may be a specialization of a template or a member * \param C A cursor that may be a specialization of a template or a member
* of a template. * of a template.
* *
* \returns If the given cursor is a specialization or instantiation of a * \returns If the given cursor is a specialization or instantiation of a
* template or a member thereof, the template or member that it specializes or * template or a member thereof, the template or member that it specializes or
* from which it was instantiated. Otherwise, returns a NULL cursor. * from which it was instantiated. Otherwise, returns a NULL cursor.
*/ */
@ -4659,11 +4659,11 @@ CINDEX_LINKAGE CXCursor clang_getSpecializedCursorTemplate(CXCursor C);
* *
* \param C A cursor pointing to a member reference, a declaration reference, or * \param C A cursor pointing to a member reference, a declaration reference, or
* an operator call. * an operator call.
* \param NameFlags A bitset with three independent flags: * \param NameFlags A bitset with three independent flags:
* CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and * CXNameRange_WantQualifier, CXNameRange_WantTemplateArgs, and
* CXNameRange_WantSinglePiece. * CXNameRange_WantSinglePiece.
* \param PieceIndex For contiguous names or when passing the flag * \param PieceIndex For contiguous names or when passing the flag
* CXNameRange_WantSinglePiece, only one piece with index 0 is * CXNameRange_WantSinglePiece, only one piece with index 0 is
* available. When the CXNameRange_WantSinglePiece flag is not passed for a * available. When the CXNameRange_WantSinglePiece flag is not passed for a
* non-contiguous names, this index can be used to retrieve the individual * non-contiguous names, this index can be used to retrieve the individual
* pieces of the name. See also CXNameRange_WantSinglePiece. * pieces of the name. See also CXNameRange_WantSinglePiece.
@ -4672,7 +4672,7 @@ CINDEX_LINKAGE CXCursor clang_getSpecializedCursorTemplate(CXCursor C);
* name, or if the PieceIndex is out-of-range, a null-cursor will be returned. * name, or if the PieceIndex is out-of-range, a null-cursor will be returned.
*/ */
CINDEX_LINKAGE CXSourceRange clang_getCursorReferenceNameRange(CXCursor C, CINDEX_LINKAGE CXSourceRange clang_getCursorReferenceNameRange(CXCursor C,
unsigned NameFlags, unsigned NameFlags,
unsigned PieceIndex); unsigned PieceIndex);
enum CXNameRefFlags { enum CXNameRefFlags {
@ -4681,7 +4681,7 @@ enum CXNameRefFlags {
* range. * range.
*/ */
CXNameRange_WantQualifier = 0x1, CXNameRange_WantQualifier = 0x1,
/** /**
* Include the explicit template arguments, e.g. \<int> in x.f<int>, * Include the explicit template arguments, e.g. \<int> in x.f<int>,
* in the range. * in the range.
@ -4700,7 +4700,7 @@ enum CXNameRefFlags {
*/ */
CXNameRange_WantSinglePiece = 0x4 CXNameRange_WantSinglePiece = 0x4
}; };
/** /**
* @} * @}
*/ */
@ -5153,7 +5153,7 @@ clang_getNumCompletionChunks(CXCompletionString completion_string);
/** /**
* Determine the priority of this code completion. * Determine the priority of this code completion.
* *
* The priority of a code completion indicates how likely it is that this * The priority of a code completion indicates how likely it is that this
* particular completion is the completion that the user will select. The * particular completion is the completion that the user will select. The
* priority is selected by various internal heuristics. * priority is selected by various internal heuristics.
* *
@ -5164,7 +5164,7 @@ clang_getNumCompletionChunks(CXCompletionString completion_string);
*/ */
CINDEX_LINKAGE unsigned CINDEX_LINKAGE unsigned
clang_getCompletionPriority(CXCompletionString completion_string); clang_getCompletionPriority(CXCompletionString completion_string);
/** /**
* Determine the availability of the entity that this code-completion * Determine the availability of the entity that this code-completion
* string refers to. * string refers to.
@ -5173,7 +5173,7 @@ clang_getCompletionPriority(CXCompletionString completion_string);
* *
* \returns The availability of the completion string. * \returns The availability of the completion string.
*/ */
CINDEX_LINKAGE enum CXAvailabilityKind CINDEX_LINKAGE enum CXAvailabilityKind
clang_getCompletionAvailability(CXCompletionString completion_string); clang_getCompletionAvailability(CXCompletionString completion_string);
/** /**
@ -5206,7 +5206,7 @@ clang_getCompletionAnnotation(CXCompletionString completion_string,
/** /**
* Retrieve the parent context of the given completion string. * Retrieve the parent context of the given completion string.
* *
* The parent context of a completion string is the semantic parent of * The parent context of a completion string is the semantic parent of
* the declaration (if any) that the code completion represents. For example, * the declaration (if any) that the code completion represents. For example,
* a code completion for an Objective-C method would have the method's class * a code completion for an Objective-C method would have the method's class
* or protocol as its context. * or protocol as its context.
@ -5241,7 +5241,7 @@ clang_getCompletionBriefComment(CXCompletionString completion_string);
*/ */
CINDEX_LINKAGE CXCompletionString CINDEX_LINKAGE CXCompletionString
clang_getCursorCompletionString(CXCursor cursor); clang_getCursorCompletionString(CXCursor cursor);
/** /**
* Contains the results of code-completion. * Contains the results of code-completion.
* *
@ -5378,12 +5378,12 @@ enum CXCompletionContext {
* should be included. (This is equivalent to having no context bits set.) * should be included. (This is equivalent to having no context bits set.)
*/ */
CXCompletionContext_Unexposed = 0, CXCompletionContext_Unexposed = 0,
/** /**
* Completions for any possible type should be included in the results. * Completions for any possible type should be included in the results.
*/ */
CXCompletionContext_AnyType = 1 << 0, CXCompletionContext_AnyType = 1 << 0,
/** /**
* Completions for any possible value (variables, function calls, etc.) * Completions for any possible value (variables, function calls, etc.)
* should be included in the results. * should be included in the results.
@ -5404,7 +5404,7 @@ enum CXCompletionContext {
* included in the results. * included in the results.
*/ */
CXCompletionContext_CXXClassTypeValue = 1 << 4, CXCompletionContext_CXXClassTypeValue = 1 << 4,
/** /**
* Completions for fields of the member being accessed using the dot * Completions for fields of the member being accessed using the dot
* operator should be included in the results. * operator should be included in the results.
@ -5420,7 +5420,7 @@ enum CXCompletionContext {
* using the dot operator should be included in the results. * using the dot operator should be included in the results.
*/ */
CXCompletionContext_ObjCPropertyAccess = 1 << 7, CXCompletionContext_ObjCPropertyAccess = 1 << 7,
/** /**
* Completions for enum tags should be included in the results. * Completions for enum tags should be included in the results.
*/ */
@ -5433,7 +5433,7 @@ enum CXCompletionContext {
* Completions for struct tags should be included in the results. * Completions for struct tags should be included in the results.
*/ */
CXCompletionContext_StructTag = 1 << 10, CXCompletionContext_StructTag = 1 << 10,
/** /**
* Completions for C++ class names should be included in the results. * Completions for C++ class names should be included in the results.
*/ */
@ -5448,7 +5448,7 @@ enum CXCompletionContext {
* the results. * the results.
*/ */
CXCompletionContext_NestedNameSpecifier = 1 << 13, CXCompletionContext_NestedNameSpecifier = 1 << 13,
/** /**
* Completions for Objective-C interfaces (classes) should be included * Completions for Objective-C interfaces (classes) should be included
* in the results. * in the results.
@ -5479,27 +5479,27 @@ enum CXCompletionContext {
* the results. * the results.
*/ */
CXCompletionContext_ObjCSelectorName = 1 << 19, CXCompletionContext_ObjCSelectorName = 1 << 19,
/** /**
* Completions for preprocessor macro names should be included in * Completions for preprocessor macro names should be included in
* the results. * the results.
*/ */
CXCompletionContext_MacroName = 1 << 20, CXCompletionContext_MacroName = 1 << 20,
/** /**
* Natural language completions should be included in the results. * Natural language completions should be included in the results.
*/ */
CXCompletionContext_NaturalLanguage = 1 << 21, CXCompletionContext_NaturalLanguage = 1 << 21,
/** /**
* The current context is unknown, so set all contexts. * The current context is unknown, so set all contexts.
*/ */
CXCompletionContext_Unknown = ((1 << 22) - 1) CXCompletionContext_Unknown = ((1 << 22) - 1)
}; };
/** /**
* Returns a default set of code-completion options that can be * Returns a default set of code-completion options that can be
* passed to\c clang_codeCompleteAt(). * passed to\c clang_codeCompleteAt().
*/ */
CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void); CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void);
@ -5562,7 +5562,7 @@ CINDEX_LINKAGE unsigned clang_defaultCodeCompleteOptions(void);
* *
* \param options Extra options that control the behavior of code * \param options Extra options that control the behavior of code
* completion, expressed as a bitwise OR of the enumerators of the * completion, expressed as a bitwise OR of the enumerators of the
* CXCodeComplete_Flags enumeration. The * CXCodeComplete_Flags enumeration. The
* \c clang_defaultCodeCompleteOptions() function returns a default set * \c clang_defaultCodeCompleteOptions() function returns a default set
* of code-completion options. * of code-completion options.
* *
@ -5581,7 +5581,7 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
unsigned options); unsigned options);
/** /**
* Sort the code-completion results in case-insensitive alphabetical * Sort the code-completion results in case-insensitive alphabetical
* order. * order.
* *
* \param Results The set of results to sort. * \param Results The set of results to sort.
@ -5590,13 +5590,13 @@ CXCodeCompleteResults *clang_codeCompleteAt(CXTranslationUnit TU,
CINDEX_LINKAGE CINDEX_LINKAGE
void clang_sortCodeCompletionResults(CXCompletionResult *Results, void clang_sortCodeCompletionResults(CXCompletionResult *Results,
unsigned NumResults); unsigned NumResults);
/** /**
* Free the given set of code-completion results. * Free the given set of code-completion results.
*/ */
CINDEX_LINKAGE CINDEX_LINKAGE
void clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results); void clang_disposeCodeCompleteResults(CXCodeCompleteResults *Results);
/** /**
* Determine the number of diagnostics produced prior to the * Determine the number of diagnostics produced prior to the
* location where code completion was performed. * location where code completion was performed.
@ -5620,7 +5620,7 @@ CXDiagnostic clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *Results,
/** /**
* Determines what completions are appropriate for the context * Determines what completions are appropriate for the context
* the given code completion. * the given code completion.
* *
* \param Results the code completion results to query * \param Results the code completion results to query
* *
* \returns the kinds of completions that are appropriate for use * \returns the kinds of completions that are appropriate for use
@ -5676,7 +5676,7 @@ CXString clang_codeCompleteGetContainerUSR(CXCodeCompleteResults *Results);
*/ */
CINDEX_LINKAGE CINDEX_LINKAGE
CXString clang_codeCompleteGetObjCSelector(CXCodeCompleteResults *Results); CXString clang_codeCompleteGetObjCSelector(CXCodeCompleteResults *Results);
/** /**
* @} * @}
*/ */
@ -5700,7 +5700,7 @@ CINDEX_LINKAGE CXString clang_getClangVersion(void);
* value enables crash recovery, while 0 disables it. * value enables crash recovery, while 0 disables it.
*/ */
CINDEX_LINKAGE void clang_toggleCrashRecovery(unsigned isEnabled); CINDEX_LINKAGE void clang_toggleCrashRecovery(unsigned isEnabled);
/** /**
* Visitor invoked for each file in a translation unit * Visitor invoked for each file in a translation unit
* (used with clang_getInclusions()). * (used with clang_getInclusions()).
@ -5745,7 +5745,7 @@ typedef enum {
typedef void * CXEvalResult; typedef void * CXEvalResult;
/** /**
* If cursor is a statement declaration tries to evaluate the * If cursor is a statement declaration tries to evaluate the
* statement and if its variable, tries to evaluate its initializer, * statement and if its variable, tries to evaluate its initializer,
* into its corresponding type. * into its corresponding type.
*/ */
@ -5844,7 +5844,7 @@ CINDEX_LINKAGE unsigned clang_remap_getNumFiles(CXRemapping);
/** /**
* Get the original and the associated filename from the remapping. * Get the original and the associated filename from the remapping.
* *
* \param original If non-NULL, will be set to the original filename. * \param original If non-NULL, will be set to the original filename.
* *
* \param transformed If non-NULL, will be set to the filename that the original * \param transformed If non-NULL, will be set to the filename that the original
@ -5896,7 +5896,7 @@ typedef enum {
/** /**
* Find references of a declaration in a specific file. * Find references of a declaration in a specific file.
* *
* \param cursor pointing to a declaration or a reference of one. * \param cursor pointing to a declaration or a reference of one.
* *
* \param file to search for references. * \param file to search for references.
@ -6255,11 +6255,11 @@ typedef struct {
const CXIdxEntityInfo *referencedEntity; const CXIdxEntityInfo *referencedEntity;
/** /**
* Immediate "parent" of the reference. For example: * Immediate "parent" of the reference. For example:
* *
* \code * \code
* Foo *var; * Foo *var;
* \endcode * \endcode
* *
* The parent of reference of type 'Foo' is the variable 'var'. * The parent of reference of type 'Foo' is the variable 'var'.
* For references inside statement bodies of functions/methods, * For references inside statement bodies of functions/methods,
* the parentEntity will be the function/method. * the parentEntity will be the function/method.
@ -6294,16 +6294,16 @@ typedef struct {
CXIdxClientFile (*enteredMainFile)(CXClientData client_data, CXIdxClientFile (*enteredMainFile)(CXClientData client_data,
CXFile mainFile, void *reserved); CXFile mainFile, void *reserved);
/** /**
* Called when a file gets \#included/\#imported. * Called when a file gets \#included/\#imported.
*/ */
CXIdxClientFile (*ppIncludedFile)(CXClientData client_data, CXIdxClientFile (*ppIncludedFile)(CXClientData client_data,
const CXIdxIncludedFileInfo *); const CXIdxIncludedFileInfo *);
/** /**
* Called when a AST file (PCH or module) gets imported. * Called when a AST file (PCH or module) gets imported.
* *
* AST files will not get indexed (there will not be callbacks to index all * AST files will not get indexed (there will not be callbacks to index all
* the entities in an AST file). The recommended action is that, if the AST * the entities in an AST file). The recommended action is that, if the AST
* file is not already indexed, to initiate a new indexing job specific to * file is not already indexed, to initiate a new indexing job specific to
@ -6405,7 +6405,7 @@ typedef enum {
* Used to indicate that no special indexing options are needed. * Used to indicate that no special indexing options are needed.
*/ */
CXIndexOpt_None = 0x0, CXIndexOpt_None = 0x0,
/** /**
* Used to indicate that IndexerCallbacks#indexEntityReference should * Used to indicate that IndexerCallbacks#indexEntityReference should
* be invoked for only one reference of an entity per source file that does * be invoked for only one reference of an entity per source file that does
@ -6492,16 +6492,16 @@ CINDEX_LINKAGE int clang_indexSourceFileFullArgv(
/** /**
* Index the given translation unit via callbacks implemented through * Index the given translation unit via callbacks implemented through
* #IndexerCallbacks. * #IndexerCallbacks.
* *
* The order of callback invocations is not guaranteed to be the same as * The order of callback invocations is not guaranteed to be the same as
* when indexing a source file. The high level order will be: * when indexing a source file. The high level order will be:
* *
* -Preprocessor callbacks invocations * -Preprocessor callbacks invocations
* -Declaration/reference callbacks invocations * -Declaration/reference callbacks invocations
* -Diagnostic callback invocations * -Diagnostic callback invocations
* *
* The parameters are the same as #clang_indexSourceFile. * The parameters are the same as #clang_indexSourceFile.
* *
* \returns If there is a failure from which there is no recovery, returns * \returns If there is a failure from which there is no recovery, returns
* non-zero, otherwise returns 0. * non-zero, otherwise returns 0.
*/ */

View File

@ -41,7 +41,7 @@ class FileRemapper {
public: public:
FileRemapper(); FileRemapper();
~FileRemapper(); ~FileRemapper();
bool initFromDisk(StringRef outputDir, DiagnosticsEngine &Diag, bool initFromDisk(StringRef outputDir, DiagnosticsEngine &Diag,
bool ignoreIfFilesChanged); bool ignoreIfFilesChanged);
bool initFromFile(StringRef filePath, DiagnosticsEngine &Diag, bool initFromFile(StringRef filePath, DiagnosticsEngine &Diag,

View File

@ -1528,7 +1528,7 @@ public:
/// The sizeof operator requires this (C99 6.5.3.4p4). /// The sizeof operator requires this (C99 6.5.3.4p4).
CanQualType getSizeType() const; CanQualType getSizeType() const;
/// Return the unique signed counterpart of /// Return the unique signed counterpart of
/// the integer type corresponding to size_t. /// the integer type corresponding to size_t.
CanQualType getSignedSizeType() const; CanQualType getSignedSizeType() const;

View File

@ -23,11 +23,11 @@ namespace clang {
NUM_BUILTIN_AST_DIAGNOSTICS NUM_BUILTIN_AST_DIAGNOSTICS
}; };
} // end namespace diag } // end namespace diag
/// DiagnosticsEngine argument formatting function for diagnostics that /// DiagnosticsEngine argument formatting function for diagnostics that
/// involve AST nodes. /// involve AST nodes.
/// ///
/// This function formats diagnostic arguments for various AST nodes, /// This function formats diagnostic arguments for various AST nodes,
/// including types, declaration names, nested name specifiers, and /// including types, declaration names, nested name specifiers, and
/// declaration contexts, into strings that can be printed as part of /// declaration contexts, into strings that can be printed as part of
/// diagnostics. It is meant to be used as the argument to /// diagnostics. It is meant to be used as the argument to

View File

@ -63,7 +63,7 @@ class Attr;
private: private:
/// The contexts we're importing to and from. /// The contexts we're importing to and from.
ASTContext &ToContext, &FromContext; ASTContext &ToContext, &FromContext;
/// The file managers we're importing to and from. /// The file managers we're importing to and from.
FileManager &ToFileManager, &FromFileManager; FileManager &ToFileManager, &FromFileManager;
@ -72,11 +72,11 @@ class Attr;
/// Whether the last diagnostic came from the "from" context. /// Whether the last diagnostic came from the "from" context.
bool LastDiagFromFrom = false; bool LastDiagFromFrom = false;
/// Mapping from the already-imported types in the "from" context /// Mapping from the already-imported types in the "from" context
/// to the corresponding types in the "to" context. /// to the corresponding types in the "to" context.
llvm::DenseMap<const Type *, const Type *> ImportedTypes; llvm::DenseMap<const Type *, const Type *> ImportedTypes;
/// Mapping from the already-imported declarations in the "from" /// Mapping from the already-imported declarations in the "from"
/// context to the corresponding declarations in the "to" context. /// context to the corresponding declarations in the "to" context.
llvm::DenseMap<Decl *, Decl *> ImportedDecls; llvm::DenseMap<Decl *, Decl *> ImportedDecls;
@ -93,11 +93,11 @@ class Attr;
/// the "from" source manager to the corresponding CXXBasesSpecifier /// the "from" source manager to the corresponding CXXBasesSpecifier
/// in the "to" source manager. /// in the "to" source manager.
ImportedCXXBaseSpecifierMap ImportedCXXBaseSpecifiers; ImportedCXXBaseSpecifierMap ImportedCXXBaseSpecifiers;
/// Declaration (from, to) pairs that are known not to be equivalent /// Declaration (from, to) pairs that are known not to be equivalent
/// (which we have already complained about). /// (which we have already complained about).
NonEquivalentDeclSet NonEquivalentDecls; NonEquivalentDeclSet NonEquivalentDecls;
public: public:
/// Create a new AST importer. /// Create a new AST importer.
/// ///
@ -115,13 +115,13 @@ class Attr;
ASTImporter(ASTContext &ToContext, FileManager &ToFileManager, ASTImporter(ASTContext &ToContext, FileManager &ToFileManager,
ASTContext &FromContext, FileManager &FromFileManager, ASTContext &FromContext, FileManager &FromFileManager,
bool MinimalImport); bool MinimalImport);
virtual ~ASTImporter(); virtual ~ASTImporter();
/// Whether the importer will perform a minimal import, creating /// Whether the importer will perform a minimal import, creating
/// to-be-completed forward declarations when possible. /// to-be-completed forward declarations when possible.
bool isMinimalImport() const { return Minimal; } bool isMinimalImport() const { return Minimal; }
/// Import the given type from the "from" context into the "to" /// Import the given type from the "from" context into the "to"
/// context. /// context.
/// ///
@ -142,10 +142,10 @@ class Attr;
/// \returns the equivalent attribute in the "to" context. /// \returns the equivalent attribute in the "to" context.
Attr *Import(const Attr *FromAttr); Attr *Import(const Attr *FromAttr);
/// Import the given declaration from the "from" context into the /// Import the given declaration from the "from" context into the
/// "to" context. /// "to" context.
/// ///
/// \returns the equivalent declaration in the "to" context, or a NULL type /// \returns the equivalent declaration in the "to" context, or a NULL type
/// if an error occurred. /// if an error occurred.
Decl *Import(Decl *FromD); Decl *Import(Decl *FromD);
Decl *Import(const Decl *FromD) { Decl *Import(const Decl *FromD) {
@ -163,7 +163,7 @@ class Attr;
/// \returns the equivalent declaration context in the "to" /// \returns the equivalent declaration context in the "to"
/// context, or a NULL type if an error occurred. /// context, or a NULL type if an error occurred.
DeclContext *ImportContext(DeclContext *FromDC); DeclContext *ImportContext(DeclContext *FromDC);
/// Import the given expression from the "from" context into the /// Import the given expression from the "from" context into the
/// "to" context. /// "to" context.
/// ///
@ -195,7 +195,7 @@ class Attr;
/// Import the goven template name from the "from" context into the /// Import the goven template name from the "from" context into the
/// "to" context. /// "to" context.
TemplateName Import(TemplateName From); TemplateName Import(TemplateName From);
/// Import the given source location from the "from" context into /// Import the given source location from the "from" context into
/// the "to" context. /// the "to" context.
/// ///
@ -229,7 +229,7 @@ class Attr;
/// \returns the equivalent selector in the "to" context. /// \returns the equivalent selector in the "to" context.
Selector Import(Selector FromSel); Selector Import(Selector FromSel);
/// Import the given file ID from the "from" context into the /// Import the given file ID from the "from" context into the
/// "to" context. /// "to" context.
/// ///
/// \returns the equivalent file ID in the source manager of the "to" /// \returns the equivalent file ID in the source manager of the "to"
@ -252,13 +252,13 @@ class Attr;
/// Import the definition of the given declaration, including all of /// Import the definition of the given declaration, including all of
/// the declarations it contains. /// the declarations it contains.
/// ///
/// This routine is intended to be used /// This routine is intended to be used
void ImportDefinition(Decl *From); void ImportDefinition(Decl *From);
/// Cope with a name conflict when importing a declaration into the /// Cope with a name conflict when importing a declaration into the
/// given context. /// given context.
/// ///
/// This routine is invoked whenever there is a name conflict while /// This routine is invoked whenever there is a name conflict while
/// importing a declaration. The returned name will become the name of the /// importing a declaration. The returned name will become the name of the
/// imported declaration. By default, the returned name is the same as the /// imported declaration. By default, the returned name is the same as the
/// original name, leaving the conflict unresolve such that name lookup /// original name, leaving the conflict unresolve such that name lookup
@ -270,7 +270,7 @@ class Attr;
/// \param Name the name of the declaration being imported, which conflicts /// \param Name the name of the declaration being imported, which conflicts
/// with other declarations. /// with other declarations.
/// ///
/// \param DC the declaration context (in the "to" AST context) in which /// \param DC the declaration context (in the "to" AST context) in which
/// the name is being imported. /// the name is being imported.
/// ///
/// \param IDNS the identifier namespace in which the name will be found. /// \param IDNS the identifier namespace in which the name will be found.
@ -286,25 +286,25 @@ class Attr;
unsigned IDNS, unsigned IDNS,
NamedDecl **Decls, NamedDecl **Decls,
unsigned NumDecls); unsigned NumDecls);
/// Retrieve the context that AST nodes are being imported into. /// Retrieve the context that AST nodes are being imported into.
ASTContext &getToContext() const { return ToContext; } ASTContext &getToContext() const { return ToContext; }
/// Retrieve the context that AST nodes are being imported from. /// Retrieve the context that AST nodes are being imported from.
ASTContext &getFromContext() const { return FromContext; } ASTContext &getFromContext() const { return FromContext; }
/// Retrieve the file manager that AST nodes are being imported into. /// Retrieve the file manager that AST nodes are being imported into.
FileManager &getToFileManager() const { return ToFileManager; } FileManager &getToFileManager() const { return ToFileManager; }
/// Retrieve the file manager that AST nodes are being imported from. /// Retrieve the file manager that AST nodes are being imported from.
FileManager &getFromFileManager() const { return FromFileManager; } FileManager &getFromFileManager() const { return FromFileManager; }
/// Report a diagnostic in the "to" context. /// Report a diagnostic in the "to" context.
DiagnosticBuilder ToDiag(SourceLocation Loc, unsigned DiagID); DiagnosticBuilder ToDiag(SourceLocation Loc, unsigned DiagID);
/// Report a diagnostic in the "from" context. /// Report a diagnostic in the "from" context.
DiagnosticBuilder FromDiag(SourceLocation Loc, unsigned DiagID); DiagnosticBuilder FromDiag(SourceLocation Loc, unsigned DiagID);
/// Return the set of declarations that we know are not equivalent. /// Return the set of declarations that we know are not equivalent.
NonEquivalentDeclSet &getNonEquivalentDecls() { return NonEquivalentDecls; } NonEquivalentDeclSet &getNonEquivalentDecls() { return NonEquivalentDecls; }
@ -313,7 +313,7 @@ class Attr;
/// ///
/// \param D A declaration in the "to" context. /// \param D A declaration in the "to" context.
virtual void CompleteDecl(Decl* D); virtual void CompleteDecl(Decl* D);
/// Subclasses can override this function to observe all of the \c From -> /// Subclasses can override this function to observe all of the \c From ->
/// \c To declaration mappings as they are imported. /// \c To declaration mappings as they are imported.
virtual Decl *Imported(Decl *From, Decl *To) { return To; } virtual Decl *Imported(Decl *From, Decl *To) { return To; }
@ -328,7 +328,7 @@ class Attr;
/// RecordDecl can be found, we can complete it without the need for /// RecordDecl can be found, we can complete it without the need for
/// importation, eliminating this loop. /// importation, eliminating this loop.
virtual Decl *GetOriginalDecl(Decl *To) { return nullptr; } virtual Decl *GetOriginalDecl(Decl *To) { return nullptr; }
/// Determine whether the given types are structurally /// Determine whether the given types are structurally
/// equivalent. /// equivalent.
bool IsStructurallyEquivalent(QualType From, QualType To, bool IsStructurallyEquivalent(QualType From, QualType To,

View File

@ -40,7 +40,7 @@ inline bool isGenericLambdaCallOperatorSpecialization(const CXXMethodDecl *MD) {
if (!MD) return false; if (!MD) return false;
const CXXRecordDecl *LambdaClass = MD->getParent(); const CXXRecordDecl *LambdaClass = MD->getParent();
if (LambdaClass && LambdaClass->isGenericLambda()) if (LambdaClass && LambdaClass->isGenericLambda())
return isLambdaCallOperator(MD) && return isLambdaCallOperator(MD) &&
MD->isFunctionTemplateSpecialization(); MD->isFunctionTemplateSpecialization();
return false; return false;
} }
@ -51,11 +51,11 @@ inline bool isLambdaConversionOperator(CXXConversionDecl *C) {
inline bool isLambdaConversionOperator(Decl *D) { inline bool isLambdaConversionOperator(Decl *D) {
if (!D) return false; if (!D) return false;
if (CXXConversionDecl *Conv = dyn_cast<CXXConversionDecl>(D)) if (CXXConversionDecl *Conv = dyn_cast<CXXConversionDecl>(D))
return isLambdaConversionOperator(Conv); return isLambdaConversionOperator(Conv);
if (FunctionTemplateDecl *F = dyn_cast<FunctionTemplateDecl>(D)) if (FunctionTemplateDecl *F = dyn_cast<FunctionTemplateDecl>(D))
if (CXXConversionDecl *Conv = if (CXXConversionDecl *Conv =
dyn_cast_or_null<CXXConversionDecl>(F->getTemplatedDecl())) dyn_cast_or_null<CXXConversionDecl>(F->getTemplatedDecl()))
return isLambdaConversionOperator(Conv); return isLambdaConversionOperator(Conv);
return false; return false;
} }
@ -71,7 +71,7 @@ inline bool isGenericLambdaCallOperatorSpecialization(DeclContext *DC) {
inline DeclContext *getLambdaAwareParentOfDeclContext(DeclContext *DC) { inline DeclContext *getLambdaAwareParentOfDeclContext(DeclContext *DC) {
if (isLambdaCallOperator(DC)) if (isLambdaCallOperator(DC))
return DC->getParent()->getParent(); return DC->getParent()->getParent();
else else
return DC->getParent(); return DC->getParent();
} }

View File

@ -134,13 +134,13 @@ public:
/// \param M The containing module in which the definition was made visible, /// \param M The containing module in which the definition was made visible,
/// if any. /// if any.
virtual void RedefinedHiddenDefinition(const NamedDecl *D, Module *M) {} virtual void RedefinedHiddenDefinition(const NamedDecl *D, Module *M) {}
/// An attribute was added to a RecordDecl /// An attribute was added to a RecordDecl
/// ///
/// \param Attr The attribute that was added to the Record /// \param Attr The attribute that was added to the Record
/// ///
/// \param Record The RecordDecl that got a new attribute /// \param Record The RecordDecl that got a new attribute
virtual void AddedAttributeToRecord(const Attr *Attr, virtual void AddedAttributeToRecord(const Attr *Attr,
const RecordDecl *Record) {} const RecordDecl *Record) {}
// NOTE: If new methods are added they should also be added to // NOTE: If new methods are added they should also be added to

View File

@ -86,7 +86,7 @@ public:
attr::Kind getKind() const { attr::Kind getKind() const {
return static_cast<attr::Kind>(AttrKind); return static_cast<attr::Kind>(AttrKind);
} }
unsigned getSpellingListIndex() const { return SpellingListIndex; } unsigned getSpellingListIndex() const { return SpellingListIndex; }
const char *getSpelling() const; const char *getSpelling() const;

View File

@ -106,7 +106,7 @@ public:
specific_attr_iterator Right) { specific_attr_iterator Right) {
assert((Left.Current == nullptr) == (Right.Current == nullptr)); assert((Left.Current == nullptr) == (Right.Current == nullptr));
if (Left.Current < Right.Current) if (Left.Current < Right.Current)
Left.AdvanceToNext(Right.Current); Left.AdvanceToNext(Right.Current);
else else
Right.AdvanceToNext(Left.Current); Right.AdvanceToNext(Left.Current);
return Left.Current == Right.Current; return Left.Current == Right.Current;

View File

@ -24,21 +24,21 @@ namespace clang {
class CXXRecordDecl; class CXXRecordDecl;
// BaseSubobject - Uniquely identifies a direct or indirect base class. // BaseSubobject - Uniquely identifies a direct or indirect base class.
// Stores both the base class decl and the offset from the most derived class to // Stores both the base class decl and the offset from the most derived class to
// the base class. Used for vtable and VTT generation. // the base class. Used for vtable and VTT generation.
class BaseSubobject { class BaseSubobject {
/// Base - The base class declaration. /// Base - The base class declaration.
const CXXRecordDecl *Base; const CXXRecordDecl *Base;
/// BaseOffset - The offset from the most derived class to the base class. /// BaseOffset - The offset from the most derived class to the base class.
CharUnits BaseOffset; CharUnits BaseOffset;
public: public:
BaseSubobject() = default; BaseSubobject() = default;
BaseSubobject(const CXXRecordDecl *Base, CharUnits BaseOffset) BaseSubobject(const CXXRecordDecl *Base, CharUnits BaseOffset)
: Base(Base), BaseOffset(BaseOffset) {} : Base(Base), BaseOffset(BaseOffset) {}
/// getBase - Returns the base class declaration. /// getBase - Returns the base class declaration.
const CXXRecordDecl *getBase() const { return Base; } const CXXRecordDecl *getBase() const { return Base; }
@ -74,7 +74,7 @@ template<> struct DenseMapInfo<clang::BaseSubobject> {
Base.getBaseOffset())); Base.getBaseOffset()));
} }
static bool isEqual(const clang::BaseSubobject &LHS, static bool isEqual(const clang::BaseSubobject &LHS,
const clang::BaseSubobject &RHS) { const clang::BaseSubobject &RHS) {
return LHS == RHS; return LHS == RHS;
} }

View File

@ -34,10 +34,10 @@ namespace clang {
class ASTContext; class ASTContext;
class NamedDecl; class NamedDecl;
/// Represents an element in a path from a derived class to a /// Represents an element in a path from a derived class to a
/// base class. /// base class.
/// ///
/// Each step in the path references the link from a /// Each step in the path references the link from a
/// derived class to one of its direct base classes, along with a /// derived class to one of its direct base classes, along with a
/// base "number" that identifies which base subobject of the /// base "number" that identifies which base subobject of the
@ -47,12 +47,12 @@ struct CXXBasePathElement {
/// class to a base class, which will be followed by this base /// class to a base class, which will be followed by this base
/// path element. /// path element.
const CXXBaseSpecifier *Base; const CXXBaseSpecifier *Base;
/// The record decl of the class that the base is a base of. /// The record decl of the class that the base is a base of.
const CXXRecordDecl *Class; const CXXRecordDecl *Class;
/// Identifies which base class subobject (of type /// Identifies which base class subobject (of type
/// \c Base->getType()) this base path element refers to. /// \c Base->getType()) this base path element refers to.
/// ///
/// This value is only valid if \c !Base->isVirtual(), because there /// This value is only valid if \c !Base->isVirtual(), because there
/// is no base numbering for the zero or one virtual bases of a /// is no base numbering for the zero or one virtual bases of a
@ -64,7 +64,7 @@ struct CXXBasePathElement {
/// (which is not represented as part of the path) to a particular /// (which is not represented as part of the path) to a particular
/// (direct or indirect) base class subobject. /// (direct or indirect) base class subobject.
/// ///
/// Individual elements in the path are described by the \c CXXBasePathElement /// Individual elements in the path are described by the \c CXXBasePathElement
/// structure, which captures both the link from a derived class to one of its /// structure, which captures both the link from a derived class to one of its
/// direct bases and identification describing which base class /// direct bases and identification describing which base class
/// subobject is being used. /// subobject is being used.
@ -121,7 +121,7 @@ class CXXBasePaths {
/// The type from which this search originated. /// The type from which this search originated.
CXXRecordDecl *Origin = nullptr; CXXRecordDecl *Origin = nullptr;
/// Paths - The actual set of paths that can be taken from the /// Paths - The actual set of paths that can be taken from the
/// derived class to the same base class. /// derived class to the same base class.
std::list<CXXBasePath> Paths; std::list<CXXBasePath> Paths;
@ -160,12 +160,12 @@ class CXXBasePaths {
/// ambiguous paths while it is looking for a path from a derived /// ambiguous paths while it is looking for a path from a derived
/// type to a base type. /// type to a base type.
bool FindAmbiguities; bool FindAmbiguities;
/// RecordPaths - Whether Sema::IsDerivedFrom should record paths /// RecordPaths - Whether Sema::IsDerivedFrom should record paths
/// while it is determining whether there are paths from a derived /// while it is determining whether there are paths from a derived
/// type to a base type. /// type to a base type.
bool RecordPaths; bool RecordPaths;
/// DetectVirtual - Whether Sema::IsDerivedFrom should abort the search /// DetectVirtual - Whether Sema::IsDerivedFrom should abort the search
/// if it finds a path that goes across a virtual base. The virtual class /// if it finds a path that goes across a virtual base. The virtual class
/// is also recorded. /// is also recorded.
@ -181,7 +181,7 @@ public:
using paths_iterator = std::list<CXXBasePath>::iterator; using paths_iterator = std::list<CXXBasePath>::iterator;
using const_paths_iterator = std::list<CXXBasePath>::const_iterator; using const_paths_iterator = std::list<CXXBasePath>::const_iterator;
using decl_iterator = NamedDecl **; using decl_iterator = NamedDecl **;
/// BasePaths - Construct a new BasePaths structure to record the /// BasePaths - Construct a new BasePaths structure to record the
/// paths for a derived-to-base search. /// paths for a derived-to-base search.
explicit CXXBasePaths(bool FindAmbiguities = true, bool RecordPaths = true, explicit CXXBasePaths(bool FindAmbiguities = true, bool RecordPaths = true,
@ -193,31 +193,31 @@ public:
paths_iterator end() { return Paths.end(); } paths_iterator end() { return Paths.end(); }
const_paths_iterator begin() const { return Paths.begin(); } const_paths_iterator begin() const { return Paths.begin(); }
const_paths_iterator end() const { return Paths.end(); } const_paths_iterator end() const { return Paths.end(); }
CXXBasePath& front() { return Paths.front(); } CXXBasePath& front() { return Paths.front(); }
const CXXBasePath& front() const { return Paths.front(); } const CXXBasePath& front() const { return Paths.front(); }
using decl_range = llvm::iterator_range<decl_iterator>; using decl_range = llvm::iterator_range<decl_iterator>;
decl_range found_decls(); decl_range found_decls();
/// Determine whether the path from the most-derived type to the /// Determine whether the path from the most-derived type to the
/// given base type is ambiguous (i.e., it refers to multiple subobjects of /// given base type is ambiguous (i.e., it refers to multiple subobjects of
/// the same base type). /// the same base type).
bool isAmbiguous(CanQualType BaseType); bool isAmbiguous(CanQualType BaseType);
/// Whether we are finding multiple paths to detect ambiguities. /// Whether we are finding multiple paths to detect ambiguities.
bool isFindingAmbiguities() const { return FindAmbiguities; } bool isFindingAmbiguities() const { return FindAmbiguities; }
/// Whether we are recording paths. /// Whether we are recording paths.
bool isRecordingPaths() const { return RecordPaths; } bool isRecordingPaths() const { return RecordPaths; }
/// Specify whether we should be recording paths or not. /// Specify whether we should be recording paths or not.
void setRecordingPaths(bool RP) { RecordPaths = RP; } void setRecordingPaths(bool RP) { RecordPaths = RP; }
/// Whether we are detecting virtual bases. /// Whether we are detecting virtual bases.
bool isDetectingVirtual() const { return DetectVirtual; } bool isDetectingVirtual() const { return DetectVirtual; }
/// The virtual base discovered on the path (if we are merely /// The virtual base discovered on the path (if we are merely
/// detecting virtuals). /// detecting virtuals).
const RecordType* getDetectedVirtual() const { const RecordType* getDetectedVirtual() const {
@ -228,11 +228,11 @@ public:
/// began /// began
CXXRecordDecl *getOrigin() const { return Origin; } CXXRecordDecl *getOrigin() const { return Origin; }
void setOrigin(CXXRecordDecl *Rec) { Origin = Rec; } void setOrigin(CXXRecordDecl *Rec) { Origin = Rec; }
/// Clear the base-paths results. /// Clear the base-paths results.
void clear(); void clear();
/// Swap this data structure's contents with another CXXBasePaths /// Swap this data structure's contents with another CXXBasePaths
/// object. /// object.
void swap(CXXBasePaths &Other); void swap(CXXBasePaths &Other);
}; };

View File

@ -85,8 +85,8 @@ public:
/// Retrieve the underlying type pointer, which refers to a /// Retrieve the underlying type pointer, which refers to a
/// canonical type, or nullptr. /// canonical type, or nullptr.
const T *getTypePtrOrNull() const { const T *getTypePtrOrNull() const {
return cast_or_null<T>(Stored.getTypePtrOrNull()); return cast_or_null<T>(Stored.getTypePtrOrNull());
} }
/// Implicit conversion to a qualified type. /// Implicit conversion to a qualified type.
@ -94,7 +94,7 @@ public:
/// Implicit conversion to bool. /// Implicit conversion to bool.
explicit operator bool() const { return !isNull(); } explicit operator bool() const { return !isNull(); }
bool isNull() const { bool isNull() const {
return Stored.isNull(); return Stored.isNull();
} }

View File

@ -61,7 +61,7 @@ namespace clang {
/// fromQuantity - Construct a CharUnits quantity from a raw integer type. /// fromQuantity - Construct a CharUnits quantity from a raw integer type.
static CharUnits fromQuantity(QuantityType Quantity) { static CharUnits fromQuantity(QuantityType Quantity) {
return CharUnits(Quantity); return CharUnits(Quantity);
} }
// Compound assignment. // Compound assignment.
@ -87,7 +87,7 @@ namespace clang {
CharUnits operator-- (int) { CharUnits operator-- (int) {
return CharUnits(Quantity--); return CharUnits(Quantity--);
} }
// Comparison operators. // Comparison operators.
bool operator== (const CharUnits &Other) const { bool operator== (const CharUnits &Other) const {
return Quantity == Other.Quantity; return Quantity == Other.Quantity;
@ -97,21 +97,21 @@ namespace clang {
} }
// Relational operators. // Relational operators.
bool operator< (const CharUnits &Other) const { bool operator< (const CharUnits &Other) const {
return Quantity < Other.Quantity; return Quantity < Other.Quantity;
} }
bool operator<= (const CharUnits &Other) const { bool operator<= (const CharUnits &Other) const {
return Quantity <= Other.Quantity; return Quantity <= Other.Quantity;
} }
bool operator> (const CharUnits &Other) const { bool operator> (const CharUnits &Other) const {
return Quantity > Other.Quantity; return Quantity > Other.Quantity;
} }
bool operator>= (const CharUnits &Other) const { bool operator>= (const CharUnits &Other) const {
return Quantity >= Other.Quantity; return Quantity >= Other.Quantity;
} }
// Other predicates. // Other predicates.
/// isZero - Test whether the quantity equals zero. /// isZero - Test whether the quantity equals zero.
bool isZero() const { return Quantity == 0; } bool isZero() const { return Quantity == 0; }
@ -172,7 +172,7 @@ namespace clang {
return CharUnits(-Quantity); return CharUnits(-Quantity);
} }
// Conversions. // Conversions.
/// getQuantity - Get the raw integer representation of this quantity. /// getQuantity - Get the raw integer representation of this quantity.
@ -205,7 +205,7 @@ namespace clang {
}; // class CharUnit }; // class CharUnit
} // namespace clang } // namespace clang
inline clang::CharUnits operator* (clang::CharUnits::QuantityType Scale, inline clang::CharUnits operator* (clang::CharUnits::QuantityType Scale,
const clang::CharUnits &CU) { const clang::CharUnits &CU) {
return CU * Scale; return CU * Scale;
} }
@ -223,8 +223,8 @@ template<> struct DenseMapInfo<clang::CharUnits> {
static clang::CharUnits getTombstoneKey() { static clang::CharUnits getTombstoneKey() {
clang::CharUnits::QuantityType Quantity = clang::CharUnits::QuantityType Quantity =
DenseMapInfo<clang::CharUnits::QuantityType>::getTombstoneKey(); DenseMapInfo<clang::CharUnits::QuantityType>::getTombstoneKey();
return clang::CharUnits::fromQuantity(Quantity); return clang::CharUnits::fromQuantity(Quantity);
} }
static unsigned getHashValue(const clang::CharUnits &CU) { static unsigned getHashValue(const clang::CharUnits &CU) {
@ -232,7 +232,7 @@ template<> struct DenseMapInfo<clang::CharUnits> {
return DenseMapInfo<clang::CharUnits::QuantityType>::getHashValue(Quantity); return DenseMapInfo<clang::CharUnits::QuantityType>::getHashValue(Quantity);
} }
static bool isEqual(const clang::CharUnits &LHS, static bool isEqual(const clang::CharUnits &LHS,
const clang::CharUnits &RHS) { const clang::CharUnits &RHS) {
return LHS == RHS; return LHS == RHS;
} }
@ -241,7 +241,7 @@ template<> struct DenseMapInfo<clang::CharUnits> {
template <> struct isPodLike<clang::CharUnits> { template <> struct isPodLike<clang::CharUnits> {
static const bool value = true; static const bool value = true;
}; };
} // end namespace llvm } // end namespace llvm
#endif // LLVM_CLANG_AST_CHARUNITS_H #endif // LLVM_CLANG_AST_CHARUNITS_H

View File

@ -98,7 +98,7 @@ protected:
unsigned RenderKind : 2; unsigned RenderKind : 2;
unsigned CommandID : CommandInfo::NumCommandIDBits; unsigned CommandID : CommandInfo::NumCommandIDBits;
}; };
enum { NumInlineCommandCommentBits = NumInlineContentCommentBits + 2 + enum { NumInlineCommandCommentBits = NumInlineContentCommentBits + 2 +
CommandInfo::NumCommandIDBits }; CommandInfo::NumCommandIDBits };
class HTMLTagCommentBitfields { class HTMLTagCommentBitfields {
@ -146,7 +146,7 @@ protected:
/// Contains values from CommandMarkerKind enum. /// Contains values from CommandMarkerKind enum.
unsigned CommandMarker : 1; unsigned CommandMarker : 1;
}; };
enum { NumBlockCommandCommentBits = NumCommentBits + enum { NumBlockCommandCommentBits = NumCommentBits +
CommandInfo::NumCommandIDBits + 1 }; CommandInfo::NumCommandIDBits + 1 };
class ParamCommandCommentBitfields { class ParamCommandCommentBitfields {
@ -987,7 +987,7 @@ struct DeclInfo {
/// Declaration the comment is actually attached to (in the source). /// Declaration the comment is actually attached to (in the source).
/// Should not be NULL. /// Should not be NULL.
const Decl *CommentDecl; const Decl *CommentDecl;
/// CurrentDecl is the declaration with which the FullComment is associated. /// CurrentDecl is the declaration with which the FullComment is associated.
/// ///
/// It can be different from \c CommentDecl. It happens when we decide /// It can be different from \c CommentDecl. It happens when we decide
@ -997,7 +997,7 @@ struct DeclInfo {
/// ///
/// The information in the DeclInfo corresponds to CurrentDecl. /// The information in the DeclInfo corresponds to CurrentDecl.
const Decl *CurrentDecl; const Decl *CurrentDecl;
/// Parameters that can be referenced by \\param if \c CommentDecl is something /// Parameters that can be referenced by \\param if \c CommentDecl is something
/// that we consider a "function". /// that we consider a "function".
ArrayRef<const ParmVarDecl *> ParamVars; ArrayRef<const ParmVarDecl *> ParamVars;
@ -1119,21 +1119,21 @@ public:
} }
child_iterator child_end() const { child_iterator child_end() const {
return reinterpret_cast<child_iterator>(Blocks.end()); return reinterpret_cast<child_iterator>(Blocks.end());
} }
const Decl *getDecl() const LLVM_READONLY { const Decl *getDecl() const LLVM_READONLY {
return ThisDeclInfo->CommentDecl; return ThisDeclInfo->CommentDecl;
} }
const DeclInfo *getDeclInfo() const LLVM_READONLY { const DeclInfo *getDeclInfo() const LLVM_READONLY {
if (!ThisDeclInfo->IsFilled) if (!ThisDeclInfo->IsFilled)
ThisDeclInfo->fill(); ThisDeclInfo->fill();
return ThisDeclInfo; return ThisDeclInfo;
} }
ArrayRef<BlockContentComment *> getBlocks() const { return Blocks; } ArrayRef<BlockContentComment *> getBlocks() const { return Blocks; }
}; };
} // end namespace comments } // end namespace comments
} // end namespace clang } // end namespace clang

View File

@ -107,17 +107,17 @@ struct CommandInfo {
/// \fn void f(int a); /// \fn void f(int a);
/// \endcode /// \endcode
unsigned IsDeclarationCommand : 1; unsigned IsDeclarationCommand : 1;
/// True if verbatim-like line command is a function declaration. /// True if verbatim-like line command is a function declaration.
unsigned IsFunctionDeclarationCommand : 1; unsigned IsFunctionDeclarationCommand : 1;
/// True if block command is further describing a container API; such /// True if block command is further describing a container API; such
/// as \@coclass, \@classdesign, etc. /// as \@coclass, \@classdesign, etc.
unsigned IsRecordLikeDetailCommand : 1; unsigned IsRecordLikeDetailCommand : 1;
/// True if block command is a container API; such as \@interface. /// True if block command is a container API; such as \@interface.
unsigned IsRecordLikeDeclarationCommand : 1; unsigned IsRecordLikeDeclarationCommand : 1;
/// True if this command is unknown. This \c CommandInfo object was /// True if this command is unknown. This \c CommandInfo object was
/// created during parsing. /// created during parsing.
unsigned IsUnknownCommand : 1; unsigned IsUnknownCommand : 1;
@ -150,7 +150,7 @@ public:
} }
const CommandInfo *getTypoCorrectCommandInfo(StringRef Typo) const; const CommandInfo *getTypoCorrectCommandInfo(StringRef Typo) const;
const CommandInfo *getCommandInfo(unsigned CommandID) const; const CommandInfo *getCommandInfo(unsigned CommandID) const;
const CommandInfo *registerUnknownCommand(StringRef CommandName); const CommandInfo *registerUnknownCommand(StringRef CommandName);

View File

@ -76,7 +76,7 @@ class Token {
/// unused (command spelling can be found with CommandTraits). Otherwise, /// unused (command spelling can be found with CommandTraits). Otherwise,
/// contains the length of the string that starts at TextPtr. /// contains the length of the string that starts at TextPtr.
unsigned IntVal; unsigned IntVal;
public: public:
SourceLocation getLocation() const LLVM_READONLY { return Loc; } SourceLocation getLocation() const LLVM_READONLY { return Loc; }
void setLocation(SourceLocation SL) { Loc = SL; } void setLocation(SourceLocation SL) { Loc = SL; }
@ -228,7 +228,7 @@ private:
llvm::BumpPtrAllocator &Allocator; llvm::BumpPtrAllocator &Allocator;
DiagnosticsEngine &Diags; DiagnosticsEngine &Diags;
const CommandTraits &Traits; const CommandTraits &Traits;
const char *const BufferStart; const char *const BufferStart;

View File

@ -191,11 +191,11 @@ public:
void checkBlockCommandDuplicate(const BlockCommandComment *Command); void checkBlockCommandDuplicate(const BlockCommandComment *Command);
void checkDeprecatedCommand(const BlockCommandComment *Comment); void checkDeprecatedCommand(const BlockCommandComment *Comment);
void checkFunctionDeclVerbatimLine(const BlockCommandComment *Comment); void checkFunctionDeclVerbatimLine(const BlockCommandComment *Comment);
void checkContainerDeclVerbatimLine(const BlockCommandComment *Comment); void checkContainerDeclVerbatimLine(const BlockCommandComment *Comment);
void checkContainerDecl(const BlockCommandComment *Comment); void checkContainerDecl(const BlockCommandComment *Comment);
/// Resolve parameter names to parameter indexes in function declaration. /// Resolve parameter names to parameter indexes in function declaration.

View File

@ -98,7 +98,7 @@ public:
/// Return the TypeLoc wrapper for the type source info. /// Return the TypeLoc wrapper for the type source info.
TypeLoc getTypeLoc() const; // implemented in TypeLoc.h TypeLoc getTypeLoc() const; // implemented in TypeLoc.h
/// Override the type stored in this TypeSourceInfo. Use with caution! /// Override the type stored in this TypeSourceInfo. Use with caution!
void overrideType(QualType T) { Ty = T; } void overrideType(QualType T) { Ty = T; }
}; };
@ -488,7 +488,7 @@ public:
SourceLocation IdentL, IdentifierInfo *II, SourceLocation IdentL, IdentifierInfo *II,
SourceLocation GnuLabelL); SourceLocation GnuLabelL);
static LabelDecl *CreateDeserialized(ASTContext &C, unsigned ID); static LabelDecl *CreateDeserialized(ASTContext &C, unsigned ID);
LabelStmt *getStmt() const { return TheStmt; } LabelStmt *getStmt() const { return TheStmt; }
void setStmt(LabelStmt *T) { TheStmt = T; } void setStmt(LabelStmt *T) { TheStmt = T; }
@ -511,8 +511,8 @@ public:
}; };
/// Represent a C++ namespace. /// Represent a C++ namespace.
class NamespaceDecl : public NamedDecl, public DeclContext, class NamespaceDecl : public NamedDecl, public DeclContext,
public Redeclarable<NamespaceDecl> public Redeclarable<NamespaceDecl>
{ {
/// The starting location of the source range, pointing /// The starting location of the source range, pointing
/// to either the namespace or the inline keyword. /// to either the namespace or the inline keyword.
@ -523,7 +523,7 @@ class NamespaceDecl : public NamedDecl, public DeclContext,
/// A pointer to either the anonymous namespace that lives just inside /// A pointer to either the anonymous namespace that lives just inside
/// this namespace or to the first namespace in the chain (the latter case /// this namespace or to the first namespace in the chain (the latter case
/// only when this is not the first in the chain), along with a /// only when this is not the first in the chain), along with a
/// boolean value indicating whether this is an inline namespace. /// boolean value indicating whether this is an inline namespace.
llvm::PointerIntPair<NamespaceDecl *, 1, bool> AnonOrFirstNamespaceAndInline; llvm::PointerIntPair<NamespaceDecl *, 1, bool> AnonOrFirstNamespaceAndInline;
@ -1931,7 +1931,7 @@ public:
bool isConstexprSpecified = false); bool isConstexprSpecified = false);
static FunctionDecl *CreateDeserialized(ASTContext &C, unsigned ID); static FunctionDecl *CreateDeserialized(ASTContext &C, unsigned ID);
DeclarationNameInfo getNameInfo() const { DeclarationNameInfo getNameInfo() const {
return DeclarationNameInfo(getDeclName(), getLocation(), DNLoc); return DeclarationNameInfo(getDeclName(), getLocation(), DNLoc);
} }
@ -2598,7 +2598,7 @@ public:
InClassInitStyle InitStyle); InClassInitStyle InitStyle);
static FieldDecl *CreateDeserialized(ASTContext &C, unsigned ID); static FieldDecl *CreateDeserialized(ASTContext &C, unsigned ID);
/// Returns the index of this field within its record, /// Returns the index of this field within its record,
/// as appropriate for passing to ASTRecordLayout::getFieldOffset. /// as appropriate for passing to ASTRecordLayout::getFieldOffset.
unsigned getFieldIndex() const; unsigned getFieldIndex() const;
@ -2754,7 +2754,7 @@ public:
QualType T, Expr *E, QualType T, Expr *E,
const llvm::APSInt &V); const llvm::APSInt &V);
static EnumConstantDecl *CreateDeserialized(ASTContext &C, unsigned ID); static EnumConstantDecl *CreateDeserialized(ASTContext &C, unsigned ID);
const Expr *getInitExpr() const { return (const Expr*) Init; } const Expr *getInitExpr() const { return (const Expr*) Init; }
Expr *getInitExpr() { return (Expr*) Init; } Expr *getInitExpr() { return (Expr*) Init; }
const llvm::APSInt &getInitVal() const { return Val; } const llvm::APSInt &getInitVal() const { return Val; }
@ -3812,7 +3812,7 @@ public:
/// Finds the first data member which has a name. /// Finds the first data member which has a name.
/// nullptr is returned if no named data member exists. /// nullptr is returned if no named data member exists.
const FieldDecl *findFirstNamedDataMember() const; const FieldDecl *findFirstNamedDataMember() const;
private: private:
/// Deserialize just the fields. /// Deserialize just the fields.
@ -3835,7 +3835,7 @@ public:
SourceLocation RParenLoc); SourceLocation RParenLoc);
static FileScopeAsmDecl *CreateDeserialized(ASTContext &C, unsigned ID); static FileScopeAsmDecl *CreateDeserialized(ASTContext &C, unsigned ID);
SourceLocation getAsmLoc() const { return getLocation(); } SourceLocation getAsmLoc() const { return getLocation(); }
SourceLocation getRParenLoc() const { return RParenLoc; } SourceLocation getRParenLoc() const { return RParenLoc; }
void setRParenLoc(SourceLocation L) { RParenLoc = L; } void setRParenLoc(SourceLocation L) { RParenLoc = L; }
@ -3927,9 +3927,9 @@ protected:
IsConversionFromLambda(false), DoesNotEscape(false) {} IsConversionFromLambda(false), DoesNotEscape(false) {}
public: public:
static BlockDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L); static BlockDecl *Create(ASTContext &C, DeclContext *DC, SourceLocation L);
static BlockDecl *CreateDeserialized(ASTContext &C, unsigned ID); static BlockDecl *CreateDeserialized(ASTContext &C, unsigned ID);
SourceLocation getCaretLocation() const { return getLocation(); } SourceLocation getCaretLocation() const { return getLocation(); }
bool isVariadic() const { return IsVariadic; } bool isVariadic() const { return IsVariadic; }
@ -4009,7 +4009,7 @@ public:
} }
Decl *getBlockManglingContextDecl() const { Decl *getBlockManglingContextDecl() const {
return ManglingContextDecl; return ManglingContextDecl;
} }
void setBlockMangling(unsigned Number, Decl *Ctx) { void setBlockMangling(unsigned Number, Decl *Ctx) {
@ -4145,16 +4145,16 @@ class ImportDecl final : public Decl,
/// The imported module, along with a bit that indicates whether /// The imported module, along with a bit that indicates whether
/// we have source-location information for each identifier in the module /// we have source-location information for each identifier in the module
/// name. /// name.
/// ///
/// When the bit is false, we only have a single source location for the /// When the bit is false, we only have a single source location for the
/// end of the import declaration. /// end of the import declaration.
llvm::PointerIntPair<Module *, 1, bool> ImportedAndComplete; llvm::PointerIntPair<Module *, 1, bool> ImportedAndComplete;
/// The next import in the list of imports local to the translation /// The next import in the list of imports local to the translation
/// unit being parsed (not loaded from an AST file). /// unit being parsed (not loaded from an AST file).
ImportDecl *NextLocalImport = nullptr; ImportDecl *NextLocalImport = nullptr;
ImportDecl(DeclContext *DC, SourceLocation StartLoc, Module *Imported, ImportDecl(DeclContext *DC, SourceLocation StartLoc, Module *Imported,
ArrayRef<SourceLocation> IdentifierLocs); ArrayRef<SourceLocation> IdentifierLocs);
@ -4162,26 +4162,26 @@ class ImportDecl final : public Decl,
SourceLocation EndLoc); SourceLocation EndLoc);
ImportDecl(EmptyShell Empty) : Decl(Import, Empty) {} ImportDecl(EmptyShell Empty) : Decl(Import, Empty) {}
public: public:
/// Create a new module import declaration. /// Create a new module import declaration.
static ImportDecl *Create(ASTContext &C, DeclContext *DC, static ImportDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation StartLoc, Module *Imported, SourceLocation StartLoc, Module *Imported,
ArrayRef<SourceLocation> IdentifierLocs); ArrayRef<SourceLocation> IdentifierLocs);
/// Create a new module import declaration for an implicitly-generated /// Create a new module import declaration for an implicitly-generated
/// import. /// import.
static ImportDecl *CreateImplicit(ASTContext &C, DeclContext *DC, static ImportDecl *CreateImplicit(ASTContext &C, DeclContext *DC,
SourceLocation StartLoc, Module *Imported, SourceLocation StartLoc, Module *Imported,
SourceLocation EndLoc); SourceLocation EndLoc);
/// Create a new, deserialized module import declaration. /// Create a new, deserialized module import declaration.
static ImportDecl *CreateDeserialized(ASTContext &C, unsigned ID, static ImportDecl *CreateDeserialized(ASTContext &C, unsigned ID,
unsigned NumLocations); unsigned NumLocations);
/// Retrieve the module that was imported by the import declaration. /// Retrieve the module that was imported by the import declaration.
Module *getImportedModule() const { return ImportedAndComplete.getPointer(); } Module *getImportedModule() const { return ImportedAndComplete.getPointer(); }
/// Retrieves the locations of each of the identifiers that make up /// Retrieves the locations of each of the identifiers that make up
/// the complete module name in the import declaration. /// the complete module name in the import declaration.
/// ///
@ -4218,7 +4218,7 @@ public:
static ExportDecl *Create(ASTContext &C, DeclContext *DC, static ExportDecl *Create(ASTContext &C, DeclContext *DC,
SourceLocation ExportLoc); SourceLocation ExportLoc);
static ExportDecl *CreateDeserialized(ASTContext &C, unsigned ID); static ExportDecl *CreateDeserialized(ASTContext &C, unsigned ID);
SourceLocation getExportLoc() const { return getLocation(); } SourceLocation getExportLoc() const { return getLocation(); }
SourceLocation getRBraceLoc() const { return RBraceLoc; } SourceLocation getRBraceLoc() const { return RBraceLoc; }
void setRBraceLoc(SourceLocation L) { RBraceLoc = L; } void setRBraceLoc(SourceLocation L) { RBraceLoc = L; }

View File

@ -302,7 +302,7 @@ private:
/// global variable, etc.) that is lexically inside an objc container /// global variable, etc.) that is lexically inside an objc container
/// definition. /// definition.
unsigned TopLevelDeclInObjCContainer : 1; unsigned TopLevelDeclInObjCContainer : 1;
/// Whether statistic collection is enabled. /// Whether statistic collection is enabled.
static bool StatisticsEnabled; static bool StatisticsEnabled;
@ -629,7 +629,7 @@ protected:
assert(isFromASTFile() && "Only works on a deserialized declaration"); assert(isFromASTFile() && "Only works on a deserialized declaration");
*((unsigned*)this - 2) = ID; *((unsigned*)this - 2) = ID;
} }
public: public:
/// Determine the availability of the given declaration. /// Determine the availability of the given declaration.
/// ///
@ -879,7 +879,7 @@ public:
/// Whether this particular Decl is a canonical one. /// Whether this particular Decl is a canonical one.
bool isCanonicalDecl() const { return getCanonicalDecl() == this; } bool isCanonicalDecl() const { return getCanonicalDecl() == this; }
protected: protected:
/// Returns the next redeclaration or itself if this is the only decl. /// Returns the next redeclaration or itself if this is the only decl.
/// ///
@ -956,10 +956,10 @@ public:
/// Retrieve the previous declaration that declares the same entity /// Retrieve the previous declaration that declares the same entity
/// as this declaration, or NULL if there is no previous declaration. /// as this declaration, or NULL if there is no previous declaration.
Decl *getPreviousDecl() { return getPreviousDeclImpl(); } Decl *getPreviousDecl() { return getPreviousDeclImpl(); }
/// Retrieve the most recent declaration that declares the same entity /// Retrieve the most recent declaration that declares the same entity
/// as this declaration, or NULL if there is no previous declaration. /// as this declaration, or NULL if there is no previous declaration.
const Decl *getPreviousDecl() const { const Decl *getPreviousDecl() const {
return const_cast<Decl *>(this)->getPreviousDeclImpl(); return const_cast<Decl *>(this)->getPreviousDeclImpl();
} }
@ -974,7 +974,7 @@ public:
/// Retrieve the most recent declaration that declares the same entity /// Retrieve the most recent declaration that declares the same entity
/// as this declaration (which may be this declaration). /// as this declaration (which may be this declaration).
const Decl *getMostRecentDecl() const { const Decl *getMostRecentDecl() const {
return const_cast<Decl *>(this)->getMostRecentDeclImpl(); return const_cast<Decl *>(this)->getMostRecentDeclImpl();
} }
@ -1159,13 +1159,13 @@ protected:
inline bool declaresSameEntity(const Decl *D1, const Decl *D2) { inline bool declaresSameEntity(const Decl *D1, const Decl *D2) {
if (!D1 || !D2) if (!D1 || !D2)
return false; return false;
if (D1 == D2) if (D1 == D2)
return true; return true;
return D1->getCanonicalDecl() == D2->getCanonicalDecl(); return D1->getCanonicalDecl() == D2->getCanonicalDecl();
} }
/// PrettyStackTraceDecl - If a crash occurs, indicate that it happened when /// PrettyStackTraceDecl - If a crash occurs, indicate that it happened when
/// doing something to a specific decl. /// doing something to a specific decl.
class PrettyStackTraceDecl : public llvm::PrettyStackTraceEntry { class PrettyStackTraceDecl : public llvm::PrettyStackTraceEntry {
@ -1517,7 +1517,7 @@ public:
/// connected to this declaration context. /// connected to this declaration context.
/// ///
/// For declaration contexts that have multiple semantically connected but /// For declaration contexts that have multiple semantically connected but
/// syntactically distinct contexts, such as C++ namespaces, this routine /// syntactically distinct contexts, such as C++ namespaces, this routine
/// retrieves the complete set of such declaration contexts in source order. /// retrieves the complete set of such declaration contexts in source order.
/// For example, given: /// For example, given:
/// ///
@ -1921,7 +1921,7 @@ public:
/// Determine whether the given declaration is stored in the list of /// Determine whether the given declaration is stored in the list of
/// declarations lexically within this context. /// declarations lexically within this context.
bool isDeclInLexicalTraversal(const Decl *D) const { bool isDeclInLexicalTraversal(const Decl *D) const {
return D && (D->NextInContextAndBits.getPointer() || D == FirstDecl || return D && (D->NextInContextAndBits.getPointer() || D == FirstDecl ||
D == LastDecl); D == LastDecl);
} }

View File

@ -264,7 +264,7 @@ public:
return EllipsisLoc; return EllipsisLoc;
} }
/// Returns the access specifier for this base specifier. /// Returns the access specifier for this base specifier.
/// ///
/// This is the actual base specifier as used for semantic analysis, so /// This is the actual base specifier as used for semantic analysis, so
/// the result can never be AS_none. To retrieve the access specifier as /// the result can never be AS_none. To retrieve the access specifier as
@ -564,7 +564,7 @@ class CXXRecordDecl : public RecordDecl {
CXXRecordDecl *Definition; CXXRecordDecl *Definition;
/// The first friend declaration in this class, or null if there /// The first friend declaration in this class, or null if there
/// aren't any. /// aren't any.
/// ///
/// This is actually currently stored in reverse order. /// This is actually currently stored in reverse order.
LazyDeclPtr FirstFriend; LazyDeclPtr FirstFriend;
@ -606,14 +606,14 @@ class CXXRecordDecl : public RecordDecl {
/// Whether this lambda is known to be dependent, even if its /// Whether this lambda is known to be dependent, even if its
/// context isn't dependent. /// context isn't dependent.
/// ///
/// A lambda with a non-dependent context can be dependent if it occurs /// A lambda with a non-dependent context can be dependent if it occurs
/// within the default argument of a function template, because the /// within the default argument of a function template, because the
/// lambda will have been created with the enclosing context as its /// lambda will have been created with the enclosing context as its
/// declaration context, rather than function. This is an unfortunate /// declaration context, rather than function. This is an unfortunate
/// artifact of having to parse the default arguments before. /// artifact of having to parse the default arguments before.
unsigned Dependent : 1; unsigned Dependent : 1;
/// Whether this lambda is a generic lambda. /// Whether this lambda is a generic lambda.
unsigned IsGenericLambda : 1; unsigned IsGenericLambda : 1;
@ -626,28 +626,28 @@ class CXXRecordDecl : public RecordDecl {
/// The number of explicit captures in this lambda. /// The number of explicit captures in this lambda.
unsigned NumExplicitCaptures : 13; unsigned NumExplicitCaptures : 13;
/// The number used to indicate this lambda expression for name /// The number used to indicate this lambda expression for name
/// mangling in the Itanium C++ ABI. /// mangling in the Itanium C++ ABI.
unsigned ManglingNumber = 0; unsigned ManglingNumber = 0;
/// The declaration that provides context for this lambda, if the /// The declaration that provides context for this lambda, if the
/// actual DeclContext does not suffice. This is used for lambdas that /// actual DeclContext does not suffice. This is used for lambdas that
/// occur within default arguments of function parameters within the class /// occur within default arguments of function parameters within the class
/// or within a data member initializer. /// or within a data member initializer.
LazyDeclPtr ContextDecl; LazyDeclPtr ContextDecl;
/// The list of captures, both explicit and implicit, for this /// The list of captures, both explicit and implicit, for this
/// lambda. /// lambda.
Capture *Captures = nullptr; Capture *Captures = nullptr;
/// The type of the call method. /// The type of the call method.
TypeSourceInfo *MethodTyInfo; TypeSourceInfo *MethodTyInfo;
LambdaDefinitionData(CXXRecordDecl *D, TypeSourceInfo *Info, LambdaDefinitionData(CXXRecordDecl *D, TypeSourceInfo *Info,
bool Dependent, bool IsGeneric, bool Dependent, bool IsGeneric,
LambdaCaptureDefault CaptureDefault) LambdaCaptureDefault CaptureDefault)
: DefinitionData(D), Dependent(Dependent), IsGenericLambda(IsGeneric), : DefinitionData(D), Dependent(Dependent), IsGenericLambda(IsGeneric),
CaptureDefault(CaptureDefault), NumCaptures(0), NumExplicitCaptures(0), CaptureDefault(CaptureDefault), NumCaptures(0), NumExplicitCaptures(0),
MethodTyInfo(Info) { MethodTyInfo(Info) {
IsLambda = true; IsLambda = true;
@ -1205,22 +1205,22 @@ public:
return DD && DD->IsLambda; return DD && DD->IsLambda;
} }
/// Determine whether this class describes a generic /// Determine whether this class describes a generic
/// lambda function object (i.e. function call operator is /// lambda function object (i.e. function call operator is
/// a template). /// a template).
bool isGenericLambda() const; bool isGenericLambda() const;
/// Retrieve the lambda call operator of the closure type /// Retrieve the lambda call operator of the closure type
/// if this is a closure type. /// if this is a closure type.
CXXMethodDecl *getLambdaCallOperator() const; CXXMethodDecl *getLambdaCallOperator() const;
/// Retrieve the lambda static invoker, the address of which /// Retrieve the lambda static invoker, the address of which
/// is returned by the conversion operator, and the body of which /// is returned by the conversion operator, and the body of which
/// is forwarded to the lambda call operator. /// is forwarded to the lambda call operator.
CXXMethodDecl *getLambdaStaticInvoker() const; CXXMethodDecl *getLambdaStaticInvoker() const;
/// Retrieve the generic lambda's template parameter list. /// Retrieve the generic lambda's template parameter list.
/// Returns null if the class does not represent a lambda or a generic /// Returns null if the class does not represent a lambda or a generic
/// lambda. /// lambda.
TemplateParameterList *getGenericLambdaTemplateParameterList() const; TemplateParameterList *getGenericLambdaTemplateParameterList() const;
@ -1345,11 +1345,11 @@ public:
/// not overridden. /// not overridden.
bool isAbstract() const { return data().Abstract; } bool isAbstract() const { return data().Abstract; }
/// Determine whether this class is standard-layout per /// Determine whether this class is standard-layout per
/// C++ [class]p7. /// C++ [class]p7.
bool isStandardLayout() const { return data().IsStandardLayout; } bool isStandardLayout() const { return data().IsStandardLayout; }
/// Determine whether this class was standard-layout per /// Determine whether this class was standard-layout per
/// C++11 [class]p7, specifically using the C++11 rules without any DRs. /// C++11 [class]p7, specifically using the C++11 rules without any DRs.
bool isCXX11StandardLayout() const { return data().IsCXX11StandardLayout; } bool isCXX11StandardLayout() const { return data().IsCXX11StandardLayout; }
@ -1900,25 +1900,25 @@ public:
/// If this is the closure type of a lambda expression, retrieve the /// If this is the closure type of a lambda expression, retrieve the
/// number to be used for name mangling in the Itanium C++ ABI. /// number to be used for name mangling in the Itanium C++ ABI.
/// ///
/// Zero indicates that this closure type has internal linkage, so the /// Zero indicates that this closure type has internal linkage, so the
/// mangling number does not matter, while a non-zero value indicates which /// mangling number does not matter, while a non-zero value indicates which
/// lambda expression this is in this particular context. /// lambda expression this is in this particular context.
unsigned getLambdaManglingNumber() const { unsigned getLambdaManglingNumber() const {
assert(isLambda() && "Not a lambda closure type!"); assert(isLambda() && "Not a lambda closure type!");
return getLambdaData().ManglingNumber; return getLambdaData().ManglingNumber;
} }
/// Retrieve the declaration that provides additional context for a /// Retrieve the declaration that provides additional context for a
/// lambda, when the normal declaration context is not specific enough. /// lambda, when the normal declaration context is not specific enough.
/// ///
/// Certain contexts (default arguments of in-class function parameters and /// Certain contexts (default arguments of in-class function parameters and
/// the initializers of data members) have separate name mangling rules for /// the initializers of data members) have separate name mangling rules for
/// lambdas within the Itanium C++ ABI. For these cases, this routine provides /// lambdas within the Itanium C++ ABI. For these cases, this routine provides
/// the declaration in which the lambda occurs, e.g., the function parameter /// the declaration in which the lambda occurs, e.g., the function parameter
/// or the non-static data member. Otherwise, it returns NULL to imply that /// or the non-static data member. Otherwise, it returns NULL to imply that
/// the declaration context suffices. /// the declaration context suffices.
Decl *getLambdaContextDecl() const; Decl *getLambdaContextDecl() const;
/// Set the mangling number and context declaration for a lambda /// Set the mangling number and context declaration for a lambda
/// class. /// class.
void setLambdaMangling(unsigned ManglingNumber, Decl *ContextDecl) { void setLambdaMangling(unsigned ManglingNumber, Decl *ContextDecl) {
@ -2799,7 +2799,7 @@ public:
/// Determine whether this conversion function is a conversion from /// Determine whether this conversion function is a conversion from
/// a lambda closure type to a block pointer. /// a lambda closure type to a block pointer.
bool isLambdaToBlockPointerConversion() const; bool isLambdaToBlockPointerConversion() const;
CXXConversionDecl *getCanonicalDecl() override { CXXConversionDecl *getCanonicalDecl() override {
return cast<CXXConversionDecl>(FunctionDecl::getCanonicalDecl()); return cast<CXXConversionDecl>(FunctionDecl::getCanonicalDecl());
} }
@ -2812,7 +2812,7 @@ public:
static bool classofKind(Kind K) { return K == CXXConversion; } static bool classofKind(Kind K) { return K == CXXConversion; }
}; };
/// Represents a linkage specification. /// Represents a linkage specification.
/// ///
/// For example: /// For example:
/// \code /// \code
@ -2862,7 +2862,7 @@ public:
SourceLocation LangLoc, LanguageIDs Lang, SourceLocation LangLoc, LanguageIDs Lang,
bool HasBraces); bool HasBraces);
static LinkageSpecDecl *CreateDeserialized(ASTContext &C, unsigned ID); static LinkageSpecDecl *CreateDeserialized(ASTContext &C, unsigned ID);
/// Return the language specified by this linkage specification. /// Return the language specified by this linkage specification.
LanguageIDs getLanguage() const { return LanguageIDs(Language); } LanguageIDs getLanguage() const { return LanguageIDs(Language); }
@ -3770,7 +3770,7 @@ public:
Expr *AssertExpr, StringLiteral *Message, Expr *AssertExpr, StringLiteral *Message,
SourceLocation RParenLoc, bool Failed); SourceLocation RParenLoc, bool Failed);
static StaticAssertDecl *CreateDeserialized(ASTContext &C, unsigned ID); static StaticAssertDecl *CreateDeserialized(ASTContext &C, unsigned ID);
Expr *getAssertExpr() { return AssertExprAndFailed.getPointer(); } Expr *getAssertExpr() { return AssertExprAndFailed.getPointer(); }
const Expr *getAssertExpr() const { return AssertExprAndFailed.getPointer(); } const Expr *getAssertExpr() const { return AssertExprAndFailed.getPointer(); }

View File

@ -254,7 +254,7 @@ inline void CXXRecordDecl::pushFriendDecl(FriendDecl *FD) {
FD->NextFriend = data().FirstFriend; FD->NextFriend = data().FirstFriend;
data().FirstFriend = FD; data().FirstFriend = FD;
} }
} // namespace clang } // namespace clang
#endif // LLVM_CLANG_AST_DECLFRIEND_H #endif // LLVM_CLANG_AST_DECLFRIEND_H

View File

@ -54,7 +54,7 @@ public:
++It; ++It;
} while (It != End && } while (It != End &&
It->first == DeclarationName::getUsingDirectiveName()); It->first == DeclarationName::getUsingDirectiveName());
return *this; return *this;
} }

View File

@ -587,7 +587,7 @@ class ObjCTypeParamDecl : public TypedefNameDecl {
/// explicitly specified. /// explicitly specified.
SourceLocation ColonLoc; SourceLocation ColonLoc;
ObjCTypeParamDecl(ASTContext &ctx, DeclContext *dc, ObjCTypeParamDecl(ASTContext &ctx, DeclContext *dc,
ObjCTypeParamVariance variance, SourceLocation varianceLoc, ObjCTypeParamVariance variance, SourceLocation varianceLoc,
unsigned index, unsigned index,
SourceLocation nameLoc, IdentifierInfo *name, SourceLocation nameLoc, IdentifierInfo *name,
@ -659,7 +659,7 @@ class ObjCTypeParamList final
unsigned End; unsigned End;
}; };
union { union {
/// Location of the left and right angle brackets. /// Location of the left and right angle brackets.
PODSourceRange Brackets; PODSourceRange Brackets;
@ -1123,7 +1123,7 @@ public:
ObjCPropertyDecl *>; ObjCPropertyDecl *>;
using ProtocolPropertySet = llvm::SmallDenseSet<const ObjCProtocolDecl *, 8>; using ProtocolPropertySet = llvm::SmallDenseSet<const ObjCProtocolDecl *, 8>;
using PropertyDeclOrder = llvm::SmallVector<ObjCPropertyDecl *, 8>; using PropertyDeclOrder = llvm::SmallVector<ObjCPropertyDecl *, 8>;
/// This routine collects list of properties to be implemented in the class. /// This routine collects list of properties to be implemented in the class.
/// This includes, class's and its conforming protocols' properties. /// This includes, class's and its conforming protocols' properties.
/// Note, the superclass's properties are not included in the list. /// Note, the superclass's properties are not included in the list.
@ -1195,15 +1195,15 @@ class ObjCInterfaceDecl : public ObjCContainerDecl
/// TypeForDecl - This indicates the Type object that represents this /// TypeForDecl - This indicates the Type object that represents this
/// TypeDecl. It is a cache maintained by ASTContext::getObjCInterfaceType /// TypeDecl. It is a cache maintained by ASTContext::getObjCInterfaceType
mutable const Type *TypeForDecl = nullptr; mutable const Type *TypeForDecl = nullptr;
struct DefinitionData { struct DefinitionData {
/// The definition of this class, for quick access from any /// The definition of this class, for quick access from any
/// declaration. /// declaration.
ObjCInterfaceDecl *Definition = nullptr; ObjCInterfaceDecl *Definition = nullptr;
/// When non-null, this is always an ObjCObjectType. /// When non-null, this is always an ObjCObjectType.
TypeSourceInfo *SuperClassTInfo = nullptr; TypeSourceInfo *SuperClassTInfo = nullptr;
/// Protocols referenced in the \@interface declaration /// Protocols referenced in the \@interface declaration
ObjCProtocolList ReferencedProtocols; ObjCProtocolList ReferencedProtocols;
@ -1247,11 +1247,11 @@ class ObjCInterfaceDecl : public ObjCContainerDecl
/// One of the \c InheritedDesignatedInitializersState enumeratos. /// One of the \c InheritedDesignatedInitializersState enumeratos.
mutable unsigned InheritedDesignatedInitializers : 2; mutable unsigned InheritedDesignatedInitializers : 2;
/// The location of the last location in this declaration, before /// The location of the last location in this declaration, before
/// the properties/methods. For example, this will be the '>', '}', or /// the properties/methods. For example, this will be the '>', '}', or
/// identifier, /// identifier,
SourceLocation EndLoc; SourceLocation EndLoc;
DefinitionData() DefinitionData()
: ExternallyCompleted(false), IvarListMissingImplementation(true), : ExternallyCompleted(false), IvarListMissingImplementation(true),
@ -1285,7 +1285,7 @@ class ObjCInterfaceDecl : public ObjCContainerDecl
/// Allocate the definition data for this class. /// Allocate the definition data for this class.
void allocateDefinitionData(); void allocateDefinitionData();
using redeclarable_base = Redeclarable<ObjCInterfaceDecl>; using redeclarable_base = Redeclarable<ObjCInterfaceDecl>;
ObjCInterfaceDecl *getNextRedeclarationImpl() override { ObjCInterfaceDecl *getNextRedeclarationImpl() override {
@ -1334,7 +1334,7 @@ public:
SourceRange getSourceRange() const override LLVM_READONLY { SourceRange getSourceRange() const override LLVM_READONLY {
if (isThisDeclarationADefinition()) if (isThisDeclarationADefinition())
return ObjCContainerDecl::getSourceRange(); return ObjCContainerDecl::getSourceRange();
return SourceRange(getAtStartLoc(), getLocation()); return SourceRange(getAtStartLoc(), getLocation());
} }
@ -1390,7 +1390,7 @@ public:
// FIXME: Should make sure no callers ever do this. // FIXME: Should make sure no callers ever do this.
if (!hasDefinition()) if (!hasDefinition())
return protocol_iterator(); return protocol_iterator();
if (data().ExternallyCompleted) if (data().ExternallyCompleted)
LoadExternalDefinition(); LoadExternalDefinition();
@ -1453,7 +1453,7 @@ public:
if (data().ExternallyCompleted) if (data().ExternallyCompleted)
LoadExternalDefinition(); LoadExternalDefinition();
return data().AllReferencedProtocols.empty() return data().AllReferencedProtocols.empty()
? protocol_begin() ? protocol_begin()
: data().AllReferencedProtocols.begin(); : data().AllReferencedProtocols.begin();
} }
@ -1462,11 +1462,11 @@ public:
// FIXME: Should make sure no callers ever do this. // FIXME: Should make sure no callers ever do this.
if (!hasDefinition()) if (!hasDefinition())
return all_protocol_iterator(); return all_protocol_iterator();
if (data().ExternallyCompleted) if (data().ExternallyCompleted)
LoadExternalDefinition(); LoadExternalDefinition();
return data().AllReferencedProtocols.empty() return data().AllReferencedProtocols.empty()
? protocol_end() ? protocol_end()
: data().AllReferencedProtocols.end(); : data().AllReferencedProtocols.end();
} }
@ -1476,17 +1476,17 @@ public:
ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); } ivar_range ivars() const { return ivar_range(ivar_begin(), ivar_end()); }
ivar_iterator ivar_begin() const { ivar_iterator ivar_begin() const {
if (const ObjCInterfaceDecl *Def = getDefinition()) if (const ObjCInterfaceDecl *Def = getDefinition())
return ivar_iterator(Def->decls_begin()); return ivar_iterator(Def->decls_begin());
// FIXME: Should make sure no callers ever do this. // FIXME: Should make sure no callers ever do this.
return ivar_iterator(); return ivar_iterator();
} }
ivar_iterator ivar_end() const { ivar_iterator ivar_end() const {
if (const ObjCInterfaceDecl *Def = getDefinition()) if (const ObjCInterfaceDecl *Def = getDefinition())
return ivar_iterator(Def->decls_end()); return ivar_iterator(Def->decls_end());
// FIXME: Should make sure no callers ever do this. // FIXME: Should make sure no callers ever do this.
return ivar_iterator(); return ivar_iterator();
@ -1546,10 +1546,10 @@ public:
/// Determine whether this particular declaration of this class is /// Determine whether this particular declaration of this class is
/// actually also a definition. /// actually also a definition.
bool isThisDeclarationADefinition() const { bool isThisDeclarationADefinition() const {
return getDefinition() == this; return getDefinition() == this;
} }
/// Determine whether this class has been defined. /// Determine whether this class has been defined.
bool hasDefinition() const { bool hasDefinition() const {
// If the name of this class is out-of-date, bring it up-to-date, which // If the name of this class is out-of-date, bring it up-to-date, which
@ -1561,16 +1561,16 @@ public:
return Data.getPointer(); return Data.getPointer();
} }
/// Retrieve the definition of this class, or NULL if this class /// Retrieve the definition of this class, or NULL if this class
/// has been forward-declared (with \@class) but not yet defined (with /// has been forward-declared (with \@class) but not yet defined (with
/// \@interface). /// \@interface).
ObjCInterfaceDecl *getDefinition() { ObjCInterfaceDecl *getDefinition() {
return hasDefinition()? Data.getPointer()->Definition : nullptr; return hasDefinition()? Data.getPointer()->Definition : nullptr;
} }
/// Retrieve the definition of this class, or NULL if this class /// Retrieve the definition of this class, or NULL if this class
/// has been forward-declared (with \@class) but not yet defined (with /// has been forward-declared (with \@class) but not yet defined (with
/// \@interface). /// \@interface).
const ObjCInterfaceDecl *getDefinition() const { const ObjCInterfaceDecl *getDefinition() const {
return hasDefinition()? Data.getPointer()->Definition : nullptr; return hasDefinition()? Data.getPointer()->Definition : nullptr;
@ -1579,7 +1579,7 @@ public:
/// Starts the definition of this Objective-C class, taking it from /// Starts the definition of this Objective-C class, taking it from
/// a forward declaration (\@class) to a definition (\@interface). /// a forward declaration (\@class) to a definition (\@interface).
void startDefinition(); void startDefinition();
/// Retrieve the superclass type. /// Retrieve the superclass type.
const ObjCObjectType *getSuperClassType() const { const ObjCObjectType *getSuperClassType() const {
if (TypeSourceInfo *TInfo = getSuperClassTInfo()) if (TypeSourceInfo *TInfo = getSuperClassTInfo())
@ -1593,7 +1593,7 @@ public:
// FIXME: Should make sure no callers ever do this. // FIXME: Should make sure no callers ever do this.
if (!hasDefinition()) if (!hasDefinition())
return nullptr; return nullptr;
if (data().ExternallyCompleted) if (data().ExternallyCompleted)
LoadExternalDefinition(); LoadExternalDefinition();
@ -1604,7 +1604,7 @@ public:
// does not include any type arguments that apply to the superclass. // does not include any type arguments that apply to the superclass.
ObjCInterfaceDecl *getSuperClass() const; ObjCInterfaceDecl *getSuperClass() const;
void setSuperClass(TypeSourceInfo *superClass) { void setSuperClass(TypeSourceInfo *superClass) {
data().SuperClassTInfo = superClass; data().SuperClassTInfo = superClass;
} }
@ -1618,7 +1618,7 @@ public:
ObjCCategoryDecl *Current = nullptr; ObjCCategoryDecl *Current = nullptr;
void findAcceptableCategory(); void findAcceptableCategory();
public: public:
using value_type = ObjCCategoryDecl *; using value_type = ObjCCategoryDecl *;
using reference = value_type; using reference = value_type;
@ -1659,7 +1659,7 @@ private:
/// ///
/// Used in the \c visible_categories_iterator. /// Used in the \c visible_categories_iterator.
static bool isVisibleCategory(ObjCCategoryDecl *Cat); static bool isVisibleCategory(ObjCCategoryDecl *Cat);
public: public:
/// Iterator that walks over the list of categories and extensions /// Iterator that walks over the list of categories and extensions
/// that are visible, i.e., not hidden in a non-imported submodule. /// that are visible, i.e., not hidden in a non-imported submodule.
@ -1765,7 +1765,7 @@ private:
/// ///
/// Used in the \c known_extensions_iterator. /// Used in the \c known_extensions_iterator.
static bool isKnownExtension(ObjCCategoryDecl *Cat); static bool isKnownExtension(ObjCCategoryDecl *Cat);
public: public:
friend class ASTDeclReader; friend class ASTDeclReader;
friend class ASTDeclWriter; friend class ASTDeclWriter;
@ -1787,7 +1787,7 @@ public:
known_extensions_iterator known_extensions_begin() const { known_extensions_iterator known_extensions_begin() const {
return known_extensions_iterator(getCategoryListRaw()); return known_extensions_iterator(getCategoryListRaw());
} }
/// Retrieve an iterator to the end of the known-extensions list. /// Retrieve an iterator to the end of the known-extensions list.
known_extensions_iterator known_extensions_end() const { known_extensions_iterator known_extensions_end() const {
return known_extensions_iterator(); return known_extensions_iterator();
@ -1804,7 +1804,7 @@ public:
// FIXME: Should make sure no callers ever do this. // FIXME: Should make sure no callers ever do this.
if (!hasDefinition()) if (!hasDefinition())
return nullptr; return nullptr;
if (data().ExternallyCompleted) if (data().ExternallyCompleted)
LoadExternalDefinition(); LoadExternalDefinition();
@ -1831,7 +1831,7 @@ public:
while (I != nullptr) { while (I != nullptr) {
if (declaresSameEntity(this, I)) if (declaresSameEntity(this, I))
return true; return true;
I = I->getSuperClass(); I = I->getSuperClass();
} }
return false; return false;
@ -1841,7 +1841,7 @@ public:
/// to be incompatible with __weak references. Returns true if it is. /// to be incompatible with __weak references. Returns true if it is.
bool isArcWeakrefUnavailable() const; bool isArcWeakrefUnavailable() const;
/// isObjCRequiresPropertyDefs - Checks that a class or one of its super /// isObjCRequiresPropertyDefs - Checks that a class or one of its super
/// classes must not be auto-synthesized. Returns class decl. if it must not /// classes must not be auto-synthesized. Returns class decl. if it must not
/// be; 0, otherwise. /// be; 0, otherwise.
const ObjCInterfaceDecl *isObjCRequiresPropertyDefs() const; const ObjCInterfaceDecl *isObjCRequiresPropertyDefs() const;
@ -1854,7 +1854,7 @@ public:
} }
ObjCProtocolDecl *lookupNestedProtocol(IdentifierInfo *Name); ObjCProtocolDecl *lookupNestedProtocol(IdentifierInfo *Name);
// Lookup a method. First, we search locally. If a method isn't // Lookup a method. First, we search locally. If a method isn't
// found, we search referenced protocols and class categories. // found, we search referenced protocols and class categories.
ObjCMethodDecl *lookupMethod(Selector Sel, bool isInstance, ObjCMethodDecl *lookupMethod(Selector Sel, bool isInstance,
@ -1893,14 +1893,14 @@ public:
true /* followsSuper */, true /* followsSuper */,
Cat); Cat);
} }
SourceLocation getEndOfDefinitionLoc() const { SourceLocation getEndOfDefinitionLoc() const {
if (!hasDefinition()) if (!hasDefinition())
return getLocation(); return getLocation();
return data().EndLoc; return data().EndLoc;
} }
void setEndOfDefinitionLoc(SourceLocation LE) { data().EndLoc = LE; } void setEndOfDefinitionLoc(SourceLocation LE) { data().EndLoc = LE; }
/// Retrieve the starting location of the superclass. /// Retrieve the starting location of the superclass.
@ -1909,7 +1909,7 @@ public:
/// isImplicitInterfaceDecl - check that this is an implicitly declared /// isImplicitInterfaceDecl - check that this is an implicitly declared
/// ObjCInterfaceDecl node. This is for legacy objective-c \@implementation /// ObjCInterfaceDecl node. This is for legacy objective-c \@implementation
/// declaration without an \@interface declaration. /// declaration without an \@interface declaration.
bool isImplicitInterfaceDecl() const { bool isImplicitInterfaceDecl() const {
return hasDefinition() ? data().Definition->isImplicit() : isImplicit(); return hasDefinition() ? data().Definition->isImplicit() : isImplicit();
} }
@ -1987,7 +1987,7 @@ public:
bool synthesized=false); bool synthesized=false);
static ObjCIvarDecl *CreateDeserialized(ASTContext &C, unsigned ID); static ObjCIvarDecl *CreateDeserialized(ASTContext &C, unsigned ID);
/// Return the class interface that this ivar is logically contained /// Return the class interface that this ivar is logically contained
/// in; this is either the interface where the ivar was declared, or the /// in; this is either the interface where the ivar was declared, or the
/// interface the ivar is conceptually a part of in the case of synthesized /// interface the ivar is conceptually a part of in the case of synthesized
@ -2045,7 +2045,7 @@ public:
QualType T, Expr *BW); QualType T, Expr *BW);
static ObjCAtDefsFieldDecl *CreateDeserialized(ASTContext &C, unsigned ID); static ObjCAtDefsFieldDecl *CreateDeserialized(ASTContext &C, unsigned ID);
// Implement isa/cast/dyncast/etc. // Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classof(const Decl *D) { return classofKind(D->getKind()); }
static bool classofKind(Kind K) { return K == ObjCAtDefsField; } static bool classofKind(Kind K) { return K == ObjCAtDefsField; }
@ -2087,7 +2087,7 @@ class ObjCProtocolDecl : public ObjCContainerDecl,
ObjCProtocolDecl *Definition; ObjCProtocolDecl *Definition;
/// Referenced protocols /// Referenced protocols
ObjCProtocolList ReferencedProtocols; ObjCProtocolList ReferencedProtocols;
}; };
/// Contains a pointer to the data associated with this class, /// Contains a pointer to the data associated with this class,
@ -2107,7 +2107,7 @@ class ObjCProtocolDecl : public ObjCContainerDecl,
assert(Data.getPointer() && "Objective-C protocol has no definition!"); assert(Data.getPointer() && "Objective-C protocol has no definition!");
return *Data.getPointer(); return *Data.getPointer();
} }
void allocateDefinitionData(); void allocateDefinitionData();
using redeclarable_base = Redeclarable<ObjCProtocolDecl>; using redeclarable_base = Redeclarable<ObjCProtocolDecl>;
@ -2152,15 +2152,15 @@ public:
protocol_iterator protocol_begin() const { protocol_iterator protocol_begin() const {
if (!hasDefinition()) if (!hasDefinition())
return protocol_iterator(); return protocol_iterator();
return data().ReferencedProtocols.begin(); return data().ReferencedProtocols.begin();
} }
protocol_iterator protocol_end() const { protocol_iterator protocol_end() const {
if (!hasDefinition()) if (!hasDefinition())
return protocol_iterator(); return protocol_iterator();
return data().ReferencedProtocols.end(); return data().ReferencedProtocols.end();
} }
using protocol_loc_iterator = ObjCProtocolList::loc_iterator; using protocol_loc_iterator = ObjCProtocolList::loc_iterator;
@ -2173,22 +2173,22 @@ public:
protocol_loc_iterator protocol_loc_begin() const { protocol_loc_iterator protocol_loc_begin() const {
if (!hasDefinition()) if (!hasDefinition())
return protocol_loc_iterator(); return protocol_loc_iterator();
return data().ReferencedProtocols.loc_begin(); return data().ReferencedProtocols.loc_begin();
} }
protocol_loc_iterator protocol_loc_end() const { protocol_loc_iterator protocol_loc_end() const {
if (!hasDefinition()) if (!hasDefinition())
return protocol_loc_iterator(); return protocol_loc_iterator();
return data().ReferencedProtocols.loc_end(); return data().ReferencedProtocols.loc_end();
} }
unsigned protocol_size() const { unsigned protocol_size() const {
if (!hasDefinition()) if (!hasDefinition())
return 0; return 0;
return data().ReferencedProtocols.size(); return data().ReferencedProtocols.size();
} }
/// setProtocolList - Set the list of protocols that this interface /// setProtocolList - Set the list of protocols that this interface
@ -2235,12 +2235,12 @@ public:
return hasDefinition()? Data.getPointer()->Definition : nullptr; return hasDefinition()? Data.getPointer()->Definition : nullptr;
} }
/// Determine whether this particular declaration is also the /// Determine whether this particular declaration is also the
/// definition. /// definition.
bool isThisDeclarationADefinition() const { bool isThisDeclarationADefinition() const {
return getDefinition() == this; return getDefinition() == this;
} }
/// Starts the definition of this Objective-C protocol. /// Starts the definition of this Objective-C protocol.
void startDefinition(); void startDefinition();
@ -2251,10 +2251,10 @@ public:
SourceRange getSourceRange() const override LLVM_READONLY { SourceRange getSourceRange() const override LLVM_READONLY {
if (isThisDeclarationADefinition()) if (isThisDeclarationADefinition())
return ObjCContainerDecl::getSourceRange(); return ObjCContainerDecl::getSourceRange();
return SourceRange(getAtStartLoc(), getLocation()); return SourceRange(getAtStartLoc(), getLocation());
} }
using redecl_range = redeclarable_base::redecl_range; using redecl_range = redeclarable_base::redecl_range;
using redecl_iterator = redeclarable_base::redecl_iterator; using redecl_iterator = redeclarable_base::redecl_iterator;
@ -2316,7 +2316,7 @@ class ObjCCategoryDecl : public ObjCContainerDecl {
/// class extension may have private ivars. /// class extension may have private ivars.
SourceLocation IvarLBraceLoc; SourceLocation IvarLBraceLoc;
SourceLocation IvarRBraceLoc; SourceLocation IvarRBraceLoc;
ObjCCategoryDecl(DeclContext *DC, SourceLocation AtLoc, ObjCCategoryDecl(DeclContext *DC, SourceLocation AtLoc,
SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc, SourceLocation ClassNameLoc, SourceLocation CategoryNameLoc,
IdentifierInfo *Id, ObjCInterfaceDecl *IDecl, IdentifierInfo *Id, ObjCInterfaceDecl *IDecl,
@ -2431,7 +2431,7 @@ public:
SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; } SourceLocation getCategoryNameLoc() const { return CategoryNameLoc; }
void setCategoryNameLoc(SourceLocation Loc) { CategoryNameLoc = Loc; } void setCategoryNameLoc(SourceLocation Loc) { CategoryNameLoc = Loc; }
void setIvarLBraceLoc(SourceLocation Loc) { IvarLBraceLoc = Loc; } void setIvarLBraceLoc(SourceLocation Loc) { IvarLBraceLoc = Loc; }
SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; } SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; } void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
@ -2576,7 +2576,7 @@ class ObjCImplementationDecl : public ObjCImplDecl {
/// \@implementation may have private ivars. /// \@implementation may have private ivars.
SourceLocation IvarLBraceLoc; SourceLocation IvarLBraceLoc;
SourceLocation IvarRBraceLoc; SourceLocation IvarRBraceLoc;
/// Support for ivar initialization. /// Support for ivar initialization.
/// The arguments used to initialize the ivars /// The arguments used to initialize the ivars
LazyCXXCtorInitializersPtr IvarInitializers; LazyCXXCtorInitializersPtr IvarInitializers;
@ -2594,7 +2594,7 @@ class ObjCImplementationDecl : public ObjCImplDecl {
ObjCInterfaceDecl *superDecl, ObjCInterfaceDecl *superDecl,
SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation nameLoc, SourceLocation atStartLoc,
SourceLocation superLoc = SourceLocation(), SourceLocation superLoc = SourceLocation(),
SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarLBraceLoc=SourceLocation(),
SourceLocation IvarRBraceLoc=SourceLocation()) SourceLocation IvarRBraceLoc=SourceLocation())
: ObjCImplDecl(ObjCImplementation, DC, classInterface, : ObjCImplDecl(ObjCImplementation, DC, classInterface,
classInterface ? classInterface->getIdentifier() classInterface ? classInterface->getIdentifier()
@ -2616,7 +2616,7 @@ public:
SourceLocation nameLoc, SourceLocation nameLoc,
SourceLocation atStartLoc, SourceLocation atStartLoc,
SourceLocation superLoc = SourceLocation(), SourceLocation superLoc = SourceLocation(),
SourceLocation IvarLBraceLoc=SourceLocation(), SourceLocation IvarLBraceLoc=SourceLocation(),
SourceLocation IvarRBraceLoc=SourceLocation()); SourceLocation IvarRBraceLoc=SourceLocation());
static ObjCImplementationDecl *CreateDeserialized(ASTContext &C, unsigned ID); static ObjCImplementationDecl *CreateDeserialized(ASTContext &C, unsigned ID);
@ -2700,7 +2700,7 @@ public:
std::string getNameAsString() const { std::string getNameAsString() const {
return getName(); return getName();
} }
/// Produce a name to be used for class's metadata. It comes either via /// Produce a name to be used for class's metadata. It comes either via
/// class's objc_runtime_name attribute or class name. /// class's objc_runtime_name attribute or class name.
StringRef getObjCRuntimeNameAsString() const; StringRef getObjCRuntimeNameAsString() const;
@ -2715,7 +2715,7 @@ public:
SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; } SourceLocation getIvarLBraceLoc() const { return IvarLBraceLoc; }
void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; } void setIvarRBraceLoc(SourceLocation Loc) { IvarRBraceLoc = Loc; }
SourceLocation getIvarRBraceLoc() const { return IvarRBraceLoc; } SourceLocation getIvarRBraceLoc() const { return IvarRBraceLoc; }
using ivar_iterator = specific_decl_iterator<ObjCIvarDecl>; using ivar_iterator = specific_decl_iterator<ObjCIvarDecl>;
using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>; using ivar_range = llvm::iterator_range<specific_decl_iterator<ObjCIvarDecl>>;
@ -2760,9 +2760,9 @@ public:
SourceLocation L, IdentifierInfo *Id, SourceLocation L, IdentifierInfo *Id,
ObjCInterfaceDecl* aliasedClass); ObjCInterfaceDecl* aliasedClass);
static ObjCCompatibleAliasDecl *CreateDeserialized(ASTContext &C, static ObjCCompatibleAliasDecl *CreateDeserialized(ASTContext &C,
unsigned ID); unsigned ID);
const ObjCInterfaceDecl *getClassInterface() const { return AliasedClass; } const ObjCInterfaceDecl *getClassInterface() const { return AliasedClass; }
ObjCInterfaceDecl *getClassInterface() { return AliasedClass; } ObjCInterfaceDecl *getClassInterface() { return AliasedClass; }
void setClassInterface(ObjCInterfaceDecl *D) { AliasedClass = D; } void setClassInterface(ObjCInterfaceDecl *D) { AliasedClass = D; }

View File

@ -734,8 +734,8 @@ public:
}; };
/// Declaration of a redeclarable template. /// Declaration of a redeclarable template.
class RedeclarableTemplateDecl : public TemplateDecl, class RedeclarableTemplateDecl : public TemplateDecl,
public Redeclarable<RedeclarableTemplateDecl> public Redeclarable<RedeclarableTemplateDecl>
{ {
using redeclarable_base = Redeclarable<RedeclarableTemplateDecl>; using redeclarable_base = Redeclarable<RedeclarableTemplateDecl>;
@ -823,7 +823,7 @@ protected:
/// Pointer to the common data shared by all declarations of this /// Pointer to the common data shared by all declarations of this
/// template. /// template.
mutable CommonBase *Common = nullptr; mutable CommonBase *Common = nullptr;
/// Retrieves the "common" pointer shared by all (re-)declarations of /// Retrieves the "common" pointer shared by all (re-)declarations of
/// the same template. Calling this routine may implicitly allocate memory /// the same template. Calling this routine may implicitly allocate memory
/// for the common pointer. /// for the common pointer.
@ -888,10 +888,10 @@ public:
} }
/// Retrieve the member template from which this template was /// Retrieve the member template from which this template was
/// instantiated, or nullptr if this template was not instantiated from a /// instantiated, or nullptr if this template was not instantiated from a
/// member template. /// member template.
/// ///
/// A template is instantiated from a member template when the member /// A template is instantiated from a member template when the member
/// template itself is part of a class template (or member thereof). For /// template itself is part of a class template (or member thereof). For
/// example, given /// example, given
/// ///
@ -1178,7 +1178,7 @@ public:
unsigned D, unsigned P, unsigned D, unsigned P,
IdentifierInfo *Id, bool Typename, IdentifierInfo *Id, bool Typename,
bool ParameterPack); bool ParameterPack);
static TemplateTypeParmDecl *CreateDeserialized(const ASTContext &C, static TemplateTypeParmDecl *CreateDeserialized(const ASTContext &C,
unsigned ID); unsigned ID);
/// Whether this template type parameter was declared with /// Whether this template type parameter was declared with
@ -1312,12 +1312,12 @@ public:
QualType T, TypeSourceInfo *TInfo, ArrayRef<QualType> ExpandedTypes, QualType T, TypeSourceInfo *TInfo, ArrayRef<QualType> ExpandedTypes,
ArrayRef<TypeSourceInfo *> ExpandedTInfos); ArrayRef<TypeSourceInfo *> ExpandedTInfos);
static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C, static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C,
unsigned ID); unsigned ID);
static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C, static NonTypeTemplateParmDecl *CreateDeserialized(ASTContext &C,
unsigned ID, unsigned ID,
unsigned NumExpandedTypes); unsigned NumExpandedTypes);
using TemplateParmPosition::getDepth; using TemplateParmPosition::getDepth;
using TemplateParmPosition::setDepth; using TemplateParmPosition::setDepth;
using TemplateParmPosition::getPosition; using TemplateParmPosition::getPosition;
@ -1495,7 +1495,7 @@ public:
static TemplateTemplateParmDecl *CreateDeserialized(ASTContext &C, static TemplateTemplateParmDecl *CreateDeserialized(ASTContext &C,
unsigned ID, unsigned ID,
unsigned NumExpansions); unsigned NumExpansions);
using TemplateParmPosition::getDepth; using TemplateParmPosition::getDepth;
using TemplateParmPosition::setDepth; using TemplateParmPosition::setDepth;
using TemplateParmPosition::getPosition; using TemplateParmPosition::getPosition;
@ -2442,7 +2442,7 @@ public:
static ClassScopeFunctionSpecializationDecl * static ClassScopeFunctionSpecializationDecl *
CreateDeserialized(ASTContext &Context, unsigned ID); CreateDeserialized(ASTContext &Context, unsigned ID);
// Implement isa/cast/dyncast/etc. // Implement isa/cast/dyncast/etc.
static bool classof(const Decl *D) { return classofKind(D->getKind()); } static bool classof(const Decl *D) { return classofKind(D->getKind()); }

View File

@ -211,14 +211,14 @@ public:
/// getNameKind - Determine what kind of name this is. /// getNameKind - Determine what kind of name this is.
NameKind getNameKind() const; NameKind getNameKind() const;
/// Determines whether the name itself is dependent, e.g., because it /// Determines whether the name itself is dependent, e.g., because it
/// involves a C++ type that is itself dependent. /// involves a C++ type that is itself dependent.
/// ///
/// Note that this does not capture all of the notions of "dependent name", /// Note that this does not capture all of the notions of "dependent name",
/// because an identifier can be a dependent name if it is used as the /// because an identifier can be a dependent name if it is used as the
/// callee in a call expression with dependent arguments. /// callee in a call expression with dependent arguments.
bool isDependentName() const; bool isDependentName() const;
/// getNameAsString - Retrieve the human-readable string for this name. /// getNameAsString - Retrieve the human-readable string for this name.
std::string getAsString() const; std::string getAsString() const;
@ -543,7 +543,7 @@ public:
/// Determine whether this name involves a template parameter. /// Determine whether this name involves a template parameter.
bool isInstantiationDependent() const; bool isInstantiationDependent() const;
/// Determine whether this name contains an unexpanded /// Determine whether this name contains an unexpanded
/// parameter pack. /// parameter pack.
bool containsUnexpandedParameterPack() const; bool containsUnexpandedParameterPack() const;

View File

@ -101,9 +101,9 @@ private:
friend class DependentStoredDeclsMap; friend class DependentStoredDeclsMap;
DependentDiagnostic(const PartialDiagnostic &PDiag, DependentDiagnostic(const PartialDiagnostic &PDiag,
PartialDiagnostic::Storage *Storage) PartialDiagnostic::Storage *Storage)
: Diag(PDiag, Storage) {} : Diag(PDiag, Storage) {}
static DependentDiagnostic *Create(ASTContext &Context, static DependentDiagnostic *Create(ASTContext &Context,
DeclContext *Parent, DeclContext *Parent,
const PartialDiagnostic &PDiag); const PartialDiagnostic &PDiag);

View File

@ -21,9 +21,9 @@
#include "clang/AST/StmtVisitor.h" #include "clang/AST/StmtVisitor.h"
namespace clang { namespace clang {
class ASTContext; class ASTContext;
/// Given a potentially-evaluated expression, this visitor visits all /// Given a potentially-evaluated expression, this visitor visits all
/// of its potentially-evaluated subexpressions, recursively. /// of its potentially-evaluated subexpressions, recursively.
template<template <typename> class Ptr, typename ImplClass> template<template <typename> class Ptr, typename ImplClass>

View File

@ -884,7 +884,7 @@ public:
: Expr(OpaqueValueExprClass, T, VK, OK, : Expr(OpaqueValueExprClass, T, VK, OK,
T->isDependentType() || T->isDependentType() ||
(SourceExpr && SourceExpr->isTypeDependent()), (SourceExpr && SourceExpr->isTypeDependent()),
T->isDependentType() || T->isDependentType() ||
(SourceExpr && SourceExpr->isValueDependent()), (SourceExpr && SourceExpr->isValueDependent()),
T->isInstantiationDependentType() || T->isInstantiationDependentType() ||
(SourceExpr && SourceExpr->isInstantiationDependent()), (SourceExpr && SourceExpr->isInstantiationDependent()),
@ -5341,7 +5341,7 @@ public:
SourceLocation getLocStart() const LLVM_READONLY { return SourceLocation(); } SourceLocation getLocStart() const LLVM_READONLY { return SourceLocation(); }
SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); } SourceLocation getLocEnd() const LLVM_READONLY { return SourceLocation(); }
static bool classof(const Stmt *T) { static bool classof(const Stmt *T) {
return T->getStmtClass() == TypoExprClass; return T->getStmtClass() == TypoExprClass;
} }

View File

@ -721,7 +721,7 @@ public:
} }
}; };
/// A member reference to an MSPropertyDecl. /// A member reference to an MSPropertyDecl.
/// ///
/// This expression always has pseudo-object type, and therefore it is /// This expression always has pseudo-object type, and therefore it is
/// typically not encountered in a fully-typechecked expression except /// typically not encountered in a fully-typechecked expression except
@ -1591,7 +1591,7 @@ class LambdaExpr final : public Expr,
/// The number of captures. /// The number of captures.
unsigned NumCaptures : 16; unsigned NumCaptures : 16;
/// The default capture kind, which is a value of type /// The default capture kind, which is a value of type
/// LambdaCaptureDefault. /// LambdaCaptureDefault.
unsigned CaptureDefault : 2; unsigned CaptureDefault : 2;
@ -1602,10 +1602,10 @@ class LambdaExpr final : public Expr,
/// Whether this lambda had the result type explicitly specified. /// Whether this lambda had the result type explicitly specified.
unsigned ExplicitResultType : 1; unsigned ExplicitResultType : 1;
/// The location of the closing brace ('}') that completes /// The location of the closing brace ('}') that completes
/// the lambda. /// the lambda.
/// ///
/// The location of the brace is also available by looking up the /// The location of the brace is also available by looking up the
/// function call operator in the lambda class. However, it is /// function call operator in the lambda class. However, it is
/// stored here to improve the performance of getSourceRange(), and /// stored here to improve the performance of getSourceRange(), and
@ -1673,7 +1673,7 @@ public:
/// Retrieve this lambda's captures. /// Retrieve this lambda's captures.
capture_range captures() const; capture_range captures() const;
/// Retrieve an iterator pointing to the first lambda capture. /// Retrieve an iterator pointing to the first lambda capture.
capture_iterator capture_begin() const; capture_iterator capture_begin() const;
@ -1686,7 +1686,7 @@ public:
/// Retrieve this lambda's explicit captures. /// Retrieve this lambda's explicit captures.
capture_range explicit_captures() const; capture_range explicit_captures() const;
/// Retrieve an iterator pointing to the first explicit /// Retrieve an iterator pointing to the first explicit
/// lambda capture. /// lambda capture.
capture_iterator explicit_capture_begin() const; capture_iterator explicit_capture_begin() const;
@ -1754,18 +1754,18 @@ public:
SourceRange getIntroducerRange() const { return IntroducerRange; } SourceRange getIntroducerRange() const { return IntroducerRange; }
/// Retrieve the class that corresponds to the lambda. /// Retrieve the class that corresponds to the lambda.
/// ///
/// This is the "closure type" (C++1y [expr.prim.lambda]), and stores the /// This is the "closure type" (C++1y [expr.prim.lambda]), and stores the
/// captures in its fields and provides the various operations permitted /// captures in its fields and provides the various operations permitted
/// on a lambda (copying, calling). /// on a lambda (copying, calling).
CXXRecordDecl *getLambdaClass() const; CXXRecordDecl *getLambdaClass() const;
/// Retrieve the function call operator associated with this /// Retrieve the function call operator associated with this
/// lambda expression. /// lambda expression.
CXXMethodDecl *getCallOperator() const; CXXMethodDecl *getCallOperator() const;
/// If this is a generic lambda expression, retrieve the template /// If this is a generic lambda expression, retrieve the template
/// parameter list associated with it, or else return null. /// parameter list associated with it, or else return null.
TemplateParameterList *getTemplateParameterList() const; TemplateParameterList *getTemplateParameterList() const;
/// Whether this is a generic lambda. /// Whether this is a generic lambda.
@ -1784,7 +1784,7 @@ public:
/// Whether this lambda had its result type explicitly specified. /// Whether this lambda had its result type explicitly specified.
bool hasExplicitResultType() const { return ExplicitResultType; } bool hasExplicitResultType() const { return ExplicitResultType; }
static bool classof(const Stmt *T) { static bool classof(const Stmt *T) {
return T->getStmtClass() == LambdaExprClass; return T->getStmtClass() == LambdaExprClass;
} }
@ -2129,7 +2129,7 @@ public:
Expr *getArgument() { return cast<Expr>(Argument); } Expr *getArgument() { return cast<Expr>(Argument); }
const Expr *getArgument() const { return cast<Expr>(Argument); } const Expr *getArgument() const { return cast<Expr>(Argument); }
/// Retrieve the type being destroyed. /// Retrieve the type being destroyed.
/// ///
/// If the type being destroyed is a dependent type which may or may not /// If the type being destroyed is a dependent type which may or may not
/// be a pointer, return an invalid type. /// be a pointer, return an invalid type.
@ -2345,13 +2345,13 @@ class TypeTraitExpr final
private llvm::TrailingObjects<TypeTraitExpr, TypeSourceInfo *> { private llvm::TrailingObjects<TypeTraitExpr, TypeSourceInfo *> {
/// The location of the type trait keyword. /// The location of the type trait keyword.
SourceLocation Loc; SourceLocation Loc;
/// The location of the closing parenthesis. /// The location of the closing parenthesis.
SourceLocation RParenLoc; SourceLocation RParenLoc;
// Note: The TypeSourceInfos for the arguments are allocated after the // Note: The TypeSourceInfos for the arguments are allocated after the
// TypeTraitExpr. // TypeTraitExpr.
TypeTraitExpr(QualType T, SourceLocation Loc, TypeTrait Kind, TypeTraitExpr(QualType T, SourceLocation Loc, TypeTrait Kind,
ArrayRef<TypeSourceInfo *> Args, ArrayRef<TypeSourceInfo *> Args,
SourceLocation RParenLoc, SourceLocation RParenLoc,
@ -2377,26 +2377,26 @@ public:
static TypeTraitExpr *CreateDeserialized(const ASTContext &C, static TypeTraitExpr *CreateDeserialized(const ASTContext &C,
unsigned NumArgs); unsigned NumArgs);
/// Determine which type trait this expression uses. /// Determine which type trait this expression uses.
TypeTrait getTrait() const { TypeTrait getTrait() const {
return static_cast<TypeTrait>(TypeTraitExprBits.Kind); return static_cast<TypeTrait>(TypeTraitExprBits.Kind);
} }
bool getValue() const { bool getValue() const {
assert(!isValueDependent()); assert(!isValueDependent());
return TypeTraitExprBits.Value; return TypeTraitExprBits.Value;
} }
/// Determine the number of arguments to this type trait. /// Determine the number of arguments to this type trait.
unsigned getNumArgs() const { return TypeTraitExprBits.NumArgs; } unsigned getNumArgs() const { return TypeTraitExprBits.NumArgs; }
/// Retrieve the Ith argument. /// Retrieve the Ith argument.
TypeSourceInfo *getArg(unsigned I) const { TypeSourceInfo *getArg(unsigned I) const {
assert(I < getNumArgs() && "Argument out-of-range"); assert(I < getNumArgs() && "Argument out-of-range");
return getArgs()[I]; return getArgs()[I];
} }
/// Retrieve the argument types. /// Retrieve the argument types.
ArrayRef<TypeSourceInfo *> getArgs() const { ArrayRef<TypeSourceInfo *> getArgs() const {
return llvm::makeArrayRef(getTrailingObjects<TypeSourceInfo *>(), return llvm::makeArrayRef(getTrailingObjects<TypeSourceInfo *>(),
@ -2409,7 +2409,7 @@ public:
static bool classof(const Stmt *T) { static bool classof(const Stmt *T) {
return T->getStmtClass() == TypeTraitExprClass; return T->getStmtClass() == TypeTraitExprClass;
} }
// Iterators // Iterators
child_range children() { child_range children() {
return child_range(child_iterator(), child_iterator()); return child_range(child_iterator(), child_iterator());

View File

@ -90,16 +90,16 @@ public:
Value(val), Loc(l) {} Value(val), Loc(l) {}
explicit ObjCBoolLiteralExpr(EmptyShell Empty) explicit ObjCBoolLiteralExpr(EmptyShell Empty)
: Expr(ObjCBoolLiteralExprClass, Empty) {} : Expr(ObjCBoolLiteralExprClass, Empty) {}
bool getValue() const { return Value; } bool getValue() const { return Value; }
void setValue(bool V) { Value = V; } void setValue(bool V) { Value = V; }
SourceLocation getLocStart() const LLVM_READONLY { return Loc; } SourceLocation getLocStart() const LLVM_READONLY { return Loc; }
SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
SourceLocation getLocation() const { return Loc; } SourceLocation getLocation() const { return Loc; }
void setLocation(SourceLocation L) { Loc = L; } void setLocation(SourceLocation L) { Loc = L; }
// Iterators // Iterators
child_range children() { child_range children() {
return child_range(child_iterator(), child_iterator()); return child_range(child_iterator(), child_iterator());
@ -124,30 +124,30 @@ public:
ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *method, ObjCBoxedExpr(Expr *E, QualType T, ObjCMethodDecl *method,
SourceRange R) SourceRange R)
: Expr(ObjCBoxedExprClass, T, VK_RValue, OK_Ordinary, : Expr(ObjCBoxedExprClass, T, VK_RValue, OK_Ordinary,
E->isTypeDependent(), E->isValueDependent(), E->isTypeDependent(), E->isValueDependent(),
E->isInstantiationDependent(), E->isInstantiationDependent(),
E->containsUnexpandedParameterPack()), E->containsUnexpandedParameterPack()),
SubExpr(E), BoxingMethod(method), Range(R) {} SubExpr(E), BoxingMethod(method), Range(R) {}
explicit ObjCBoxedExpr(EmptyShell Empty) explicit ObjCBoxedExpr(EmptyShell Empty)
: Expr(ObjCBoxedExprClass, Empty) {} : Expr(ObjCBoxedExprClass, Empty) {}
Expr *getSubExpr() { return cast<Expr>(SubExpr); } Expr *getSubExpr() { return cast<Expr>(SubExpr); }
const Expr *getSubExpr() const { return cast<Expr>(SubExpr); } const Expr *getSubExpr() const { return cast<Expr>(SubExpr); }
ObjCMethodDecl *getBoxingMethod() const { ObjCMethodDecl *getBoxingMethod() const {
return BoxingMethod; return BoxingMethod;
} }
SourceLocation getAtLoc() const { return Range.getBegin(); } SourceLocation getAtLoc() const { return Range.getBegin(); }
SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); } SourceLocation getLocStart() const LLVM_READONLY { return Range.getBegin(); }
SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); } SourceLocation getLocEnd() const LLVM_READONLY { return Range.getEnd(); }
SourceRange getSourceRange() const LLVM_READONLY { SourceRange getSourceRange() const LLVM_READONLY {
return Range; return Range;
} }
// Iterators // Iterators
child_range children() { return child_range(&SubExpr, &SubExpr+1); } child_range children() { return child_range(&SubExpr, &SubExpr+1); }
@ -208,7 +208,7 @@ public:
/// getNumElements - Return number of elements of objective-c array literal. /// getNumElements - Return number of elements of objective-c array literal.
unsigned getNumElements() const { return NumElements; } unsigned getNumElements() const { return NumElements; }
/// getElement - Return the Element at the specified index. /// getElement - Return the Element at the specified index.
Expr *getElement(unsigned Index) { Expr *getElement(unsigned Index) {
assert((Index < NumElements) && "Arg access out of range!"); assert((Index < NumElements) && "Arg access out of range!");
@ -218,11 +218,11 @@ public:
assert((Index < NumElements) && "Arg access out of range!"); assert((Index < NumElements) && "Arg access out of range!");
return getElements()[Index]; return getElements()[Index];
} }
ObjCMethodDecl *getArrayWithObjectsMethod() const { ObjCMethodDecl *getArrayWithObjectsMethod() const {
return ArrayWithObjectsMethod; return ArrayWithObjectsMethod;
} }
// Iterators // Iterators
child_range children() { child_range children() {
return child_range(reinterpret_cast<Stmt **>(getElements()), return child_range(reinterpret_cast<Stmt **>(getElements()),
@ -239,13 +239,13 @@ public:
struct ObjCDictionaryElement { struct ObjCDictionaryElement {
/// The key for the dictionary element. /// The key for the dictionary element.
Expr *Key; Expr *Key;
/// The value of the dictionary element. /// The value of the dictionary element.
Expr *Value; Expr *Value;
/// The location of the ellipsis, if this is a pack expansion. /// The location of the ellipsis, if this is a pack expansion.
SourceLocation EllipsisLoc; SourceLocation EllipsisLoc;
/// The number of elements this pack expansion will expand to, if /// The number of elements this pack expansion will expand to, if
/// this is a pack expansion and is known. /// this is a pack expansion and is known.
Optional<unsigned> NumExpansions; Optional<unsigned> NumExpansions;
@ -308,7 +308,7 @@ class ObjCDictionaryLiteral final
using KeyValuePair = ObjCDictionaryLiteral_KeyValuePair; using KeyValuePair = ObjCDictionaryLiteral_KeyValuePair;
using ExpansionData = ObjCDictionaryLiteral_ExpansionData; using ExpansionData = ObjCDictionaryLiteral_ExpansionData;
ObjCDictionaryLiteral(ArrayRef<ObjCDictionaryElement> VK, ObjCDictionaryLiteral(ArrayRef<ObjCDictionaryElement> VK,
bool HasPackExpansions, bool HasPackExpansions,
QualType T, ObjCMethodDecl *method, QualType T, ObjCMethodDecl *method,
SourceRange SR); SourceRange SR);
@ -328,16 +328,16 @@ public:
friend TrailingObjects; friend TrailingObjects;
static ObjCDictionaryLiteral *Create(const ASTContext &C, static ObjCDictionaryLiteral *Create(const ASTContext &C,
ArrayRef<ObjCDictionaryElement> VK, ArrayRef<ObjCDictionaryElement> VK,
bool HasPackExpansions, bool HasPackExpansions,
QualType T, ObjCMethodDecl *method, QualType T, ObjCMethodDecl *method,
SourceRange SR); SourceRange SR);
static ObjCDictionaryLiteral *CreateEmpty(const ASTContext &C, static ObjCDictionaryLiteral *CreateEmpty(const ASTContext &C,
unsigned NumElements, unsigned NumElements,
bool HasPackExpansions); bool HasPackExpansions);
/// getNumElements - Return number of elements of objective-c dictionary /// getNumElements - Return number of elements of objective-c dictionary
/// literal. /// literal.
unsigned getNumElements() const { return NumElements; } unsigned getNumElements() const { return NumElements; }
@ -354,7 +354,7 @@ public:
} }
return Result; return Result;
} }
ObjCMethodDecl *getDictWithObjectsMethod() const { ObjCMethodDecl *getDictWithObjectsMethod() const {
return DictWithObjectsMethod; return DictWithObjectsMethod;
} }
@ -394,7 +394,7 @@ public:
EncodedType->getType()->isDependentType(), EncodedType->getType()->isDependentType(),
EncodedType->getType()->isDependentType(), EncodedType->getType()->isDependentType(),
EncodedType->getType()->isInstantiationDependentType(), EncodedType->getType()->isInstantiationDependentType(),
EncodedType->getType()->containsUnexpandedParameterPack()), EncodedType->getType()->containsUnexpandedParameterPack()),
EncodedType(EncodedType), AtLoc(at), RParenLoc(rp) {} EncodedType(EncodedType), AtLoc(at), RParenLoc(rp) {}
explicit ObjCEncodeExpr(EmptyShell Empty) : Expr(ObjCEncodeExprClass, Empty){} explicit ObjCEncodeExpr(EmptyShell Empty) : Expr(ObjCEncodeExprClass, Empty){}
@ -408,8 +408,8 @@ public:
TypeSourceInfo *getEncodedTypeSourceInfo() const { return EncodedType; } TypeSourceInfo *getEncodedTypeSourceInfo() const { return EncodedType; }
void setEncodedTypeSourceInfo(TypeSourceInfo *EncType) { void setEncodedTypeSourceInfo(TypeSourceInfo *EncType) {
EncodedType = EncType; EncodedType = EncType;
} }
SourceLocation getLocStart() const LLVM_READONLY { return AtLoc; } SourceLocation getLocStart() const LLVM_READONLY { return AtLoc; }
@ -531,9 +531,9 @@ public:
bool arrow = false, bool freeIvar = false) bool arrow = false, bool freeIvar = false)
: Expr(ObjCIvarRefExprClass, t, VK_LValue, : Expr(ObjCIvarRefExprClass, t, VK_LValue,
d->isBitField() ? OK_BitField : OK_Ordinary, d->isBitField() ? OK_BitField : OK_Ordinary,
/*TypeDependent=*/false, base->isValueDependent(), /*TypeDependent=*/false, base->isValueDependent(),
base->isInstantiationDependent(), base->isInstantiationDependent(),
base->containsUnexpandedParameterPack()), base->containsUnexpandedParameterPack()),
D(d), Base(base), Loc(l), OpLoc(oploc), IsArrow(arrow), D(d), Base(base), Loc(l), OpLoc(oploc), IsArrow(arrow),
IsFreeIvar(freeIvar) {} IsFreeIvar(freeIvar) {}
@ -560,7 +560,7 @@ public:
return isFreeIvar() ? Loc : getBase()->getLocStart(); return isFreeIvar() ? Loc : getBase()->getLocStart();
} }
SourceLocation getLocEnd() const LLVM_READONLY { return Loc; } SourceLocation getLocEnd() const LLVM_READONLY { return Loc; }
SourceLocation getOpLoc() const { return OpLoc; } SourceLocation getOpLoc() const { return OpLoc; }
void setOpLoc(SourceLocation L) { OpLoc = L; } void setOpLoc(SourceLocation L) { OpLoc = L; }
@ -600,13 +600,13 @@ private:
// transformation is lossy on the first character). // transformation is lossy on the first character).
SourceLocation IdLoc; SourceLocation IdLoc;
/// When the receiver in property access is 'super', this is /// When the receiver in property access is 'super', this is
/// the location of the 'super' keyword. When it's an interface, /// the location of the 'super' keyword. When it's an interface,
/// this is that interface. /// this is that interface.
SourceLocation ReceiverLoc; SourceLocation ReceiverLoc;
llvm::PointerUnion3<Stmt *, const Type *, ObjCInterfaceDecl *> Receiver; llvm::PointerUnion3<Stmt *, const Type *, ObjCInterfaceDecl *> Receiver;
public: public:
ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t, ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t,
ExprValueKind VK, ExprObjectKind OK, ExprValueKind VK, ExprObjectKind OK,
@ -618,7 +618,7 @@ public:
PropertyOrGetter(PD, false), IdLoc(l), Receiver(base) { PropertyOrGetter(PD, false), IdLoc(l), Receiver(base) {
assert(t->isSpecificPlaceholderType(BuiltinType::PseudoObject)); assert(t->isSpecificPlaceholderType(BuiltinType::PseudoObject));
} }
ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t, ObjCPropertyRefExpr(ObjCPropertyDecl *PD, QualType t,
ExprValueKind VK, ExprObjectKind OK, ExprValueKind VK, ExprObjectKind OK,
SourceLocation l, SourceLocation sl, QualType st) SourceLocation l, SourceLocation sl, QualType st)
@ -716,19 +716,19 @@ public:
setMethodRefFlag(MethodRef_Setter, val); setMethodRefFlag(MethodRef_Setter, val);
} }
const Expr *getBase() const { const Expr *getBase() const {
return cast<Expr>(Receiver.get<Stmt*>()); return cast<Expr>(Receiver.get<Stmt*>());
} }
Expr *getBase() { Expr *getBase() {
return cast<Expr>(Receiver.get<Stmt*>()); return cast<Expr>(Receiver.get<Stmt*>());
} }
SourceLocation getLocation() const { return IdLoc; } SourceLocation getLocation() const { return IdLoc; }
SourceLocation getReceiverLocation() const { return ReceiverLoc; } SourceLocation getReceiverLocation() const { return ReceiverLoc; }
QualType getSuperReceiverType() const { QualType getSuperReceiverType() const {
return QualType(Receiver.get<const Type*>(), 0); return QualType(Receiver.get<const Type*>(), 0);
} }
ObjCInterfaceDecl *getClassReceiver() const { ObjCInterfaceDecl *getClassReceiver() const {
@ -796,7 +796,7 @@ private:
SetterAndMethodRefFlags.setInt(f); SetterAndMethodRefFlags.setInt(f);
} }
}; };
/// ObjCSubscriptRefExpr - used for array and dictionary subscripting. /// ObjCSubscriptRefExpr - used for array and dictionary subscripting.
/// array[4] = array[3]; dictionary[key] = dictionary[alt_key]; /// array[4] = array[3]; dictionary[key] = dictionary[alt_key];
class ObjCSubscriptRefExpr : public Expr { class ObjCSubscriptRefExpr : public Expr {
@ -808,20 +808,20 @@ class ObjCSubscriptRefExpr : public Expr {
// an objective-c object pointer expression. // an objective-c object pointer expression.
enum { BASE, KEY, END_EXPR }; enum { BASE, KEY, END_EXPR };
Stmt* SubExprs[END_EXPR]; Stmt* SubExprs[END_EXPR];
ObjCMethodDecl *GetAtIndexMethodDecl; ObjCMethodDecl *GetAtIndexMethodDecl;
// For immutable objects this is null. When ObjCSubscriptRefExpr is to read // For immutable objects this is null. When ObjCSubscriptRefExpr is to read
// an indexed object this is null too. // an indexed object this is null too.
ObjCMethodDecl *SetAtIndexMethodDecl; ObjCMethodDecl *SetAtIndexMethodDecl;
public: public:
ObjCSubscriptRefExpr(Expr *base, Expr *key, QualType T, ObjCSubscriptRefExpr(Expr *base, Expr *key, QualType T,
ExprValueKind VK, ExprObjectKind OK, ExprValueKind VK, ExprObjectKind OK,
ObjCMethodDecl *getMethod, ObjCMethodDecl *getMethod,
ObjCMethodDecl *setMethod, SourceLocation RB) ObjCMethodDecl *setMethod, SourceLocation RB)
: Expr(ObjCSubscriptRefExprClass, T, VK, OK, : Expr(ObjCSubscriptRefExprClass, T, VK, OK,
base->isTypeDependent() || key->isTypeDependent(), base->isTypeDependent() || key->isTypeDependent(),
base->isValueDependent() || key->isValueDependent(), base->isValueDependent() || key->isValueDependent(),
(base->isInstantiationDependent() || (base->isInstantiationDependent() ||
key->isInstantiationDependent()), key->isInstantiationDependent()),
@ -834,7 +834,7 @@ public:
explicit ObjCSubscriptRefExpr(EmptyShell Empty) explicit ObjCSubscriptRefExpr(EmptyShell Empty)
: Expr(ObjCSubscriptRefExprClass, Empty) {} : Expr(ObjCSubscriptRefExprClass, Empty) {}
SourceLocation getRBracket() const { return RBracket; } SourceLocation getRBracket() const { return RBracket; }
void setRBracket(SourceLocation RB) { RBracket = RB; } void setRBracket(SourceLocation RB) { RBracket = RB; }
@ -843,25 +843,25 @@ public:
} }
SourceLocation getLocEnd() const LLVM_READONLY { return RBracket; } SourceLocation getLocEnd() const LLVM_READONLY { return RBracket; }
Expr *getBaseExpr() const { return cast<Expr>(SubExprs[BASE]); } Expr *getBaseExpr() const { return cast<Expr>(SubExprs[BASE]); }
void setBaseExpr(Stmt *S) { SubExprs[BASE] = S; } void setBaseExpr(Stmt *S) { SubExprs[BASE] = S; }
Expr *getKeyExpr() const { return cast<Expr>(SubExprs[KEY]); } Expr *getKeyExpr() const { return cast<Expr>(SubExprs[KEY]); }
void setKeyExpr(Stmt *S) { SubExprs[KEY] = S; } void setKeyExpr(Stmt *S) { SubExprs[KEY] = S; }
ObjCMethodDecl *getAtIndexMethodDecl() const { ObjCMethodDecl *getAtIndexMethodDecl() const {
return GetAtIndexMethodDecl; return GetAtIndexMethodDecl;
} }
ObjCMethodDecl *setAtIndexMethodDecl() const { ObjCMethodDecl *setAtIndexMethodDecl() const {
return SetAtIndexMethodDecl; return SetAtIndexMethodDecl;
} }
bool isArraySubscriptRefExpr() const { bool isArraySubscriptRefExpr() const {
return getKeyExpr()->getType()->isIntegralOrEnumerationType(); return getKeyExpr()->getType()->isIntegralOrEnumerationType();
} }
child_range children() { child_range children() {
return child_range(SubExprs, SubExprs+END_EXPR); return child_range(SubExprs, SubExprs+END_EXPR);
} }
@ -913,7 +913,7 @@ class ObjCMessageExpr final
/// The number of arguments in the message send, not /// The number of arguments in the message send, not
/// including the receiver. /// including the receiver.
unsigned NumArgs : NumArgsBitWidth; unsigned NumArgs : NumArgsBitWidth;
/// The kind of message send this is, which is one of the /// The kind of message send this is, which is one of the
/// ReceiverKind values. /// ReceiverKind values.
/// ///
@ -958,7 +958,7 @@ class ObjCMessageExpr final
SourceLocation SuperLoc, SourceLocation SuperLoc,
bool IsInstanceSuper, bool IsInstanceSuper,
QualType SuperType, QualType SuperType,
Selector Sel, Selector Sel,
ArrayRef<SourceLocation> SelLocs, ArrayRef<SourceLocation> SelLocs,
SelectorLocationsKind SelLocsK, SelectorLocationsKind SelLocsK,
ObjCMethodDecl *Method, ObjCMethodDecl *Method,
@ -968,7 +968,7 @@ class ObjCMessageExpr final
ObjCMessageExpr(QualType T, ExprValueKind VK, ObjCMessageExpr(QualType T, ExprValueKind VK,
SourceLocation LBracLoc, SourceLocation LBracLoc,
TypeSourceInfo *Receiver, TypeSourceInfo *Receiver,
Selector Sel, Selector Sel,
ArrayRef<SourceLocation> SelLocs, ArrayRef<SourceLocation> SelLocs,
SelectorLocationsKind SelLocsK, SelectorLocationsKind SelLocsK,
ObjCMethodDecl *Method, ObjCMethodDecl *Method,
@ -978,7 +978,7 @@ class ObjCMessageExpr final
ObjCMessageExpr(QualType T, ExprValueKind VK, ObjCMessageExpr(QualType T, ExprValueKind VK,
SourceLocation LBracLoc, SourceLocation LBracLoc,
Expr *Receiver, Expr *Receiver,
Selector Sel, Selector Sel,
ArrayRef<SourceLocation> SelLocs, ArrayRef<SourceLocation> SelLocs,
SelectorLocationsKind SelLocsK, SelectorLocationsKind SelLocsK,
ObjCMethodDecl *Method, ObjCMethodDecl *Method,
@ -1091,7 +1091,7 @@ public:
SourceLocation SuperLoc, SourceLocation SuperLoc,
bool IsInstanceSuper, bool IsInstanceSuper,
QualType SuperType, QualType SuperType,
Selector Sel, Selector Sel,
ArrayRef<SourceLocation> SelLocs, ArrayRef<SourceLocation> SelLocs,
ObjCMethodDecl *Method, ObjCMethodDecl *Method,
ArrayRef<Expr *> Args, ArrayRef<Expr *> Args,
@ -1125,7 +1125,7 @@ public:
ExprValueKind VK, ExprValueKind VK,
SourceLocation LBracLoc, SourceLocation LBracLoc,
TypeSourceInfo *Receiver, TypeSourceInfo *Receiver,
Selector Sel, Selector Sel,
ArrayRef<SourceLocation> SelLocs, ArrayRef<SourceLocation> SelLocs,
ObjCMethodDecl *Method, ObjCMethodDecl *Method,
ArrayRef<Expr *> Args, ArrayRef<Expr *> Args,
@ -1159,7 +1159,7 @@ public:
ExprValueKind VK, ExprValueKind VK,
SourceLocation LBracLoc, SourceLocation LBracLoc,
Expr *Receiver, Expr *Receiver,
Selector Sel, Selector Sel,
ArrayRef<SourceLocation> SeLocs, ArrayRef<SourceLocation> SeLocs,
ObjCMethodDecl *Method, ObjCMethodDecl *Method,
ArrayRef<Expr *> Args, ArrayRef<Expr *> Args,
@ -1215,14 +1215,14 @@ public:
/// Turn this message send into an instance message that /// Turn this message send into an instance message that
/// computes the receiver object with the given expression. /// computes the receiver object with the given expression.
void setInstanceReceiver(Expr *rec) { void setInstanceReceiver(Expr *rec) {
Kind = Instance; Kind = Instance;
setReceiverPointer(rec); setReceiverPointer(rec);
} }
/// Returns the type of a class message send, or NULL if the /// Returns the type of a class message send, or NULL if the
/// message is not a class message. /// message is not a class message.
QualType getClassReceiver() const { QualType getClassReceiver() const {
if (TypeSourceInfo *TSInfo = getClassReceiverTypeInfo()) if (TypeSourceInfo *TSInfo = getClassReceiverTypeInfo())
return TSInfo->getType(); return TSInfo->getType();
@ -1244,7 +1244,7 @@ public:
/// Retrieve the location of the 'super' keyword for a class /// Retrieve the location of the 'super' keyword for a class
/// or instance message to 'super', otherwise an invalid source location. /// or instance message to 'super', otherwise an invalid source location.
SourceLocation getSuperLoc() const { SourceLocation getSuperLoc() const {
if (getReceiverKind() == SuperInstance || getReceiverKind() == SuperClass) if (getReceiverKind() == SuperInstance || getReceiverKind() == SuperClass)
return SuperLoc; return SuperLoc;
@ -1274,7 +1274,7 @@ public:
/// \returns The Objective-C interface if known, otherwise nullptr. /// \returns The Objective-C interface if known, otherwise nullptr.
ObjCInterfaceDecl *getReceiverInterface() const; ObjCInterfaceDecl *getReceiverInterface() const;
/// Retrieve the type referred to by 'super'. /// Retrieve the type referred to by 'super'.
/// ///
/// The returned type will either be an ObjCInterfaceType (for an /// The returned type will either be an ObjCInterfaceType (for an
/// class message to super) or an ObjCObjectPointerType that refers /// class message to super) or an ObjCObjectPointerType that refers
@ -1294,26 +1294,26 @@ public:
Selector getSelector() const; Selector getSelector() const;
void setSelector(Selector S) { void setSelector(Selector S) {
HasMethod = false; HasMethod = false;
SelectorOrMethod = reinterpret_cast<uintptr_t>(S.getAsOpaquePtr()); SelectorOrMethod = reinterpret_cast<uintptr_t>(S.getAsOpaquePtr());
} }
const ObjCMethodDecl *getMethodDecl() const { const ObjCMethodDecl *getMethodDecl() const {
if (HasMethod) if (HasMethod)
return reinterpret_cast<const ObjCMethodDecl *>(SelectorOrMethod); return reinterpret_cast<const ObjCMethodDecl *>(SelectorOrMethod);
return nullptr; return nullptr;
} }
ObjCMethodDecl *getMethodDecl() { ObjCMethodDecl *getMethodDecl() {
if (HasMethod) if (HasMethod)
return reinterpret_cast<ObjCMethodDecl *>(SelectorOrMethod); return reinterpret_cast<ObjCMethodDecl *>(SelectorOrMethod);
return nullptr; return nullptr;
} }
void setMethodDecl(ObjCMethodDecl *MD) { void setMethodDecl(ObjCMethodDecl *MD) {
HasMethod = true; HasMethod = true;
SelectorOrMethod = reinterpret_cast<uintptr_t>(MD); SelectorOrMethod = reinterpret_cast<uintptr_t>(MD);
} }
@ -1414,16 +1414,16 @@ public:
arg_iterator arg_begin() { return reinterpret_cast<Stmt **>(getArgs()); } arg_iterator arg_begin() { return reinterpret_cast<Stmt **>(getArgs()); }
arg_iterator arg_end() { arg_iterator arg_end() {
return reinterpret_cast<Stmt **>(getArgs() + NumArgs); return reinterpret_cast<Stmt **>(getArgs() + NumArgs);
} }
const_arg_iterator arg_begin() const { const_arg_iterator arg_begin() const {
return reinterpret_cast<Stmt const * const*>(getArgs()); return reinterpret_cast<Stmt const * const*>(getArgs());
} }
const_arg_iterator arg_end() const { const_arg_iterator arg_end() const {
return reinterpret_cast<Stmt const * const*>(getArgs() + NumArgs); return reinterpret_cast<Stmt const * const*>(getArgs() + NumArgs);
} }
static bool classof(const Stmt *T) { static bool classof(const Stmt *T) {
@ -1439,7 +1439,7 @@ class ObjCIsaExpr : public Expr {
/// IsaMemberLoc - This is the location of the 'isa'. /// IsaMemberLoc - This is the location of the 'isa'.
SourceLocation IsaMemberLoc; SourceLocation IsaMemberLoc;
/// OpLoc - This is the location of '.' or '->' /// OpLoc - This is the location of '.' or '->'
SourceLocation OpLoc; SourceLocation OpLoc;
@ -1468,18 +1468,18 @@ public:
/// location of 'F'. /// location of 'F'.
SourceLocation getIsaMemberLoc() const { return IsaMemberLoc; } SourceLocation getIsaMemberLoc() const { return IsaMemberLoc; }
void setIsaMemberLoc(SourceLocation L) { IsaMemberLoc = L; } void setIsaMemberLoc(SourceLocation L) { IsaMemberLoc = L; }
SourceLocation getOpLoc() const { return OpLoc; } SourceLocation getOpLoc() const { return OpLoc; }
void setOpLoc(SourceLocation L) { OpLoc = L; } void setOpLoc(SourceLocation L) { OpLoc = L; }
SourceLocation getLocStart() const LLVM_READONLY { SourceLocation getLocStart() const LLVM_READONLY {
return getBase()->getLocStart(); return getBase()->getLocStart();
} }
SourceLocation getBaseLocEnd() const LLVM_READONLY { SourceLocation getBaseLocEnd() const LLVM_READONLY {
return getBase()->getLocEnd(); return getBase()->getLocEnd();
} }
SourceLocation getLocEnd() const LLVM_READONLY { return IsaMemberLoc; } SourceLocation getLocEnd() const LLVM_READONLY { return IsaMemberLoc; }
SourceLocation getExprLoc() const LLVM_READONLY { return IsaMemberLoc; } SourceLocation getExprLoc() const LLVM_READONLY { return IsaMemberLoc; }
@ -1546,7 +1546,7 @@ public:
/// copy-restore. If false, the temporary will be zero-initialized. /// copy-restore. If false, the temporary will be zero-initialized.
bool shouldCopy() const { return ObjCIndirectCopyRestoreExprBits.ShouldCopy; } bool shouldCopy() const { return ObjCIndirectCopyRestoreExprBits.ShouldCopy; }
child_range children() { return child_range(&Operand, &Operand+1); } child_range children() { return child_range(&Operand, &Operand+1); }
// Source locations are determined by the subexpression. // Source locations are determined by the subexpression.
SourceLocation getLocStart() const LLVM_READONLY { SourceLocation getLocStart() const LLVM_READONLY {
@ -1588,7 +1588,7 @@ public:
: ExplicitCastExpr(ObjCBridgedCastExprClass, TSInfo->getType(), VK_RValue, : ExplicitCastExpr(ObjCBridgedCastExprClass, TSInfo->getType(), VK_RValue,
CK, Operand, 0, TSInfo), CK, Operand, 0, TSInfo),
LParenLoc(LParenLoc), BridgeKeywordLoc(BridgeKeywordLoc), Kind(Kind) {} LParenLoc(LParenLoc), BridgeKeywordLoc(BridgeKeywordLoc), Kind(Kind) {}
/// Construct an empty Objective-C bridged cast. /// Construct an empty Objective-C bridged cast.
explicit ObjCBridgedCastExpr(EmptyShell Shell) explicit ObjCBridgedCastExpr(EmptyShell Shell)
: ExplicitCastExpr(ObjCBridgedCastExprClass, Shell, 0) {} : ExplicitCastExpr(ObjCBridgedCastExprClass, Shell, 0) {}
@ -1596,22 +1596,22 @@ public:
SourceLocation getLParenLoc() const { return LParenLoc; } SourceLocation getLParenLoc() const { return LParenLoc; }
/// Determine which kind of bridge is being performed via this cast. /// Determine which kind of bridge is being performed via this cast.
ObjCBridgeCastKind getBridgeKind() const { ObjCBridgeCastKind getBridgeKind() const {
return static_cast<ObjCBridgeCastKind>(Kind); return static_cast<ObjCBridgeCastKind>(Kind);
} }
/// Retrieve the kind of bridge being performed as a string. /// Retrieve the kind of bridge being performed as a string.
StringRef getBridgeKindName() const; StringRef getBridgeKindName() const;
/// The location of the bridge keyword. /// The location of the bridge keyword.
SourceLocation getBridgeKeywordLoc() const { return BridgeKeywordLoc; } SourceLocation getBridgeKeywordLoc() const { return BridgeKeywordLoc; }
SourceLocation getLocStart() const LLVM_READONLY { return LParenLoc; } SourceLocation getLocStart() const LLVM_READONLY { return LParenLoc; }
SourceLocation getLocEnd() const LLVM_READONLY { SourceLocation getLocEnd() const LLVM_READONLY {
return getSubExpr()->getLocEnd(); return getSubExpr()->getLocEnd();
} }
static bool classof(const Stmt *T) { static bool classof(const Stmt *T) {
return T->getStmtClass() == ObjCBridgedCastExprClass; return T->getStmtClass() == ObjCBridgedCastExprClass;
} }

View File

@ -37,7 +37,7 @@ namespace clang {
/// lookup. In this case, Origins contains an entry overriding lookup and /// lookup. In this case, Origins contains an entry overriding lookup and
/// specifying the correct pair of DeclContext/ASTContext. /// specifying the correct pair of DeclContext/ASTContext.
/// ///
/// - The DeclContext of origin was determined by another ExterenalASTMerger. /// - The DeclContext of origin was determined by another ExterenalASTMerger.
/// (This is possible when the source ASTContext for one of the Importers has /// (This is possible when the source ASTContext for one of the Importers has
/// its own ExternalASTMerger). The origin must be properly forwarded in this /// its own ExternalASTMerger). The origin must be properly forwarded in this
/// case. /// case.
@ -57,7 +57,7 @@ public:
typedef std::map<const DeclContext *, DCOrigin> OriginMap; typedef std::map<const DeclContext *, DCOrigin> OriginMap;
typedef std::vector<std::unique_ptr<ASTImporter>> ImporterVector; typedef std::vector<std::unique_ptr<ASTImporter>> ImporterVector;
private: private:
/// One importer exists for each source. /// One importer exists for each source.
ImporterVector Importers; ImporterVector Importers;
/// Overrides in case name lookup would return nothing or would return /// Overrides in case name lookup would return nothing or would return
/// the wrong thing. /// the wrong thing.
@ -106,7 +106,7 @@ public:
/// Remove a set of ASTContexts as possible origins. /// Remove a set of ASTContexts as possible origins.
/// ///
/// Sometimes an origin goes away (for example, if a source file gets /// Sometimes an origin goes away (for example, if a source file gets
/// superseded by a newer version). /// superseded by a newer version).
/// ///
/// The caller is responsible for ensuring that this doesn't leave /// The caller is responsible for ensuring that this doesn't leave
/// DeclContexts that can't be completed. /// DeclContexts that can't be completed.
@ -163,7 +163,7 @@ private:
template <typename CallbackType> template <typename CallbackType>
void ForEachMatchingDC(const DeclContext *DC, CallbackType Callback); void ForEachMatchingDC(const DeclContext *DC, CallbackType Callback);
public: public:
/// Log something if there is a logging callback installed. /// Log something if there is a logging callback installed.
llvm::raw_ostream &logs() { return *LogStream; } llvm::raw_ostream &logs() { return *LogStream; }

View File

@ -270,10 +270,10 @@ public:
/// ///
/// The default implementation of this method is a no-op. /// The default implementation of this method is a no-op.
virtual void PrintStats(); virtual void PrintStats();
/// Perform layout on the given record. /// Perform layout on the given record.
/// ///
/// This routine allows the external AST source to provide an specific /// This routine allows the external AST source to provide an specific
/// layout for a record, overriding the layout that would normally be /// layout for a record, overriding the layout that would normally be
/// constructed. It is intended for clients who receive specific layout /// constructed. It is intended for clients who receive specific layout
/// details rather than source code (such as LLDB). The client is expected /// details rather than source code (such as LLDB). The client is expected
@ -290,13 +290,13 @@ public:
/// expressed in bits. All of the fields must be provided with offsets. /// expressed in bits. All of the fields must be provided with offsets.
/// ///
/// \param BaseOffsets The offset of each of the direct, non-virtual base /// \param BaseOffsets The offset of each of the direct, non-virtual base
/// classes. If any bases are not given offsets, the bases will be laid /// classes. If any bases are not given offsets, the bases will be laid
/// out according to the ABI. /// out according to the ABI.
/// ///
/// \param VirtualBaseOffsets The offset of each of the virtual base classes /// \param VirtualBaseOffsets The offset of each of the virtual base classes
/// (either direct or not). If any bases are not given offsets, the bases will be laid /// (either direct or not). If any bases are not given offsets, the bases will be laid
/// out according to the ABI. /// out according to the ABI.
/// ///
/// \returns true if the record layout was provided, false otherwise. /// \returns true if the record layout was provided, false otherwise.
virtual bool layoutRecordType( virtual bool layoutRecordType(
const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment, const RecordDecl *Record, uint64_t &Size, uint64_t &Alignment,
@ -307,15 +307,15 @@ public:
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// Queries for performance analysis. // Queries for performance analysis.
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
struct MemoryBufferSizes { struct MemoryBufferSizes {
size_t malloc_bytes; size_t malloc_bytes;
size_t mmap_bytes; size_t mmap_bytes;
MemoryBufferSizes(size_t malloc_bytes, size_t mmap_bytes) MemoryBufferSizes(size_t malloc_bytes, size_t mmap_bytes)
: malloc_bytes(malloc_bytes), mmap_bytes(mmap_bytes) {} : malloc_bytes(malloc_bytes), mmap_bytes(mmap_bytes) {}
}; };
/// Return the amount of memory used by memory buffers, breaking down /// Return the amount of memory used by memory buffers, breaking down
/// by heap-backed versus mmap'ed memory. /// by heap-backed versus mmap'ed memory.
MemoryBufferSizes getMemoryBufferSizes() const { MemoryBufferSizes getMemoryBufferSizes() const {
@ -512,10 +512,10 @@ namespace clang {
/// Represents a lazily-loaded vector of data. /// Represents a lazily-loaded vector of data.
/// ///
/// The lazily-loaded vector of data contains data that is partially loaded /// The lazily-loaded vector of data contains data that is partially loaded
/// from an external source and partially added by local translation. The /// from an external source and partially added by local translation. The
/// items loaded from the external source are loaded lazily, when needed for /// items loaded from the external source are loaded lazily, when needed for
/// iteration over the complete vector. /// iteration over the complete vector.
template<typename T, typename Source, template<typename T, typename Source,
void (Source::*Loader)(SmallVectorImpl<T>&), void (Source::*Loader)(SmallVectorImpl<T>&),
unsigned LoadedStorage = 2, unsigned LocalStorage = 4> unsigned LoadedStorage = 2, unsigned LocalStorage = 4>
class LazyVector { class LazyVector {
@ -564,20 +564,20 @@ public:
iterator begin(Source *source, bool LocalOnly = false) { iterator begin(Source *source, bool LocalOnly = false) {
if (LocalOnly) if (LocalOnly)
return iterator(this, 0); return iterator(this, 0);
if (source) if (source)
(source->*Loader)(Loaded); (source->*Loader)(Loaded);
return iterator(this, -(int)Loaded.size()); return iterator(this, -(int)Loaded.size());
} }
iterator end() { iterator end() {
return iterator(this, Local.size()); return iterator(this, Local.size());
} }
void push_back(const T& LocalValue) { void push_back(const T& LocalValue) {
Local.push_back(LocalValue); Local.push_back(LocalValue);
} }
void erase(iterator From, iterator To) { void erase(iterator From, iterator To) {
if (From.isLoaded() && To.isLoaded()) { if (From.isLoaded() && To.isLoaded()) {
Loaded.erase(&*From, &*To); Loaded.erase(&*From, &*To);

View File

@ -57,7 +57,7 @@ public:
GlobalDecl CanonGD; GlobalDecl CanonGD;
CanonGD.Value.setPointer(Value.getPointer()->getCanonicalDecl()); CanonGD.Value.setPointer(Value.getPointer()->getCanonicalDecl());
CanonGD.Value.setInt(Value.getInt()); CanonGD.Value.setInt(Value.getInt());
return CanonGD; return CanonGD;
} }
@ -72,11 +72,11 @@ public:
assert(isa<CXXDestructorDecl>(getDecl()) && "Decl is not a dtor!"); assert(isa<CXXDestructorDecl>(getDecl()) && "Decl is not a dtor!");
return static_cast<CXXDtorType>(Value.getInt()); return static_cast<CXXDtorType>(Value.getInt());
} }
friend bool operator==(const GlobalDecl &LHS, const GlobalDecl &RHS) { friend bool operator==(const GlobalDecl &LHS, const GlobalDecl &RHS) {
return LHS.Value == RHS.Value; return LHS.Value == RHS.Value;
} }
void *getAsOpaquePtr() const { return Value.getOpaqueValue(); } void *getAsOpaquePtr() const { return Value.getOpaqueValue(); }
static GlobalDecl getFromOpaquePtr(void *P) { static GlobalDecl getFromOpaquePtr(void *P) {
@ -84,7 +84,7 @@ public:
GD.Value.setFromOpaqueValue(P); GD.Value.setFromOpaqueValue(P);
return GD; return GD;
} }
GlobalDecl getWithDecl(const Decl *D) { GlobalDecl getWithDecl(const Decl *D) {
GlobalDecl Result(*this); GlobalDecl Result(*this);
Result.Value.setPointer(D); Result.Value.setPointer(D);
@ -100,7 +100,7 @@ namespace llvm {
static inline clang::GlobalDecl getEmptyKey() { static inline clang::GlobalDecl getEmptyKey() {
return clang::GlobalDecl(); return clang::GlobalDecl();
} }
static inline clang::GlobalDecl getTombstoneKey() { static inline clang::GlobalDecl getTombstoneKey() {
return clang::GlobalDecl:: return clang::GlobalDecl::
getFromOpaquePtr(reinterpret_cast<void*>(-1)); getFromOpaquePtr(reinterpret_cast<void*>(-1));
@ -109,13 +109,13 @@ namespace llvm {
static unsigned getHashValue(clang::GlobalDecl GD) { static unsigned getHashValue(clang::GlobalDecl GD) {
return DenseMapInfo<void*>::getHashValue(GD.getAsOpaquePtr()); return DenseMapInfo<void*>::getHashValue(GD.getAsOpaquePtr());
} }
static bool isEqual(clang::GlobalDecl LHS, static bool isEqual(clang::GlobalDecl LHS,
clang::GlobalDecl RHS) { clang::GlobalDecl RHS) {
return LHS == RHS; return LHS == RHS;
} }
}; };
// GlobalDecl isn't *technically* a POD type. However, its copy constructor, // GlobalDecl isn't *technically* a POD type. However, its copy constructor,
// copy assignment operator, and destructor are all trivial. // copy assignment operator, and destructor are all trivial.
template <> template <>

View File

@ -41,7 +41,7 @@ class LambdaCapture {
}; };
// Decl could represent: // Decl could represent:
// - a VarDecl* that represents the variable that was captured or the // - a VarDecl* that represents the variable that was captured or the
// init-capture. // init-capture.
// - or, is a nullptr and Capture_This is set in Bits if this represents a // - or, is a nullptr and Capture_This is set in Bits if this represents a
// capture of '*this' by value or reference. // capture of '*this' by value or reference.

View File

@ -73,7 +73,7 @@ public:
DiagnosticsEngine &getDiags() const { return Diags; } DiagnosticsEngine &getDiags() const { return Diags; }
virtual void startNewFunction() { LocalBlockIds.clear(); } virtual void startNewFunction() { LocalBlockIds.clear(); }
unsigned getBlockId(const BlockDecl *BD, bool Local) { unsigned getBlockId(const BlockDecl *BD, bool Local) {
llvm::DenseMap<const BlockDecl *, unsigned> &BlockIds llvm::DenseMap<const BlockDecl *, unsigned> &BlockIds
= Local? LocalBlockIds : GlobalBlockIds; = Local? LocalBlockIds : GlobalBlockIds;

View File

@ -113,7 +113,7 @@ public:
NSMutableDict_setValueForKey NSMutableDict_setValueForKey
}; };
static const unsigned NumNSDictionaryMethods = 13; static const unsigned NumNSDictionaryMethods = 13;
/// The Objective-C NSDictionary selectors. /// The Objective-C NSDictionary selectors.
Selector getNSDictionarySelector(NSDictionaryMethodKind MK) const; Selector getNSDictionarySelector(NSDictionaryMethodKind MK) const;

View File

@ -44,7 +44,7 @@ class TypeLoc;
/// specifier. Nested name specifiers are made up of a sequence of /// specifier. Nested name specifiers are made up of a sequence of
/// specifiers, each of which can be a namespace, type, identifier /// specifiers, each of which can be a namespace, type, identifier
/// (for dependent names), decltype specifier, or the global specifier ('::'). /// (for dependent names), decltype specifier, or the global specifier ('::').
/// The last two specifiers can only appear at the start of a /// The last two specifiers can only appear at the start of a
/// nested-namespace-specifier. /// nested-namespace-specifier.
class NestedNameSpecifier : public llvm::FoldingSetNode { class NestedNameSpecifier : public llvm::FoldingSetNode {
/// Enumeration describing /// Enumeration describing
@ -438,7 +438,7 @@ public:
/// Turn this (empty) nested-name-specifier into the global /// Turn this (empty) nested-name-specifier into the global
/// nested-name-specifier '::'. /// nested-name-specifier '::'.
void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc); void MakeGlobal(ASTContext &Context, SourceLocation ColonColonLoc);
/// Turns this (empty) nested-name-specifier into '__super' /// Turns this (empty) nested-name-specifier into '__super'
/// nested-name-specifier. /// nested-name-specifier.
/// ///
@ -452,7 +452,7 @@ public:
/// name. /// name.
/// ///
/// \param ColonColonLoc The location of the trailing '::'. /// \param ColonColonLoc The location of the trailing '::'.
void MakeSuper(ASTContext &Context, CXXRecordDecl *RD, void MakeSuper(ASTContext &Context, CXXRecordDecl *RD,
SourceLocation SuperLoc, SourceLocation ColonColonLoc); SourceLocation SuperLoc, SourceLocation ColonColonLoc);
/// Make a new nested-name-specifier from incomplete source-location /// Make a new nested-name-specifier from incomplete source-location

View File

@ -307,7 +307,7 @@ CAST_OPERATION(AtomicToNonAtomic)
/// Converts from T to _Atomic(T). /// Converts from T to _Atomic(T).
CAST_OPERATION(NonAtomicToAtomic) CAST_OPERATION(NonAtomicToAtomic)
/// Causes a block literal to by copied to the heap and then /// Causes a block literal to by copied to the heap and then
/// autoreleased. /// autoreleased.
/// ///
/// This particular cast kind is used for the conversion from a C++11 /// This particular cast kind is used for the conversion from a C++11
@ -391,13 +391,13 @@ BINARY_OPERATION(Comma, ",")
// [C99 6.5.2.4] Postfix increment and decrement // [C99 6.5.2.4] Postfix increment and decrement
UNARY_OPERATION(PostInc, "++") UNARY_OPERATION(PostInc, "++")
UNARY_OPERATION(PostDec, "--") UNARY_OPERATION(PostDec, "--")
// [C99 6.5.3.1] Prefix increment and decrement // [C99 6.5.3.1] Prefix increment and decrement
UNARY_OPERATION(PreInc, "++") UNARY_OPERATION(PreInc, "++")
UNARY_OPERATION(PreDec, "--") UNARY_OPERATION(PreDec, "--")
// [C99 6.5.3.2] Address and indirection // [C99 6.5.3.2] Address and indirection
UNARY_OPERATION(AddrOf, "&") UNARY_OPERATION(AddrOf, "&")
UNARY_OPERATION(Deref, "*") UNARY_OPERATION(Deref, "*")
// [C99 6.5.3.3] Unary arithmetic // [C99 6.5.3.3] Unary arithmetic
UNARY_OPERATION(Plus, "+") UNARY_OPERATION(Plus, "+")
UNARY_OPERATION(Minus, "-") UNARY_OPERATION(Minus, "-")
UNARY_OPERATION(Not, "~") UNARY_OPERATION(Not, "~")

View File

@ -16,7 +16,7 @@
#define LLVM_CLANG_AST_OPERATIONKINDS_H #define LLVM_CLANG_AST_OPERATIONKINDS_H
namespace clang { namespace clang {
/// CastKind - The kind of operation required for a conversion. /// CastKind - The kind of operation required for a conversion.
enum CastKind { enum CastKind {
#define CAST_OPERATION(Name) CK_##Name, #define CAST_OPERATION(Name) CK_##Name,

View File

@ -109,7 +109,7 @@ struct PrintingPolicy {
/// Suppress printing parts of scope specifiers that don't need /// Suppress printing parts of scope specifiers that don't need
/// to be written, e.g., for inline or anonymous namespaces. /// to be written, e.g., for inline or anonymous namespaces.
bool SuppressUnwrittenScope : 1; bool SuppressUnwrittenScope : 1;
/// Suppress printing of variable initializers. /// Suppress printing of variable initializers.
/// ///
/// This flag is used when printing the loop variable in a for-range /// This flag is used when printing the loop variable in a for-range
@ -140,15 +140,15 @@ struct PrintingPolicy {
/// char a[9] = "A string"; /// char a[9] = "A string";
/// \endcode /// \endcode
bool ConstantArraySizeAsWritten : 1; bool ConstantArraySizeAsWritten : 1;
/// When printing an anonymous tag name, also print the location of that /// When printing an anonymous tag name, also print the location of that
/// entity (e.g., "enum <anonymous at t.h:10:5>"). Otherwise, just prints /// entity (e.g., "enum <anonymous at t.h:10:5>"). Otherwise, just prints
/// "(anonymous)" for the name. /// "(anonymous)" for the name.
bool AnonymousTagLocations : 1; bool AnonymousTagLocations : 1;
/// When true, suppress printing of the __strong lifetime qualifier in ARC. /// When true, suppress printing of the __strong lifetime qualifier in ARC.
unsigned SuppressStrongLifetime : 1; unsigned SuppressStrongLifetime : 1;
/// When true, suppress printing of lifetime qualifier in ARC. /// When true, suppress printing of lifetime qualifier in ARC.
unsigned SuppressLifetimeQualifiers : 1; unsigned SuppressLifetimeQualifiers : 1;
@ -179,7 +179,7 @@ struct PrintingPolicy {
/// declarations inside namespaces etc. Effectively, this should print /// declarations inside namespaces etc. Effectively, this should print
/// only the requested declaration. /// only the requested declaration.
unsigned TerseOutput : 1; unsigned TerseOutput : 1;
/// When true, do certain refinement needed for producing proper declaration /// When true, do certain refinement needed for producing proper declaration
/// tag; such as, do not print attributes attached to the declaration. /// tag; such as, do not print attributes attached to the declaration.
/// ///

View File

@ -124,10 +124,10 @@ private:
/// BaseSharingVBPtr - The base we share vbptr with. /// BaseSharingVBPtr - The base we share vbptr with.
const CXXRecordDecl *BaseSharingVBPtr; const CXXRecordDecl *BaseSharingVBPtr;
/// FIXME: This should really use a SmallPtrMap, once we have one in LLVM :) /// FIXME: This should really use a SmallPtrMap, once we have one in LLVM :)
using BaseOffsetsMapTy = llvm::DenseMap<const CXXRecordDecl *, CharUnits>; using BaseOffsetsMapTy = llvm::DenseMap<const CXXRecordDecl *, CharUnits>;
/// BaseOffsets - Contains a map from base classes to their offset. /// BaseOffsets - Contains a map from base classes to their offset.
BaseOffsetsMapTy BaseOffsets; BaseOffsetsMapTy BaseOffsets;
@ -168,7 +168,7 @@ private:
~ASTRecordLayout() = default; ~ASTRecordLayout() = default;
void Destroy(ASTContext &Ctx); void Destroy(ASTContext &Ctx);
public: public:
ASTRecordLayout(const ASTRecordLayout &) = delete; ASTRecordLayout(const ASTRecordLayout &) = delete;
ASTRecordLayout &operator=(const ASTRecordLayout &) = delete; ASTRecordLayout &operator=(const ASTRecordLayout &) = delete;
@ -269,7 +269,7 @@ public:
assert(CXXInfo && "Record layout does not have C++ specific info!"); assert(CXXInfo && "Record layout does not have C++ specific info!");
return CXXInfo->HasExtendableVFPtr; return CXXInfo->HasExtendableVFPtr;
} }
/// hasOwnVBPtr - Does this class provide its own virtual-base /// hasOwnVBPtr - Does this class provide its own virtual-base
/// table pointer, rather than inheriting one from a primary base /// table pointer, rather than inheriting one from a primary base
/// class? /// class?

View File

@ -271,12 +271,12 @@ protected:
friend class ASTStmtReader; friend class ASTStmtReader;
friend class ASTStmtWriter; friend class ASTStmtWriter;
friend class TypeTraitExpr; friend class TypeTraitExpr;
unsigned : NumExprBits; unsigned : NumExprBits;
/// The kind of type trait, which is a value of a TypeTrait enumerator. /// The kind of type trait, which is a value of a TypeTrait enumerator.
unsigned Kind : 8; unsigned Kind : 8;
/// If this expression is not value-dependent, this indicates whether /// If this expression is not value-dependent, this indicates whether
/// the trait evaluated true or false. /// the trait evaluated true or false.
unsigned Value : 1; unsigned Value : 1;
@ -1556,7 +1556,7 @@ public:
/// getInputConstraint - Return the specified input constraint. Unlike output /// getInputConstraint - Return the specified input constraint. Unlike output
/// constraints, these can be empty. /// constraints, these can be empty.
StringRef getInputConstraint(unsigned i) const; StringRef getInputConstraint(unsigned i) const;
const Expr *getInputExpr(unsigned i) const; const Expr *getInputExpr(unsigned i) const;
//===--- Other ---===// //===--- Other ---===//
@ -2133,7 +2133,7 @@ private:
/// The number of variable captured, including 'this'. /// The number of variable captured, including 'this'.
unsigned NumCaptures; unsigned NumCaptures;
/// The pointer part is the implicit the outlined function and the /// The pointer part is the implicit the outlined function and the
/// int part is the captured region kind, 'CR_Default' etc. /// int part is the captured region kind, 'CR_Default' etc.
llvm::PointerIntPair<CapturedDecl *, 2, CapturedRegionKind> CapDeclAndKind; llvm::PointerIntPair<CapturedDecl *, 2, CapturedRegionKind> CapDeclAndKind;

View File

@ -33,14 +33,14 @@ protected:
DeclGroupMode = 0x2, DeclGroupMode = 0x2,
Flags = 0x3 Flags = 0x3
}; };
union { union {
Stmt **stmt; Stmt **stmt;
Decl **DGI; Decl **DGI;
}; };
uintptr_t RawVAPtr = 0; uintptr_t RawVAPtr = 0;
Decl **DGE; Decl **DGE;
StmtIteratorBase(Stmt **s) : stmt(s) {} StmtIteratorBase(Stmt **s) : stmt(s) {}
StmtIteratorBase(const VariableArrayType *t); StmtIteratorBase(const VariableArrayType *t);
StmtIteratorBase(Decl **dgi, Decl **dge); StmtIteratorBase(Decl **dgi, Decl **dge);

View File

@ -81,7 +81,7 @@ public:
ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc, ObjCAtCatchStmt(SourceLocation atCatchLoc, SourceLocation rparenloc,
VarDecl *catchVarDecl, VarDecl *catchVarDecl,
Stmt *atCatchStmt) Stmt *atCatchStmt)
: Stmt(ObjCAtCatchStmtClass), ExceptionDecl(catchVarDecl), : Stmt(ObjCAtCatchStmtClass), ExceptionDecl(catchVarDecl),
Body(atCatchStmt), AtCatchLoc(atCatchLoc), RParenLoc(rparenloc) { } Body(atCatchStmt), AtCatchLoc(atCatchLoc), RParenLoc(rparenloc) { }
explicit ObjCAtCatchStmt(EmptyShell Empty) : explicit ObjCAtCatchStmt(EmptyShell Empty) :
@ -155,27 +155,27 @@ class ObjCAtTryStmt : public Stmt {
private: private:
// The location of the @ in the \@try. // The location of the @ in the \@try.
SourceLocation AtTryLoc; SourceLocation AtTryLoc;
// The number of catch blocks in this statement. // The number of catch blocks in this statement.
unsigned NumCatchStmts : 16; unsigned NumCatchStmts : 16;
// Whether this statement has a \@finally statement. // Whether this statement has a \@finally statement.
bool HasFinally : 1; bool HasFinally : 1;
/// Retrieve the statements that are stored after this \@try statement. /// Retrieve the statements that are stored after this \@try statement.
/// ///
/// The order of the statements in memory follows the order in the source, /// The order of the statements in memory follows the order in the source,
/// with the \@try body first, followed by the \@catch statements (if any) /// with the \@try body first, followed by the \@catch statements (if any)
/// and, finally, the \@finally (if it exists). /// and, finally, the \@finally (if it exists).
Stmt **getStmts() { return reinterpret_cast<Stmt **> (this + 1); } Stmt **getStmts() { return reinterpret_cast<Stmt **> (this + 1); }
const Stmt* const *getStmts() const { const Stmt* const *getStmts() const {
return reinterpret_cast<const Stmt * const*> (this + 1); return reinterpret_cast<const Stmt * const*> (this + 1);
} }
ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt, ObjCAtTryStmt(SourceLocation atTryLoc, Stmt *atTryStmt,
Stmt **CatchStmts, unsigned NumCatchStmts, Stmt **CatchStmts, unsigned NumCatchStmts,
Stmt *atFinallyStmt); Stmt *atFinallyStmt);
explicit ObjCAtTryStmt(EmptyShell Empty, unsigned NumCatchStmts, explicit ObjCAtTryStmt(EmptyShell Empty, unsigned NumCatchStmts,
bool HasFinally) bool HasFinally)
: Stmt(ObjCAtTryStmtClass, Empty), NumCatchStmts(NumCatchStmts), : Stmt(ObjCAtTryStmtClass, Empty), NumCatchStmts(NumCatchStmts),
@ -188,7 +188,7 @@ public:
Stmt *atFinallyStmt); Stmt *atFinallyStmt);
static ObjCAtTryStmt *CreateEmpty(const ASTContext &Context, static ObjCAtTryStmt *CreateEmpty(const ASTContext &Context,
unsigned NumCatchStmts, bool HasFinally); unsigned NumCatchStmts, bool HasFinally);
/// Retrieve the location of the @ in the \@try. /// Retrieve the location of the @ in the \@try.
SourceLocation getAtTryLoc() const { return AtTryLoc; } SourceLocation getAtTryLoc() const { return AtTryLoc; }
void setAtTryLoc(SourceLocation Loc) { AtTryLoc = Loc; } void setAtTryLoc(SourceLocation Loc) { AtTryLoc = Loc; }
@ -201,41 +201,41 @@ public:
/// Retrieve the number of \@catch statements in this try-catch-finally /// Retrieve the number of \@catch statements in this try-catch-finally
/// block. /// block.
unsigned getNumCatchStmts() const { return NumCatchStmts; } unsigned getNumCatchStmts() const { return NumCatchStmts; }
/// Retrieve a \@catch statement. /// Retrieve a \@catch statement.
const ObjCAtCatchStmt *getCatchStmt(unsigned I) const { const ObjCAtCatchStmt *getCatchStmt(unsigned I) const {
assert(I < NumCatchStmts && "Out-of-bounds @catch index"); assert(I < NumCatchStmts && "Out-of-bounds @catch index");
return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]); return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
} }
/// Retrieve a \@catch statement. /// Retrieve a \@catch statement.
ObjCAtCatchStmt *getCatchStmt(unsigned I) { ObjCAtCatchStmt *getCatchStmt(unsigned I) {
assert(I < NumCatchStmts && "Out-of-bounds @catch index"); assert(I < NumCatchStmts && "Out-of-bounds @catch index");
return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]); return cast_or_null<ObjCAtCatchStmt>(getStmts()[I + 1]);
} }
/// Set a particular catch statement. /// Set a particular catch statement.
void setCatchStmt(unsigned I, ObjCAtCatchStmt *S) { void setCatchStmt(unsigned I, ObjCAtCatchStmt *S) {
assert(I < NumCatchStmts && "Out-of-bounds @catch index"); assert(I < NumCatchStmts && "Out-of-bounds @catch index");
getStmts()[I + 1] = S; getStmts()[I + 1] = S;
} }
/// Retrieve the \@finally statement, if any. /// Retrieve the \@finally statement, if any.
const ObjCAtFinallyStmt *getFinallyStmt() const { const ObjCAtFinallyStmt *getFinallyStmt() const {
if (!HasFinally) if (!HasFinally)
return nullptr; return nullptr;
return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]); return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
} }
ObjCAtFinallyStmt *getFinallyStmt() { ObjCAtFinallyStmt *getFinallyStmt() {
if (!HasFinally) if (!HasFinally)
return nullptr; return nullptr;
return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]); return cast_or_null<ObjCAtFinallyStmt>(getStmts()[1 + NumCatchStmts]);
} }
void setFinallyStmt(Stmt *S) { void setFinallyStmt(Stmt *S) {
assert(HasFinally && "@try does not have a @finally slot!"); assert(HasFinally && "@try does not have a @finally slot!");
getStmts()[1 + NumCatchStmts] = S; getStmts()[1 + NumCatchStmts] = S;
} }
SourceLocation getLocStart() const LLVM_READONLY { return AtTryLoc; } SourceLocation getLocStart() const LLVM_READONLY { return AtTryLoc; }

View File

@ -2319,7 +2319,7 @@ class OMPTargetDataDirective : public OMPExecutableDirective {
/// ///
OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc, OMPTargetDataDirective(SourceLocation StartLoc, SourceLocation EndLoc,
unsigned NumClauses) unsigned NumClauses)
: OMPExecutableDirective(this, OMPTargetDataDirectiveClass, : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
OMPD_target_data, StartLoc, EndLoc, NumClauses, OMPD_target_data, StartLoc, EndLoc, NumClauses,
1) {} 1) {}
@ -2328,7 +2328,7 @@ class OMPTargetDataDirective : public OMPExecutableDirective {
/// \param NumClauses Number of clauses. /// \param NumClauses Number of clauses.
/// ///
explicit OMPTargetDataDirective(unsigned NumClauses) explicit OMPTargetDataDirective(unsigned NumClauses)
: OMPExecutableDirective(this, OMPTargetDataDirectiveClass, : OMPExecutableDirective(this, OMPTargetDataDirectiveClass,
OMPD_target_data, SourceLocation(), OMPD_target_data, SourceLocation(),
SourceLocation(), NumClauses, 1) {} SourceLocation(), NumClauses, 1) {}
@ -3157,7 +3157,7 @@ class OMPDistributeParallelForSimdDirective final : public OMPLoopDirective {
unsigned CollapsedNum, unsigned CollapsedNum,
unsigned NumClauses) unsigned NumClauses)
: OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass, : OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass,
OMPD_distribute_parallel_for_simd, StartLoc, OMPD_distribute_parallel_for_simd, StartLoc,
EndLoc, CollapsedNum, NumClauses) {} EndLoc, CollapsedNum, NumClauses) {}
/// Build an empty directive. /// Build an empty directive.
@ -3168,7 +3168,7 @@ class OMPDistributeParallelForSimdDirective final : public OMPLoopDirective {
explicit OMPDistributeParallelForSimdDirective(unsigned CollapsedNum, explicit OMPDistributeParallelForSimdDirective(unsigned CollapsedNum,
unsigned NumClauses) unsigned NumClauses)
: OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass, : OMPLoopDirective(this, OMPDistributeParallelForSimdDirectiveClass,
OMPD_distribute_parallel_for_simd, OMPD_distribute_parallel_for_simd,
SourceLocation(), SourceLocation(), CollapsedNum, SourceLocation(), SourceLocation(), CollapsedNum,
NumClauses) {} NumClauses) {}
@ -3232,7 +3232,7 @@ class OMPDistributeSimdDirective final : public OMPLoopDirective {
/// \param CollapsedNum Number of collapsed nested loops. /// \param CollapsedNum Number of collapsed nested loops.
/// \param NumClauses Number of clauses. /// \param NumClauses Number of clauses.
/// ///
explicit OMPDistributeSimdDirective(unsigned CollapsedNum, explicit OMPDistributeSimdDirective(unsigned CollapsedNum,
unsigned NumClauses) unsigned NumClauses)
: OMPLoopDirective(this, OMPDistributeSimdDirectiveClass, : OMPLoopDirective(this, OMPDistributeSimdDirectiveClass,
OMPD_distribute_simd, SourceLocation(), OMPD_distribute_simd, SourceLocation(),
@ -3369,7 +3369,7 @@ class OMPTargetSimdDirective final : public OMPLoopDirective {
/// \param NumClauses Number of clauses. /// \param NumClauses Number of clauses.
/// ///
explicit OMPTargetSimdDirective(unsigned CollapsedNum, unsigned NumClauses) explicit OMPTargetSimdDirective(unsigned CollapsedNum, unsigned NumClauses)
: OMPLoopDirective(this, OMPTargetSimdDirectiveClass, OMPD_target_simd, : OMPLoopDirective(this, OMPTargetSimdDirectiveClass, OMPD_target_simd,
SourceLocation(),SourceLocation(), CollapsedNum, SourceLocation(),SourceLocation(), CollapsedNum,
NumClauses) {} NumClauses) {}
@ -3425,8 +3425,8 @@ class OMPTeamsDistributeDirective final : public OMPLoopDirective {
/// ///
OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc, OMPTeamsDistributeDirective(SourceLocation StartLoc, SourceLocation EndLoc,
unsigned CollapsedNum, unsigned NumClauses) unsigned CollapsedNum, unsigned NumClauses)
: OMPLoopDirective(this, OMPTeamsDistributeDirectiveClass, : OMPLoopDirective(this, OMPTeamsDistributeDirectiveClass,
OMPD_teams_distribute, StartLoc, EndLoc, OMPD_teams_distribute, StartLoc, EndLoc,
CollapsedNum, NumClauses) {} CollapsedNum, NumClauses) {}
/// Build an empty directive. /// Build an empty directive.
@ -3567,7 +3567,7 @@ class OMPTeamsDistributeParallelForSimdDirective final
unsigned CollapsedNum, unsigned CollapsedNum,
unsigned NumClauses) unsigned NumClauses)
: OMPLoopDirective(this, OMPTeamsDistributeParallelForSimdDirectiveClass, : OMPLoopDirective(this, OMPTeamsDistributeParallelForSimdDirectiveClass,
OMPD_teams_distribute_parallel_for_simd, StartLoc, OMPD_teams_distribute_parallel_for_simd, StartLoc,
EndLoc, CollapsedNum, NumClauses) {} EndLoc, CollapsedNum, NumClauses) {}
/// Build an empty directive. /// Build an empty directive.
@ -3578,7 +3578,7 @@ class OMPTeamsDistributeParallelForSimdDirective final
explicit OMPTeamsDistributeParallelForSimdDirective(unsigned CollapsedNum, explicit OMPTeamsDistributeParallelForSimdDirective(unsigned CollapsedNum,
unsigned NumClauses) unsigned NumClauses)
: OMPLoopDirective(this, OMPTeamsDistributeParallelForSimdDirectiveClass, : OMPLoopDirective(this, OMPTeamsDistributeParallelForSimdDirectiveClass,
OMPD_teams_distribute_parallel_for_simd, OMPD_teams_distribute_parallel_for_simd,
SourceLocation(), SourceLocation(), CollapsedNum, SourceLocation(), SourceLocation(), CollapsedNum,
NumClauses) {} NumClauses) {}

View File

@ -252,7 +252,7 @@ public:
/// Determine whether this template argument is a pack expansion. /// Determine whether this template argument is a pack expansion.
bool isPackExpansion() const; bool isPackExpansion() const;
/// Retrieve the type for a type template argument. /// Retrieve the type for a type template argument.
QualType getAsType() const { QualType getAsType() const {
assert(getKind() == Type && "Unexpected kind"); assert(getKind() == Type && "Unexpected kind");
@ -288,14 +288,14 @@ public:
TemplateName getAsTemplateOrTemplatePattern() const { TemplateName getAsTemplateOrTemplatePattern() const {
assert((getKind() == Template || getKind() == TemplateExpansion) && assert((getKind() == Template || getKind() == TemplateExpansion) &&
"Unexpected kind"); "Unexpected kind");
return TemplateName::getFromVoidPointer(TemplateArg.Name); return TemplateName::getFromVoidPointer(TemplateArg.Name);
} }
/// Retrieve the number of expansions that a template template argument /// Retrieve the number of expansions that a template template argument
/// expansion will produce, if known. /// expansion will produce, if known.
Optional<unsigned> getNumTemplateExpansions() const; Optional<unsigned> getNumTemplateExpansions() const;
/// Retrieve the template argument as an integral value. /// Retrieve the template argument as an integral value.
// FIXME: Provide a way to read the integral data without copying the value. // FIXME: Provide a way to read the integral data without copying the value.
llvm::APSInt getAsIntegral() const { llvm::APSInt getAsIntegral() const {
@ -378,13 +378,13 @@ public:
/// Print this template argument to the given output stream. /// Print this template argument to the given output stream.
void print(const PrintingPolicy &Policy, raw_ostream &Out) const; void print(const PrintingPolicy &Policy, raw_ostream &Out) const;
/// Debugging aid that dumps the template argument. /// Debugging aid that dumps the template argument.
void dump(raw_ostream &Out) const; void dump(raw_ostream &Out) const;
/// Debugging aid that dumps the template argument to standard error. /// Debugging aid that dumps the template argument to standard error.
void dump() const; void dump() const;
/// Used to insert TemplateArguments into FoldingSets. /// Used to insert TemplateArguments into FoldingSets.
void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const; void Profile(llvm::FoldingSetNodeID &ID, const ASTContext &Context) const;
}; };
@ -411,9 +411,9 @@ public:
constexpr TemplateArgumentLocInfo() : Template({nullptr, nullptr, 0, 0}) {} constexpr TemplateArgumentLocInfo() : Template({nullptr, nullptr, 0, 0}) {}
TemplateArgumentLocInfo(TypeSourceInfo *TInfo) : Declarator(TInfo) {} TemplateArgumentLocInfo(TypeSourceInfo *TInfo) : Declarator(TInfo) {}
TemplateArgumentLocInfo(Expr *E) : Expression(E) {} TemplateArgumentLocInfo(Expr *E) : Expression(E) {}
TemplateArgumentLocInfo(NestedNameSpecifierLoc QualifierLoc, TemplateArgumentLocInfo(NestedNameSpecifierLoc QualifierLoc,
SourceLocation TemplateNameLoc, SourceLocation TemplateNameLoc,
SourceLocation EllipsisLoc) { SourceLocation EllipsisLoc) {
@ -432,14 +432,14 @@ public:
} }
NestedNameSpecifierLoc getTemplateQualifierLoc() const { NestedNameSpecifierLoc getTemplateQualifierLoc() const {
return NestedNameSpecifierLoc(Template.Qualifier, return NestedNameSpecifierLoc(Template.Qualifier,
Template.QualifierLocData); Template.QualifierLocData);
} }
SourceLocation getTemplateNameLoc() const { SourceLocation getTemplateNameLoc() const {
return SourceLocation::getFromRawEncoding(Template.TemplateNameLoc); return SourceLocation::getFromRawEncoding(Template.TemplateNameLoc);
} }
SourceLocation getTemplateEllipsisLoc() const { SourceLocation getTemplateEllipsisLoc() const {
return SourceLocation::getFromRawEncoding(Template.EllipsisLoc); return SourceLocation::getFromRawEncoding(Template.EllipsisLoc);
} }
@ -468,7 +468,7 @@ public:
assert(Argument.getKind() == TemplateArgument::Expression); assert(Argument.getKind() == TemplateArgument::Expression);
} }
TemplateArgumentLoc(const TemplateArgument &Argument, TemplateArgumentLoc(const TemplateArgument &Argument,
NestedNameSpecifierLoc QualifierLoc, NestedNameSpecifierLoc QualifierLoc,
SourceLocation TemplateNameLoc, SourceLocation TemplateNameLoc,
SourceLocation EllipsisLoc = SourceLocation()) SourceLocation EllipsisLoc = SourceLocation())
@ -477,13 +477,13 @@ public:
assert(Argument.getKind() == TemplateArgument::Template || assert(Argument.getKind() == TemplateArgument::Template ||
Argument.getKind() == TemplateArgument::TemplateExpansion); Argument.getKind() == TemplateArgument::TemplateExpansion);
} }
/// - Fetches the primary location of the argument. /// - Fetches the primary location of the argument.
SourceLocation getLocation() const { SourceLocation getLocation() const {
if (Argument.getKind() == TemplateArgument::Template || if (Argument.getKind() == TemplateArgument::Template ||
Argument.getKind() == TemplateArgument::TemplateExpansion) Argument.getKind() == TemplateArgument::TemplateExpansion)
return getTemplateNameLoc(); return getTemplateNameLoc();
return getSourceRange().getBegin(); return getSourceRange().getBegin();
} }
@ -528,13 +528,13 @@ public:
Argument.getKind() == TemplateArgument::TemplateExpansion); Argument.getKind() == TemplateArgument::TemplateExpansion);
return LocInfo.getTemplateQualifierLoc(); return LocInfo.getTemplateQualifierLoc();
} }
SourceLocation getTemplateNameLoc() const { SourceLocation getTemplateNameLoc() const {
assert(Argument.getKind() == TemplateArgument::Template || assert(Argument.getKind() == TemplateArgument::Template ||
Argument.getKind() == TemplateArgument::TemplateExpansion); Argument.getKind() == TemplateArgument::TemplateExpansion);
return LocInfo.getTemplateNameLoc(); return LocInfo.getTemplateNameLoc();
} }
SourceLocation getTemplateEllipsisLoc() const { SourceLocation getTemplateEllipsisLoc() const {
assert(Argument.getKind() == TemplateArgument::TemplateExpansion); assert(Argument.getKind() == TemplateArgument::TemplateExpansion);
return LocInfo.getTemplateEllipsisLoc(); return LocInfo.getTemplateEllipsisLoc();
@ -689,7 +689,7 @@ inline const TemplateArgument &
assert(Idx < getNumArgs() && "Template argument out of range"); assert(Idx < getNumArgs() && "Template argument out of range");
return getArgs()[Idx]; return getArgs()[Idx];
} }
} // namespace clang } // namespace clang
#endif // LLVM_CLANG_AST_TEMPLATEBASE_H #endif // LLVM_CLANG_AST_TEMPLATEBASE_H

View File

@ -22,7 +22,7 @@
#include <cassert> #include <cassert>
namespace clang { namespace clang {
class ASTContext; class ASTContext;
class DependentTemplateName; class DependentTemplateName;
class DiagnosticBuilder; class DiagnosticBuilder;
@ -38,7 +38,7 @@ class SubstTemplateTemplateParmStorage;
class TemplateArgument; class TemplateArgument;
class TemplateDecl; class TemplateDecl;
class TemplateTemplateParmDecl; class TemplateTemplateParmDecl;
/// Implementation class used to describe either a set of overloaded /// Implementation class used to describe either a set of overloaded
/// template names or an already-substituted template template parameter pack. /// template names or an already-substituted template template parameter pack.
class UncommonTemplateNameStorage { class UncommonTemplateNameStorage {
@ -52,7 +52,7 @@ protected:
struct BitsTag { struct BitsTag {
/// A Kind. /// A Kind.
unsigned Kind : 2; unsigned Kind : 2;
/// The number of stored templates or template arguments, /// The number of stored templates or template arguments,
/// depending on which subclass we have. /// depending on which subclass we have.
unsigned Size : 30; unsigned Size : 30;
@ -62,21 +62,21 @@ protected:
struct BitsTag Bits; struct BitsTag Bits;
void *PointerAlignment; void *PointerAlignment;
}; };
UncommonTemplateNameStorage(Kind kind, unsigned size) { UncommonTemplateNameStorage(Kind kind, unsigned size) {
Bits.Kind = kind; Bits.Kind = kind;
Bits.Size = size; Bits.Size = size;
} }
public: public:
unsigned size() const { return Bits.Size; } unsigned size() const { return Bits.Size; }
OverloadedTemplateStorage *getAsOverloadedStorage() { OverloadedTemplateStorage *getAsOverloadedStorage() {
return Bits.Kind == Overloaded return Bits.Kind == Overloaded
? reinterpret_cast<OverloadedTemplateStorage *>(this) ? reinterpret_cast<OverloadedTemplateStorage *>(this)
: nullptr; : nullptr;
} }
SubstTemplateTemplateParmStorage *getAsSubstTemplateTemplateParm() { SubstTemplateTemplateParmStorage *getAsSubstTemplateTemplateParm() {
return Bits.Kind == SubstTemplateTemplateParm return Bits.Kind == SubstTemplateTemplateParm
? reinterpret_cast<SubstTemplateTemplateParmStorage *>(this) ? reinterpret_cast<SubstTemplateTemplateParmStorage *>(this)
@ -89,13 +89,13 @@ public:
: nullptr; : nullptr;
} }
}; };
/// A structure for storing the information associated with an /// A structure for storing the information associated with an
/// overloaded template name. /// overloaded template name.
class OverloadedTemplateStorage : public UncommonTemplateNameStorage { class OverloadedTemplateStorage : public UncommonTemplateNameStorage {
friend class ASTContext; friend class ASTContext;
OverloadedTemplateStorage(unsigned size) OverloadedTemplateStorage(unsigned size)
: UncommonTemplateNameStorage(Overloaded, size) {} : UncommonTemplateNameStorage(Overloaded, size) {}
NamedDecl **getStorage() { NamedDecl **getStorage() {
@ -115,7 +115,7 @@ public:
/// A structure for storing an already-substituted template template /// A structure for storing an already-substituted template template
/// parameter pack. /// parameter pack.
/// ///
/// This kind of template names occurs when the parameter pack has been /// This kind of template names occurs when the parameter pack has been
/// provided with a template template argument pack in a context where its /// provided with a template template argument pack in a context where its
/// enclosing pack expansion could not be fully expanded. /// enclosing pack expansion could not be fully expanded.
class SubstTemplateTemplateParmPackStorage class SubstTemplateTemplateParmPackStorage
@ -123,25 +123,25 @@ class SubstTemplateTemplateParmPackStorage
{ {
TemplateTemplateParmDecl *Parameter; TemplateTemplateParmDecl *Parameter;
const TemplateArgument *Arguments; const TemplateArgument *Arguments;
public: public:
SubstTemplateTemplateParmPackStorage(TemplateTemplateParmDecl *Parameter, SubstTemplateTemplateParmPackStorage(TemplateTemplateParmDecl *Parameter,
unsigned Size, unsigned Size,
const TemplateArgument *Arguments) const TemplateArgument *Arguments)
: UncommonTemplateNameStorage(SubstTemplateTemplateParmPack, Size), : UncommonTemplateNameStorage(SubstTemplateTemplateParmPack, Size),
Parameter(Parameter), Arguments(Arguments) {} Parameter(Parameter), Arguments(Arguments) {}
/// Retrieve the template template parameter pack being substituted. /// Retrieve the template template parameter pack being substituted.
TemplateTemplateParmDecl *getParameterPack() const { TemplateTemplateParmDecl *getParameterPack() const {
return Parameter; return Parameter;
} }
/// Retrieve the template template argument pack with which this /// Retrieve the template template argument pack with which this
/// parameter was substituted. /// parameter was substituted.
TemplateArgument getArgumentPack() const; TemplateArgument getArgumentPack() const;
void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context); void Profile(llvm::FoldingSetNodeID &ID, ASTContext &Context);
static void Profile(llvm::FoldingSetNodeID &ID, static void Profile(llvm::FoldingSetNodeID &ID,
ASTContext &Context, ASTContext &Context,
TemplateTemplateParmDecl *Parameter, TemplateTemplateParmDecl *Parameter,
@ -193,11 +193,11 @@ public:
/// A set of overloaded template declarations. /// A set of overloaded template declarations.
OverloadedTemplate, OverloadedTemplate,
/// A qualified template name, where the qualification is kept /// A qualified template name, where the qualification is kept
/// to describe the source code as written. /// to describe the source code as written.
QualifiedTemplate, QualifiedTemplate,
/// A dependent template name that has not been resolved to a /// A dependent template name that has not been resolved to a
/// template (or set of templates). /// template (or set of templates).
DependentTemplate, DependentTemplate,
@ -205,7 +205,7 @@ public:
/// for some other template name. /// for some other template name.
SubstTemplateTemplateParm, SubstTemplateTemplateParm,
/// A template template parameter pack that has been substituted for /// A template template parameter pack that has been substituted for
/// a template template argument pack, but has not yet been expanded into /// a template template argument pack, but has not yet been expanded into
/// individual arguments. /// individual arguments.
SubstTemplateTemplateParmPack SubstTemplateTemplateParmPack
@ -221,7 +221,7 @@ public:
/// Determine whether this template name is NULL. /// Determine whether this template name is NULL.
bool isNull() const; bool isNull() const;
// Get the kind of name that is actually stored. // Get the kind of name that is actually stored.
NameKind getKind() const; NameKind getKind() const;
@ -243,14 +243,14 @@ public:
/// refers to a single template, returns NULL. /// refers to a single template, returns NULL.
OverloadedTemplateStorage *getAsOverloadedTemplate() const; OverloadedTemplateStorage *getAsOverloadedTemplate() const;
/// Retrieve the substituted template template parameter, if /// Retrieve the substituted template template parameter, if
/// known. /// known.
/// ///
/// \returns The storage for the substituted template template parameter, /// \returns The storage for the substituted template template parameter,
/// if known. Otherwise, returns NULL. /// if known. Otherwise, returns NULL.
SubstTemplateTemplateParmStorage *getAsSubstTemplateTemplateParm() const; SubstTemplateTemplateParmStorage *getAsSubstTemplateTemplateParm() const;
/// Retrieve the substituted template template parameter pack, if /// Retrieve the substituted template template parameter pack, if
/// known. /// known.
/// ///
/// \returns The storage for the substituted template template parameter pack, /// \returns The storage for the substituted template template parameter pack,
@ -339,7 +339,7 @@ public:
TemplateName getReplacement() const { return Replacement; } TemplateName getReplacement() const { return Replacement; }
void Profile(llvm::FoldingSetNodeID &ID); void Profile(llvm::FoldingSetNodeID &ID);
static void Profile(llvm::FoldingSetNodeID &ID, static void Profile(llvm::FoldingSetNodeID &ID,
TemplateTemplateParmDecl *parameter, TemplateTemplateParmDecl *parameter,
TemplateName replacement); TemplateName replacement);
@ -436,7 +436,7 @@ class DependentTemplateName : public llvm::FoldingSetNode {
/// ///
/// Only valid when the bit on \c Qualifier is clear. /// Only valid when the bit on \c Qualifier is clear.
const IdentifierInfo *Identifier; const IdentifierInfo *Identifier;
/// The overloaded operator name. /// The overloaded operator name.
/// ///
/// Only valid when the bit on \c Qualifier is set. /// Only valid when the bit on \c Qualifier is set.
@ -453,26 +453,26 @@ class DependentTemplateName : public llvm::FoldingSetNode {
DependentTemplateName(NestedNameSpecifier *Qualifier, DependentTemplateName(NestedNameSpecifier *Qualifier,
const IdentifierInfo *Identifier) const IdentifierInfo *Identifier)
: Qualifier(Qualifier, false), Identifier(Identifier), : Qualifier(Qualifier, false), Identifier(Identifier),
CanonicalTemplateName(this) {} CanonicalTemplateName(this) {}
DependentTemplateName(NestedNameSpecifier *Qualifier, DependentTemplateName(NestedNameSpecifier *Qualifier,
const IdentifierInfo *Identifier, const IdentifierInfo *Identifier,
TemplateName Canon) TemplateName Canon)
: Qualifier(Qualifier, false), Identifier(Identifier), : Qualifier(Qualifier, false), Identifier(Identifier),
CanonicalTemplateName(Canon) {} CanonicalTemplateName(Canon) {}
DependentTemplateName(NestedNameSpecifier *Qualifier, DependentTemplateName(NestedNameSpecifier *Qualifier,
OverloadedOperatorKind Operator) OverloadedOperatorKind Operator)
: Qualifier(Qualifier, true), Operator(Operator), : Qualifier(Qualifier, true), Operator(Operator),
CanonicalTemplateName(this) {} CanonicalTemplateName(this) {}
DependentTemplateName(NestedNameSpecifier *Qualifier, DependentTemplateName(NestedNameSpecifier *Qualifier,
OverloadedOperatorKind Operator, OverloadedOperatorKind Operator,
TemplateName Canon) TemplateName Canon)
: Qualifier(Qualifier, true), Operator(Operator), : Qualifier(Qualifier, true), Operator(Operator),
CanonicalTemplateName(Canon) {} CanonicalTemplateName(Canon) {}
public: public:
/// Return the nested name specifier that qualifies this name. /// Return the nested name specifier that qualifies this name.
NestedNameSpecifier *getQualifier() const { return Qualifier.getPointer(); } NestedNameSpecifier *getQualifier() const { return Qualifier.getPointer(); }
@ -481,22 +481,22 @@ public:
bool isIdentifier() const { return !Qualifier.getInt(); } bool isIdentifier() const { return !Qualifier.getInt(); }
/// Returns the identifier to which this template name refers. /// Returns the identifier to which this template name refers.
const IdentifierInfo *getIdentifier() const { const IdentifierInfo *getIdentifier() const {
assert(isIdentifier() && "Template name isn't an identifier?"); assert(isIdentifier() && "Template name isn't an identifier?");
return Identifier; return Identifier;
} }
/// Determine whether this template name refers to an overloaded /// Determine whether this template name refers to an overloaded
/// operator. /// operator.
bool isOverloadedOperator() const { return Qualifier.getInt(); } bool isOverloadedOperator() const { return Qualifier.getInt(); }
/// Return the overloaded operator to which this template name refers. /// Return the overloaded operator to which this template name refers.
OverloadedOperatorKind getOperator() const { OverloadedOperatorKind getOperator() const {
assert(isOverloadedOperator() && assert(isOverloadedOperator() &&
"Template name isn't an overloaded operator?"); "Template name isn't an overloaded operator?");
return Operator; return Operator;
} }
void Profile(llvm::FoldingSetNodeID &ID) { void Profile(llvm::FoldingSetNodeID &ID) {
if (isIdentifier()) if (isIdentifier())
Profile(ID, getQualifier(), getIdentifier()); Profile(ID, getQualifier(), getIdentifier());

View File

@ -992,7 +992,7 @@ public:
static std::string getAsString(const Type *ty, Qualifiers qs, static std::string getAsString(const Type *ty, Qualifiers qs,
const PrintingPolicy &Policy); const PrintingPolicy &Policy);
std::string getAsString() const; std::string getAsString() const;
std::string getAsString(const PrintingPolicy &Policy) const; std::string getAsString(const PrintingPolicy &Policy) const;
void print(raw_ostream &OS, const PrintingPolicy &Policy, void print(raw_ostream &OS, const PrintingPolicy &Policy,
@ -2929,7 +2929,7 @@ public:
}; };
/// Represents an extended address space qualifier where the input address space /// Represents an extended address space qualifier where the input address space
/// value is dependent. Non-dependent address spaces are not represented with a /// value is dependent. Non-dependent address spaces are not represented with a
/// special Type subclass; they are stored on an ExtQuals node as part of a QualType. /// special Type subclass; they are stored on an ExtQuals node as part of a QualType.
/// ///
/// For example: /// For example:
@ -2948,7 +2948,7 @@ class DependentAddressSpaceType : public Type, public llvm::FoldingSetNode {
SourceLocation loc; SourceLocation loc;
DependentAddressSpaceType(const ASTContext &Context, QualType PointeeType, DependentAddressSpaceType(const ASTContext &Context, QualType PointeeType,
QualType can, Expr *AddrSpaceExpr, QualType can, Expr *AddrSpaceExpr,
SourceLocation loc); SourceLocation loc);
public: public:
@ -3267,7 +3267,7 @@ public:
Bits = ((unsigned)cc) | (noReturn ? NoReturnMask : 0) | Bits = ((unsigned)cc) | (noReturn ? NoReturnMask : 0) |
(producesResult ? ProducesResultMask : 0) | (producesResult ? ProducesResultMask : 0) |
(noCallerSavedRegs ? NoCallerSavedRegsMask : 0) | (noCallerSavedRegs ? NoCallerSavedRegsMask : 0) |
(hasRegParm ? ((regParm + 1) << RegParmOffset) : 0) | (hasRegParm ? ((regParm + 1) << RegParmOffset) : 0) |
(NoCfCheck ? NoCfCheckMask : 0); (NoCfCheck ? NoCfCheckMask : 0);
} }
@ -5339,7 +5339,7 @@ public:
/// with base C and no protocols. /// with base C and no protocols.
/// ///
/// 'C<P>' is an unspecialized ObjCObjectType with base C and protocol list [P]. /// 'C<P>' is an unspecialized ObjCObjectType with base C and protocol list [P].
/// 'C<C*>' is a specialized ObjCObjectType with type arguments 'C*' and no /// 'C<C*>' is a specialized ObjCObjectType with type arguments 'C*' and no
/// protocol list. /// protocol list.
/// 'C<C*><P>' is a specialized ObjCObjectType with base C, type arguments 'C*', /// 'C<C*><P>' is a specialized ObjCObjectType with base C, type arguments 'C*',
/// and protocol list [P]. /// and protocol list [P].
@ -5971,7 +5971,7 @@ inline QualType QualType::getUnqualifiedType() const {
return QualType(getSplitUnqualifiedTypeImpl(*this).Ty, 0); return QualType(getSplitUnqualifiedTypeImpl(*this).Ty, 0);
} }
inline SplitQualType QualType::getSplitUnqualifiedType() const { inline SplitQualType QualType::getSplitUnqualifiedType() const {
if (!getTypePtr()->getCanonicalTypeInternal().hasLocalQualifiers()) if (!getTypePtr()->getCanonicalTypeInternal().hasLocalQualifiers())
return split(); return split();
@ -6446,7 +6446,7 @@ inline bool Type::isIntegralOrEnumerationType() const {
if (const auto *ET = dyn_cast<EnumType>(CanonicalType)) if (const auto *ET = dyn_cast<EnumType>(CanonicalType))
return IsEnumDeclComplete(ET->getDecl()); return IsEnumDeclComplete(ET->getDecl());
return false; return false;
} }
inline bool Type::isBooleanType() const { inline bool Type::isBooleanType() const {

View File

@ -992,7 +992,7 @@ class ObjCObjectTypeLoc : public ConcreteTypeLoc<UnqualTypeLoc,
return (TypeSourceInfo**)this->getExtraLocalData(); return (TypeSourceInfo**)this->getExtraLocalData();
} }
// SourceLocations are stored after the type argument information, one for // SourceLocations are stored after the type argument information, one for
// each Protocol. // each Protocol.
SourceLocation *getProtocolLocArray() const { SourceLocation *getProtocolLocArray() const {
return (SourceLocation*)(getTypeArgLocArray() + getNumTypeArgs()); return (SourceLocation*)(getTypeArgLocArray() + getNumTypeArgs());
@ -1131,11 +1131,11 @@ public:
void setNameLoc(SourceLocation Loc) { void setNameLoc(SourceLocation Loc) {
getLocalData()->NameLoc = Loc; getLocalData()->NameLoc = Loc;
} }
SourceRange getLocalSourceRange() const { SourceRange getLocalSourceRange() const {
return SourceRange(getNameLoc(), getNameEndLoc()); return SourceRange(getNameLoc(), getNameEndLoc());
} }
SourceLocation getNameEndLoc() const { SourceLocation getNameEndLoc() const {
return getLocalData()->NameEndLoc; return getLocalData()->NameEndLoc;
} }
@ -1766,10 +1766,10 @@ public:
return range; return range;
} }
/// Returns the type before the address space attribute application /// Returns the type before the address space attribute application
/// area. /// area.
/// int * __attribute__((address_space(11))) * /// int * __attribute__((address_space(11))) *
/// ^ ^ /// ^ ^
QualType getInnerType() const { QualType getInnerType() const {
return this->getTypePtr()->getPointeeType(); return this->getTypePtr()->getPointeeType();
} }

View File

@ -56,20 +56,20 @@ namespace llvm {
}; };
template<> struct DenseMapInfo<clang::CanQualType> { template<> struct DenseMapInfo<clang::CanQualType> {
static inline clang::CanQualType getEmptyKey() { static inline clang::CanQualType getEmptyKey() {
return clang::CanQualType(); return clang::CanQualType();
} }
static inline clang::CanQualType getTombstoneKey() { static inline clang::CanQualType getTombstoneKey() {
using clang::CanQualType; using clang::CanQualType;
return CanQualType::getFromOpaquePtr(reinterpret_cast<clang::Type *>(-1)); return CanQualType::getFromOpaquePtr(reinterpret_cast<clang::Type *>(-1));
} }
static unsigned getHashValue(clang::CanQualType Val) { static unsigned getHashValue(clang::CanQualType Val) {
return (unsigned)((uintptr_t)Val.getAsOpaquePtr()) ^ return (unsigned)((uintptr_t)Val.getAsOpaquePtr()) ^
((unsigned)((uintptr_t)Val.getAsOpaquePtr() >> 9)); ((unsigned)((uintptr_t)Val.getAsOpaquePtr() >> 9));
} }
static bool isEqual(clang::CanQualType LHS, clang::CanQualType RHS) { static bool isEqual(clang::CanQualType LHS, clang::CanQualType RHS) {
return LHS == RHS; return LHS == RHS;
} }

View File

@ -146,7 +146,7 @@ template <unsigned InlineCapacity> class UnresolvedSet :
SmallVector<DeclAccessPair, InlineCapacity> Decls; SmallVector<DeclAccessPair, InlineCapacity> Decls;
}; };
} // namespace clang } // namespace clang
#endif // LLVM_CLANG_AST_UNRESOLVEDSET_H #endif // LLVM_CLANG_AST_UNRESOLVEDSET_H

View File

@ -76,15 +76,15 @@ class VTTBuilder {
const CXXRecordDecl *MostDerivedClass; const CXXRecordDecl *MostDerivedClass;
using VTTVTablesVectorTy = SmallVector<VTTVTable, 64>; using VTTVTablesVectorTy = SmallVector<VTTVTable, 64>;
/// The VTT vtables. /// The VTT vtables.
VTTVTablesVectorTy VTTVTables; VTTVTablesVectorTy VTTVTables;
using VTTComponentsVectorTy = SmallVector<VTTComponent, 64>; using VTTComponentsVectorTy = SmallVector<VTTComponent, 64>;
/// The VTT components. /// The VTT components.
VTTComponentsVectorTy VTTComponents; VTTComponentsVectorTy VTTComponents;
/// The AST record layout of the most derived class. /// The AST record layout of the most derived class.
const ASTRecordLayout &MostDerivedClassLayout; const ASTRecordLayout &MostDerivedClassLayout;
@ -105,35 +105,35 @@ class VTTBuilder {
/// Add a vtable pointer to the VTT currently being built. /// Add a vtable pointer to the VTT currently being built.
void AddVTablePointer(BaseSubobject Base, uint64_t VTableIndex, void AddVTablePointer(BaseSubobject Base, uint64_t VTableIndex,
const CXXRecordDecl *VTableClass); const CXXRecordDecl *VTableClass);
/// Lay out the secondary VTTs of the given base subobject. /// Lay out the secondary VTTs of the given base subobject.
void LayoutSecondaryVTTs(BaseSubobject Base); void LayoutSecondaryVTTs(BaseSubobject Base);
/// Lay out the secondary virtual pointers for the given base /// Lay out the secondary virtual pointers for the given base
/// subobject. /// subobject.
/// ///
/// \param BaseIsMorallyVirtual whether the base subobject is a virtual base /// \param BaseIsMorallyVirtual whether the base subobject is a virtual base
/// or a direct or indirect base of a virtual base. /// or a direct or indirect base of a virtual base.
void LayoutSecondaryVirtualPointers(BaseSubobject Base, void LayoutSecondaryVirtualPointers(BaseSubobject Base,
bool BaseIsMorallyVirtual, bool BaseIsMorallyVirtual,
uint64_t VTableIndex, uint64_t VTableIndex,
const CXXRecordDecl *VTableClass, const CXXRecordDecl *VTableClass,
VisitedVirtualBasesSetTy &VBases); VisitedVirtualBasesSetTy &VBases);
/// Lay out the secondary virtual pointers for the given base /// Lay out the secondary virtual pointers for the given base
/// subobject. /// subobject.
void LayoutSecondaryVirtualPointers(BaseSubobject Base, void LayoutSecondaryVirtualPointers(BaseSubobject Base,
uint64_t VTableIndex); uint64_t VTableIndex);
/// Lay out the VTTs for the virtual base classes of the given /// Lay out the VTTs for the virtual base classes of the given
/// record declaration. /// record declaration.
void LayoutVirtualVTTs(const CXXRecordDecl *RD, void LayoutVirtualVTTs(const CXXRecordDecl *RD,
VisitedVirtualBasesSetTy &VBases); VisitedVirtualBasesSetTy &VBases);
/// Lay out the VTT for the given subobject, including any /// Lay out the VTT for the given subobject, including any
/// secondary VTTs, secondary virtual pointers and virtual VTTs. /// secondary VTTs, secondary virtual pointers and virtual VTTs.
void LayoutVTT(BaseSubobject Base, bool BaseIsVirtual); void LayoutVTT(BaseSubobject Base, bool BaseIsVirtual);
public: public:
VTTBuilder(ASTContext &Ctx, const CXXRecordDecl *MostDerivedClass, VTTBuilder(ASTContext &Ctx, const CXXRecordDecl *MostDerivedClass,
bool GenerateDefinition); bool GenerateDefinition);
@ -142,17 +142,17 @@ public:
const VTTComponentsVectorTy &getVTTComponents() const { const VTTComponentsVectorTy &getVTTComponents() const {
return VTTComponents; return VTTComponents;
} }
// Returns a reference to the VTT vtables. // Returns a reference to the VTT vtables.
const VTTVTablesVectorTy &getVTTVTables() const { const VTTVTablesVectorTy &getVTTVTables() const {
return VTTVTables; return VTTVTables;
} }
/// Returns a reference to the sub-VTT indices. /// Returns a reference to the sub-VTT indices.
const llvm::DenseMap<BaseSubobject, uint64_t> &getSubVTTIndicies() const { const llvm::DenseMap<BaseSubobject, uint64_t> &getSubVTTIndicies() const {
return SubVTTIndicies; return SubVTTIndicies;
} }
/// Returns a reference to the secondary virtual pointer indices. /// Returns a reference to the secondary virtual pointer indices.
const llvm::DenseMap<BaseSubobject, uint64_t> & const llvm::DenseMap<BaseSubobject, uint64_t> &
getSecondaryVirtualPointerIndices() const { getSecondaryVirtualPointerIndices() const {

View File

@ -394,7 +394,7 @@ public:
/// Return the offset in chars (relative to the vtable address point) where /// Return the offset in chars (relative to the vtable address point) where
/// the offset of the virtual base that contains the given base is stored, /// the offset of the virtual base that contains the given base is stored,
/// otherwise, if no virtual base contains the given class, return 0. /// otherwise, if no virtual base contains the given class, return 0.
/// ///
/// Base must be a virtual base class or an unambiguous base. /// Base must be a virtual base class or an unambiguous base.
CharUnits getVirtualBaseOffsetOffset(const CXXRecordDecl *RD, CharUnits getVirtualBaseOffsetOffset(const CXXRecordDecl *RD,

View File

@ -1247,7 +1247,7 @@ extern const internal::VariadicDynCastAllOfMatcher<Decl, ObjCMethodDecl>
objcMethodDecl; objcMethodDecl;
/// Matches block declarations. /// Matches block declarations.
/// ///
/// Example matches the declaration of the nameless block printing an input /// Example matches the declaration of the nameless block printing an input
/// integer. /// integer.
/// ///
@ -2885,7 +2885,7 @@ AST_MATCHER(ObjCMessageExpr, hasKeywordSelector) {
AST_MATCHER_P(ObjCMessageExpr, numSelectorArgs, unsigned, N) { AST_MATCHER_P(ObjCMessageExpr, numSelectorArgs, unsigned, N) {
return Node.getSelector().getNumArgs() == N; return Node.getSelector().getNumArgs() == N;
} }
/// Matches if the call expression's callee expression matches. /// Matches if the call expression's callee expression matches.
/// ///
/// Given /// Given
@ -3678,7 +3678,7 @@ AST_POLYMORPHIC_MATCHER_P2(forEachArgumentWithParam,
/// \code /// \code
/// b = ^(int y) { printf("%d", y) }; /// b = ^(int y) { printf("%d", y) };
/// \endcode /// \endcode
/// ///
/// the matcher blockDecl(hasAnyParameter(hasName("y"))) /// the matcher blockDecl(hasAnyParameter(hasName("y")))
/// matches the declaration of the block b with hasParameter /// matches the declaration of the block b with hasParameter
/// matching y. /// matching y.
@ -5140,7 +5140,7 @@ extern const AstTypeMatcher<AutoType> autoType;
/// int j = 42; /// int j = 42;
/// decltype(i + j) result = i + j; /// decltype(i + j) result = i + j;
/// \endcode /// \endcode
/// decltypeType() /// decltypeType()
/// matches "decltype(i + j)" /// matches "decltype(i + j)"
extern const AstTypeMatcher<DecltypeType> decltypeType; extern const AstTypeMatcher<DecltypeType> decltypeType;
@ -6047,8 +6047,8 @@ AST_MATCHER(NamedDecl, hasExternalFormalLinkage) {
/// void x(int val) {} /// void x(int val) {}
/// void y(int val = 0) {} /// void y(int val = 0) {}
/// \endcode /// \endcode
AST_MATCHER(ParmVarDecl, hasDefaultArgument) { AST_MATCHER(ParmVarDecl, hasDefaultArgument) {
return Node.hasDefaultArg(); return Node.hasDefaultArg();
} }
/// Matches array new expressions. /// Matches array new expressions.

View File

@ -38,18 +38,18 @@ class Stmt;
class VarDecl; class VarDecl;
namespace consumed { namespace consumed {
class ConsumedStmtVisitor; class ConsumedStmtVisitor;
enum ConsumedState { enum ConsumedState {
// No state information for the given variable. // No state information for the given variable.
CS_None, CS_None,
CS_Unknown, CS_Unknown,
CS_Unconsumed, CS_Unconsumed,
CS_Consumed CS_Consumed
}; };
using OptionalNotes = SmallVector<PartialDiagnosticAt, 1>; using OptionalNotes = SmallVector<PartialDiagnosticAt, 1>;
using DelayedDiag = std::pair<PartialDiagnosticAt, OptionalNotes>; using DelayedDiag = std::pair<PartialDiagnosticAt, OptionalNotes>;
using DiagList = std::list<DelayedDiag>; using DiagList = std::list<DelayedDiag>;
@ -60,7 +60,7 @@ namespace consumed {
/// Emit the warnings and notes left by the analysis. /// Emit the warnings and notes left by the analysis.
virtual void emitDiagnostics() {} virtual void emitDiagnostics() {}
/// Warn that a variable's state doesn't match at the entry and exit /// Warn that a variable's state doesn't match at the entry and exit
/// of a loop. /// of a loop.
/// ///
@ -70,7 +70,7 @@ namespace consumed {
/// state. /// state.
virtual void warnLoopStateMismatch(SourceLocation Loc, virtual void warnLoopStateMismatch(SourceLocation Loc,
StringRef VariableName) {} StringRef VariableName) {}
/// Warn about parameter typestate mismatches upon return. /// Warn about parameter typestate mismatches upon return.
/// ///
/// \param Loc -- The SourceLocation of the return statement. /// \param Loc -- The SourceLocation of the return statement.
@ -84,22 +84,22 @@ namespace consumed {
StringRef VariableName, StringRef VariableName,
StringRef ExpectedState, StringRef ExpectedState,
StringRef ObservedState) {} StringRef ObservedState) {}
// FIXME: Add documentation. // FIXME: Add documentation.
virtual void warnParamTypestateMismatch(SourceLocation LOC, virtual void warnParamTypestateMismatch(SourceLocation LOC,
StringRef ExpectedState, StringRef ExpectedState,
StringRef ObservedState) {} StringRef ObservedState) {}
// FIXME: This can be removed when the attr propagation fix for templated // FIXME: This can be removed when the attr propagation fix for templated
// classes lands. // classes lands.
/// Warn about return typestates set for unconsumable types. /// Warn about return typestates set for unconsumable types.
/// ///
/// \param Loc -- The location of the attributes. /// \param Loc -- The location of the attributes.
/// ///
/// \param TypeName -- The name of the unconsumable type. /// \param TypeName -- The name of the unconsumable type.
virtual void warnReturnTypestateForUnconsumableType(SourceLocation Loc, virtual void warnReturnTypestateForUnconsumableType(SourceLocation Loc,
StringRef TypeName) {} StringRef TypeName) {}
/// Warn about return typestate mismatches. /// Warn about return typestate mismatches.
/// ///
/// \param Loc -- The SourceLocation of the return statement. /// \param Loc -- The SourceLocation of the return statement.
@ -144,71 +144,71 @@ namespace consumed {
using VarMapType = llvm::DenseMap<const VarDecl *, ConsumedState>; using VarMapType = llvm::DenseMap<const VarDecl *, ConsumedState>;
using TmpMapType = using TmpMapType =
llvm::DenseMap<const CXXBindTemporaryExpr *, ConsumedState>; llvm::DenseMap<const CXXBindTemporaryExpr *, ConsumedState>;
protected: protected:
bool Reachable = true; bool Reachable = true;
const Stmt *From = nullptr; const Stmt *From = nullptr;
VarMapType VarMap; VarMapType VarMap;
TmpMapType TmpMap; TmpMapType TmpMap;
public: public:
ConsumedStateMap() = default; ConsumedStateMap() = default;
ConsumedStateMap(const ConsumedStateMap &Other) ConsumedStateMap(const ConsumedStateMap &Other)
: Reachable(Other.Reachable), From(Other.From), VarMap(Other.VarMap), : Reachable(Other.Reachable), From(Other.From), VarMap(Other.VarMap),
TmpMap() {} TmpMap() {}
/// Warn if any of the parameters being tracked are not in the state /// Warn if any of the parameters being tracked are not in the state
/// they were declared to be in upon return from a function. /// they were declared to be in upon return from a function.
void checkParamsForReturnTypestate(SourceLocation BlameLoc, void checkParamsForReturnTypestate(SourceLocation BlameLoc,
ConsumedWarningsHandlerBase &WarningsHandler) const; ConsumedWarningsHandlerBase &WarningsHandler) const;
/// Clear the TmpMap. /// Clear the TmpMap.
void clearTemporaries(); void clearTemporaries();
/// Get the consumed state of a given variable. /// Get the consumed state of a given variable.
ConsumedState getState(const VarDecl *Var) const; ConsumedState getState(const VarDecl *Var) const;
/// Get the consumed state of a given temporary value. /// Get the consumed state of a given temporary value.
ConsumedState getState(const CXXBindTemporaryExpr *Tmp) const; ConsumedState getState(const CXXBindTemporaryExpr *Tmp) const;
/// Merge this state map with another map. /// Merge this state map with another map.
void intersect(const ConsumedStateMap &Other); void intersect(const ConsumedStateMap &Other);
void intersectAtLoopHead(const CFGBlock *LoopHead, const CFGBlock *LoopBack, void intersectAtLoopHead(const CFGBlock *LoopHead, const CFGBlock *LoopBack,
const ConsumedStateMap *LoopBackStates, const ConsumedStateMap *LoopBackStates,
ConsumedWarningsHandlerBase &WarningsHandler); ConsumedWarningsHandlerBase &WarningsHandler);
/// Return true if this block is reachable. /// Return true if this block is reachable.
bool isReachable() const { return Reachable; } bool isReachable() const { return Reachable; }
/// Mark the block as unreachable. /// Mark the block as unreachable.
void markUnreachable(); void markUnreachable();
/// Set the source for a decision about the branching of states. /// Set the source for a decision about the branching of states.
/// \param Source -- The statement that was the origin of a branching /// \param Source -- The statement that was the origin of a branching
/// decision. /// decision.
void setSource(const Stmt *Source) { this->From = Source; } void setSource(const Stmt *Source) { this->From = Source; }
/// Set the consumed state of a given variable. /// Set the consumed state of a given variable.
void setState(const VarDecl *Var, ConsumedState State); void setState(const VarDecl *Var, ConsumedState State);
/// Set the consumed state of a given temporary value. /// Set the consumed state of a given temporary value.
void setState(const CXXBindTemporaryExpr *Tmp, ConsumedState State); void setState(const CXXBindTemporaryExpr *Tmp, ConsumedState State);
/// Remove the temporary value from our state map. /// Remove the temporary value from our state map.
void remove(const CXXBindTemporaryExpr *Tmp); void remove(const CXXBindTemporaryExpr *Tmp);
/// Tests to see if there is a mismatch in the states stored in two /// Tests to see if there is a mismatch in the states stored in two
/// maps. /// maps.
/// ///
/// \param Other -- The second map to compare against. /// \param Other -- The second map to compare against.
bool operator!=(const ConsumedStateMap *Other) const; bool operator!=(const ConsumedStateMap *Other) const;
}; };
class ConsumedBlockInfo { class ConsumedBlockInfo {
std::vector<std::unique_ptr<ConsumedStateMap>> StateMapsArray; std::vector<std::unique_ptr<ConsumedStateMap>> StateMapsArray;
std::vector<unsigned int> VisitOrder; std::vector<unsigned int> VisitOrder;
public: public:
ConsumedBlockInfo() = default; ConsumedBlockInfo() = default;
@ -218,7 +218,7 @@ namespace consumed {
for (const auto BI : *SortedGraph) for (const auto BI : *SortedGraph)
VisitOrder[BI->getBlockID()] = VisitOrderCounter++; VisitOrder[BI->getBlockID()] = VisitOrderCounter++;
} }
bool allBackEdgesVisited(const CFGBlock *CurrBlock, bool allBackEdgesVisited(const CFGBlock *CurrBlock,
const CFGBlock *TargetBlock); const CFGBlock *TargetBlock);
@ -228,7 +228,7 @@ namespace consumed {
std::unique_ptr<ConsumedStateMap> StateMap); std::unique_ptr<ConsumedStateMap> StateMap);
ConsumedStateMap* borrowInfo(const CFGBlock *Block); ConsumedStateMap* borrowInfo(const CFGBlock *Block);
void discardInfo(const CFGBlock *Block); void discardInfo(const CFGBlock *Block);
std::unique_ptr<ConsumedStateMap> getInfo(const CFGBlock *Block); std::unique_ptr<ConsumedStateMap> getInfo(const CFGBlock *Block);
@ -243,12 +243,12 @@ namespace consumed {
std::unique_ptr<ConsumedStateMap> CurrStates; std::unique_ptr<ConsumedStateMap> CurrStates;
ConsumedState ExpectedReturnState; ConsumedState ExpectedReturnState;
void determineExpectedReturnState(AnalysisDeclContext &AC, void determineExpectedReturnState(AnalysisDeclContext &AC,
const FunctionDecl *D); const FunctionDecl *D);
bool splitState(const CFGBlock *CurrBlock, bool splitState(const CFGBlock *CurrBlock,
const ConsumedStmtVisitor &Visitor); const ConsumedStmtVisitor &Visitor);
public: public:
ConsumedWarningsHandlerBase &WarningsHandler; ConsumedWarningsHandlerBase &WarningsHandler;
@ -256,7 +256,7 @@ namespace consumed {
: WarningsHandler(WarningsHandler) {} : WarningsHandler(WarningsHandler) {}
ConsumedState getExpectedReturnState() const { return ExpectedReturnState; } ConsumedState getExpectedReturnState() const { return ExpectedReturnState; }
/// Check a function's CFG for consumed violations. /// Check a function's CFG for consumed violations.
/// ///
/// We traverse the blocks in the CFG, keeping track of the state of each /// We traverse the blocks in the CFG, keeping track of the state of each

View File

@ -20,7 +20,7 @@
#include "llvm/ADT/GraphTraits.h" #include "llvm/ADT/GraphTraits.h"
#include "llvm/ADT/iterator.h" #include "llvm/ADT/iterator.h"
#include "llvm/Support/GenericDomTree.h" #include "llvm/Support/GenericDomTree.h"
#include "llvm/Support/GenericDomTreeConstruction.h" #include "llvm/Support/GenericDomTreeConstruction.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
// FIXME: There is no good reason for the domtree to require a print method // FIXME: There is no good reason for the domtree to require a print method

View File

@ -236,7 +236,7 @@ public:
const char *toString() const; const char *toString() const;
bool isPrintfKind() const { return IsPrintf; } bool isPrintfKind() const { return IsPrintf; }
Optional<ConversionSpecifier> getStandardSpecifier() const; Optional<ConversionSpecifier> getStandardSpecifier() const;
protected: protected:

View File

@ -25,7 +25,7 @@ class CFGBlock;
class Stmt; class Stmt;
class DeclRefExpr; class DeclRefExpr;
class SourceManager; class SourceManager;
class LiveVariables : public ManagedAnalysis { class LiveVariables : public ManagedAnalysis {
public: public:
class LivenessValues { class LivenessValues {
@ -34,7 +34,7 @@ public:
llvm::ImmutableSet<const Stmt *> liveStmts; llvm::ImmutableSet<const Stmt *> liveStmts;
llvm::ImmutableSet<const VarDecl *> liveDecls; llvm::ImmutableSet<const VarDecl *> liveDecls;
llvm::ImmutableSet<const BindingDecl *> liveBindings; llvm::ImmutableSet<const BindingDecl *> liveBindings;
bool equals(const LivenessValues &V) const; bool equals(const LivenessValues &V) const;
LivenessValues() LivenessValues()
@ -48,21 +48,21 @@ public:
bool isLive(const Stmt *S) const; bool isLive(const Stmt *S) const;
bool isLive(const VarDecl *D) const; bool isLive(const VarDecl *D) const;
friend class LiveVariables; friend class LiveVariables;
}; };
class Observer { class Observer {
virtual void anchor(); virtual void anchor();
public: public:
virtual ~Observer() {} virtual ~Observer() {}
/// A callback invoked right before invoking the /// A callback invoked right before invoking the
/// liveness transfer function on the given statement. /// liveness transfer function on the given statement.
virtual void observeStmt(const Stmt *S, virtual void observeStmt(const Stmt *S,
const CFGBlock *currentBlock, const CFGBlock *currentBlock,
const LivenessValues& V) {} const LivenessValues& V) {}
/// Called when the live variables analysis registers /// Called when the live variables analysis registers
/// that a variable is killed. /// that a variable is killed.
virtual void observerKill(const DeclRefExpr *DR) {} virtual void observerKill(const DeclRefExpr *DR) {}
@ -73,47 +73,47 @@ public:
/// Compute the liveness information for a given CFG. /// Compute the liveness information for a given CFG.
static LiveVariables *computeLiveness(AnalysisDeclContext &analysisContext, static LiveVariables *computeLiveness(AnalysisDeclContext &analysisContext,
bool killAtAssign); bool killAtAssign);
/// Return true if a variable is live at the end of a /// Return true if a variable is live at the end of a
/// specified block. /// specified block.
bool isLive(const CFGBlock *B, const VarDecl *D); bool isLive(const CFGBlock *B, const VarDecl *D);
/// Returns true if a variable is live at the beginning of the /// Returns true if a variable is live at the beginning of the
/// the statement. This query only works if liveness information /// the statement. This query only works if liveness information
/// has been recorded at the statement level (see runOnAllBlocks), and /// has been recorded at the statement level (see runOnAllBlocks), and
/// only returns liveness information for block-level expressions. /// only returns liveness information for block-level expressions.
bool isLive(const Stmt *S, const VarDecl *D); bool isLive(const Stmt *S, const VarDecl *D);
/// Returns true the block-level expression "value" is live /// Returns true the block-level expression "value" is live
/// before the given block-level expression (see runOnAllBlocks). /// before the given block-level expression (see runOnAllBlocks).
bool isLive(const Stmt *Loc, const Stmt *StmtVal); bool isLive(const Stmt *Loc, const Stmt *StmtVal);
/// Print to stderr the liveness information associated with /// Print to stderr the liveness information associated with
/// each basic block. /// each basic block.
void dumpBlockLiveness(const SourceManager& M); void dumpBlockLiveness(const SourceManager& M);
void runOnAllBlocks(Observer &obs); void runOnAllBlocks(Observer &obs);
static LiveVariables *create(AnalysisDeclContext &analysisContext) { static LiveVariables *create(AnalysisDeclContext &analysisContext) {
return computeLiveness(analysisContext, true); return computeLiveness(analysisContext, true);
} }
static const void *getTag(); static const void *getTag();
private: private:
LiveVariables(void *impl); LiveVariables(void *impl);
void *impl; void *impl;
}; };
class RelaxedLiveVariables : public LiveVariables { class RelaxedLiveVariables : public LiveVariables {
public: public:
static LiveVariables *create(AnalysisDeclContext &analysisContext) { static LiveVariables *create(AnalysisDeclContext &analysisContext) {
return computeLiveness(analysisContext, false); return computeLiveness(analysisContext, false);
} }
static const void *getTag(); static const void *getTag();
}; };
} // end namespace clang } // end namespace clang
#endif #endif

View File

@ -57,7 +57,7 @@ public:
}; };
/// ScanReachableFromBlock - Mark all blocks reachable from Start. /// ScanReachableFromBlock - Mark all blocks reachable from Start.
/// Returns the total number of blocks that were marked reachable. /// Returns the total number of blocks that were marked reachable.
unsigned ScanReachableFromBlock(const CFGBlock *Start, unsigned ScanReachableFromBlock(const CFGBlock *Start,
llvm::BitVector &Reachable); llvm::BitVector &Reachable);

View File

@ -500,7 +500,7 @@ private:
std::vector<til::BasicBlock *> BlockMap; std::vector<til::BasicBlock *> BlockMap;
// Extra information per BB. Indexed by clang BlockID. // Extra information per BB. Indexed by clang BlockID.
std::vector<BlockInfo> BBInfo; std::vector<BlockInfo> BBInfo;
LVarDefinitionMap CurrentLVarMap; LVarDefinitionMap CurrentLVarMap;
std::vector<til::Phi *> CurrentArguments; std::vector<til::Phi *> CurrentArguments;

View File

@ -111,7 +111,7 @@ public:
AnalysisDeclContextManager *getManager() const { AnalysisDeclContextManager *getManager() const {
return Manager; return Manager;
} }
/// Return the build options used to construct the CFG. /// Return the build options used to construct the CFG.
CFG::BuildOptions &getCFGBuildOptions() { CFG::BuildOptions &getCFGBuildOptions() {
return cfgBuildOptions; return cfgBuildOptions;
@ -190,7 +190,7 @@ public:
const Stmt *S, const Stmt *S,
const CFGBlock *Blk, const CFGBlock *Blk,
unsigned Idx); unsigned Idx);
const BlockInvocationContext * const BlockInvocationContext *
getBlockInvocationContext(const LocationContext *parent, getBlockInvocationContext(const LocationContext *parent,
const BlockDecl *BD, const BlockDecl *BD,
@ -359,7 +359,7 @@ class BlockInvocationContext : public LocationContext {
friend class LocationContextManager; friend class LocationContextManager;
const BlockDecl *BD; const BlockDecl *BD;
// FIXME: Come up with a more type-safe way to model context-sensitivity. // FIXME: Come up with a more type-safe way to model context-sensitivity.
const void *ContextData; const void *ContextData;
@ -372,7 +372,7 @@ public:
~BlockInvocationContext() override = default; ~BlockInvocationContext() override = default;
const BlockDecl *getBlockDecl() const { return BD; } const BlockDecl *getBlockDecl() const { return BD; }
const void *getContextData() const { return ContextData; } const void *getContextData() const { return ContextData; }
void Profile(llvm::FoldingSetNodeID &ID) override; void Profile(llvm::FoldingSetNodeID &ID) override;
@ -403,7 +403,7 @@ public:
const ScopeContext *getScope(AnalysisDeclContext *ctx, const ScopeContext *getScope(AnalysisDeclContext *ctx,
const LocationContext *parent, const LocationContext *parent,
const Stmt *s); const Stmt *s);
const BlockInvocationContext * const BlockInvocationContext *
getBlockInvocationContext(AnalysisDeclContext *ctx, getBlockInvocationContext(AnalysisDeclContext *ctx,
const LocationContext *parent, const LocationContext *parent,
@ -463,7 +463,7 @@ public:
CFG::BuildOptions &getCFGBuildOptions() { CFG::BuildOptions &getCFGBuildOptions() {
return cfgBuildOptions; return cfgBuildOptions;
} }
/// Return true if faux bodies should be synthesized for well-known /// Return true if faux bodies should be synthesized for well-known
/// functions. /// functions.
bool synthesizeBodies() const { return SynthesizeBodies; } bool synthesizeBodies() const { return SynthesizeBodies; }

View File

@ -332,7 +332,7 @@ struct FilenamePatternConstraint {
StringRef IgnoredFilesPattern; StringRef IgnoredFilesPattern;
std::shared_ptr<llvm::Regex> IgnoredFilesRegex; std::shared_ptr<llvm::Regex> IgnoredFilesRegex;
FilenamePatternConstraint(StringRef IgnoredFilesPattern) FilenamePatternConstraint(StringRef IgnoredFilesPattern)
: IgnoredFilesPattern(IgnoredFilesPattern) { : IgnoredFilesPattern(IgnoredFilesPattern) {
IgnoredFilesRegex = std::make_shared<llvm::Regex>("^(" + IgnoredFilesRegex = std::make_shared<llvm::Regex>("^(" +
IgnoredFilesPattern.str() + "$)"); IgnoredFilesPattern.str() + "$)");

View File

@ -7,7 +7,7 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
// //
// This file implements cocoa naming convention analysis. // This file implements cocoa naming convention analysis.
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
@ -20,20 +20,20 @@
namespace clang { namespace clang {
class FunctionDecl; class FunctionDecl;
class QualType; class QualType;
namespace ento { namespace ento {
namespace cocoa { namespace cocoa {
bool isRefType(QualType RetTy, StringRef Prefix, bool isRefType(QualType RetTy, StringRef Prefix,
StringRef Name = StringRef()); StringRef Name = StringRef());
bool isCocoaObjectRef(QualType T); bool isCocoaObjectRef(QualType T);
} }
namespace coreFoundation { namespace coreFoundation {
bool isCFObjectRef(QualType T); bool isCFObjectRef(QualType T);
bool followsCreateRule(const FunctionDecl *FD); bool followsCreateRule(const FunctionDecl *FD);
} }

View File

@ -21,7 +21,7 @@ namespace clang {
class ASTContext; class ASTContext;
class ObjCMessageExpr; class ObjCMessageExpr;
class ObjCNoReturn { class ObjCNoReturn {
/// Cached "raise" selector. /// Cached "raise" selector.
Selector RaiseSel; Selector RaiseSel;
@ -36,7 +36,7 @@ class ObjCNoReturn {
public: public:
ObjCNoReturn(ASTContext &C); ObjCNoReturn(ASTContext &C);
/// Return true if the given message expression is known to never /// Return true if the given message expression is known to never
/// return. /// return.
bool isImplicitNoReturn(const ObjCMessageExpr *ME); bool isImplicitNoReturn(const ObjCMessageExpr *ME);

View File

@ -33,7 +33,7 @@ namespace clang {
class AnalysisDeclContext; class AnalysisDeclContext;
class FunctionDecl; class FunctionDecl;
class LocationContext; class LocationContext;
/// ProgramPoints can be "tagged" as representing points specific to a given /// ProgramPoints can be "tagged" as representing points specific to a given
/// analysis entity. Tags are abstract annotations, with an associated /// analysis entity. Tags are abstract annotations, with an associated
/// description and potentially other information. /// description and potentially other information.
@ -41,12 +41,12 @@ class ProgramPointTag {
public: public:
ProgramPointTag(void *tagKind = nullptr) : TagKind(tagKind) {} ProgramPointTag(void *tagKind = nullptr) : TagKind(tagKind) {}
virtual ~ProgramPointTag(); virtual ~ProgramPointTag();
virtual StringRef getTagDescription() const = 0; virtual StringRef getTagDescription() const = 0;
protected: protected:
/// Used to implement 'isKind' in subclasses. /// Used to implement 'isKind' in subclasses.
const void *getTagKind() { return TagKind; } const void *getTagKind() { return TagKind; }
private: private:
const void *TagKind; const void *TagKind;
}; };
@ -111,7 +111,7 @@ protected:
assert(getLocationContext() == l); assert(getLocationContext() == l);
assert(getData1() == P); assert(getData1() == P);
} }
ProgramPoint(const void *P1, ProgramPoint(const void *P1,
const void *P2, const void *P2,
Kind k, Kind k,
@ -223,7 +223,7 @@ class BlockEntrance : public ProgramPoint {
public: public:
BlockEntrance(const CFGBlock *B, const LocationContext *L, BlockEntrance(const CFGBlock *B, const LocationContext *L,
const ProgramPointTag *tag = nullptr) const ProgramPointTag *tag = nullptr)
: ProgramPoint(B, BlockEntranceKind, L, tag) { : ProgramPoint(B, BlockEntranceKind, L, tag) {
assert(B && "BlockEntrance requires non-null block"); assert(B && "BlockEntrance requires non-null block");
} }
@ -235,7 +235,7 @@ public:
const CFGBlock *B = getBlock(); const CFGBlock *B = getBlock();
return B->empty() ? Optional<CFGElement>() : B->front(); return B->empty() ? Optional<CFGElement>() : B->front();
} }
private: private:
friend class ProgramPoint; friend class ProgramPoint;
BlockEntrance() = default; BlockEntrance() = default;
@ -350,7 +350,7 @@ protected:
LocationCheck(const Stmt *S, const LocationContext *L, LocationCheck(const Stmt *S, const LocationContext *L,
ProgramPoint::Kind K, const ProgramPointTag *tag) ProgramPoint::Kind K, const ProgramPointTag *tag)
: StmtPoint(S, nullptr, K, L, tag) {} : StmtPoint(S, nullptr, K, L, tag) {}
private: private:
friend class ProgramPoint; friend class ProgramPoint;
static bool isKind(const ProgramPoint &location) { static bool isKind(const ProgramPoint &location) {
@ -358,13 +358,13 @@ private:
return k == PreLoadKind || k == PreStoreKind; return k == PreLoadKind || k == PreStoreKind;
} }
}; };
class PreLoad : public LocationCheck { class PreLoad : public LocationCheck {
public: public:
PreLoad(const Stmt *S, const LocationContext *L, PreLoad(const Stmt *S, const LocationContext *L,
const ProgramPointTag *tag = nullptr) const ProgramPointTag *tag = nullptr)
: LocationCheck(S, L, PreLoadKind, tag) {} : LocationCheck(S, L, PreLoadKind, tag) {}
private: private:
friend class ProgramPoint; friend class ProgramPoint;
PreLoad() = default; PreLoad() = default;
@ -378,7 +378,7 @@ public:
PreStore(const Stmt *S, const LocationContext *L, PreStore(const Stmt *S, const LocationContext *L,
const ProgramPointTag *tag = nullptr) const ProgramPointTag *tag = nullptr)
: LocationCheck(S, L, PreStoreKind, tag) {} : LocationCheck(S, L, PreStoreKind, tag) {}
private: private:
friend class ProgramPoint; friend class ProgramPoint;
PreStore() = default; PreStore() = default;
@ -405,7 +405,7 @@ private:
class PostStore : public PostStmt { class PostStore : public PostStmt {
public: public:
/// Construct the post store point. /// Construct the post store point.
/// \param Loc can be used to store the information about the location /// \param Loc can be used to store the information about the location
/// used in the form it was uttered in the code. /// used in the form it was uttered in the code.
PostStore(const Stmt *S, const LocationContext *L, const void *Loc, PostStore(const Stmt *S, const LocationContext *L, const void *Loc,
const ProgramPointTag *tag = nullptr) const ProgramPointTag *tag = nullptr)
@ -479,7 +479,7 @@ public:
BlockEdge(const CFGBlock *B1, const CFGBlock *B2, const LocationContext *L) BlockEdge(const CFGBlock *B1, const CFGBlock *B2, const LocationContext *L)
: ProgramPoint(B1, B2, BlockEdgeKind, L) { : ProgramPoint(B1, B2, BlockEdgeKind, L) {
assert(B1 && "BlockEdge: source block must be non-null"); assert(B1 && "BlockEdge: source block must be non-null");
assert(B2 && "BlockEdge: destination block must be non-null"); assert(B2 && "BlockEdge: destination block must be non-null");
} }
const CFGBlock *getSrc() const { const CFGBlock *getSrc() const {
@ -603,7 +603,7 @@ private:
/// CallEnter uses the caller's location context. /// CallEnter uses the caller's location context.
class CallEnter : public ProgramPoint { class CallEnter : public ProgramPoint {
public: public:
CallEnter(const Stmt *stmt, const StackFrameContext *calleeCtx, CallEnter(const Stmt *stmt, const StackFrameContext *calleeCtx,
const LocationContext *callerCtx) const LocationContext *callerCtx)
: ProgramPoint(stmt, calleeCtx, CallEnterKind, callerCtx, nullptr) {} : ProgramPoint(stmt, calleeCtx, CallEnterKind, callerCtx, nullptr) {}
@ -749,7 +749,7 @@ static bool isEqual(const clang::ProgramPoint &L,
} }
}; };
template <> template <>
struct isPodLike<clang::ProgramPoint> { static const bool value = true; }; struct isPodLike<clang::ProgramPoint> { static const bool value = true; };

View File

@ -29,7 +29,7 @@
#include <type_traits> #include <type_traits>
namespace clang { namespace clang {
class BumpVectorContext { class BumpVectorContext {
llvm::PointerIntPair<llvm::BumpPtrAllocator*, 1> Alloc; llvm::PointerIntPair<llvm::BumpPtrAllocator*, 1> Alloc;
@ -47,15 +47,15 @@ public:
/// BumpPtrAllocator. This BumpPtrAllocator is not destroyed when the /// BumpPtrAllocator. This BumpPtrAllocator is not destroyed when the
/// BumpVectorContext object is destroyed. /// BumpVectorContext object is destroyed.
BumpVectorContext(llvm::BumpPtrAllocator &A) : Alloc(&A, 0) {} BumpVectorContext(llvm::BumpPtrAllocator &A) : Alloc(&A, 0) {}
~BumpVectorContext() { ~BumpVectorContext() {
if (Alloc.getInt()) if (Alloc.getInt())
delete Alloc.getPointer(); delete Alloc.getPointer();
} }
llvm::BumpPtrAllocator &getAllocator() { return *Alloc.getPointer(); } llvm::BumpPtrAllocator &getAllocator() { return *Alloc.getPointer(); }
}; };
template<typename T> template<typename T>
class BumpVector { class BumpVector {
T *Begin = nullptr; T *Begin = nullptr;
@ -67,34 +67,34 @@ public:
explicit BumpVector(BumpVectorContext &C, unsigned N) { explicit BumpVector(BumpVectorContext &C, unsigned N) {
reserve(C, N); reserve(C, N);
} }
~BumpVector() { ~BumpVector() {
if (std::is_class<T>::value) { if (std::is_class<T>::value) {
// Destroy the constructed elements in the vector. // Destroy the constructed elements in the vector.
destroy_range(Begin, End); destroy_range(Begin, End);
} }
} }
using size_type = size_t; using size_type = size_t;
using difference_type = ptrdiff_t; using difference_type = ptrdiff_t;
using value_type = T; using value_type = T;
using iterator = T *; using iterator = T *;
using const_iterator = const T *; using const_iterator = const T *;
using const_reverse_iterator = std::reverse_iterator<const_iterator>; using const_reverse_iterator = std::reverse_iterator<const_iterator>;
using reverse_iterator = std::reverse_iterator<iterator>; using reverse_iterator = std::reverse_iterator<iterator>;
using reference = T &; using reference = T &;
using const_reference = const T &; using const_reference = const T &;
using pointer = T *; using pointer = T *;
using const_pointer = const T *; using const_pointer = const T *;
// forward iterator creation methods. // forward iterator creation methods.
iterator begin() { return Begin; } iterator begin() { return Begin; }
const_iterator begin() const { return Begin; } const_iterator begin() const { return Begin; }
iterator end() { return End; } iterator end() { return End; }
const_iterator end() const { return End; } const_iterator end() const { return End; }
// reverse iterator creation methods. // reverse iterator creation methods.
reverse_iterator rbegin() { return reverse_iterator(end()); } reverse_iterator rbegin() { return reverse_iterator(end()); }
const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); } const_reverse_iterator rbegin() const{ return const_reverse_iterator(end()); }
@ -102,7 +102,7 @@ public:
const_reverse_iterator rend() const { const_reverse_iterator rend() const {
return const_reverse_iterator(begin()); return const_reverse_iterator(begin());
} }
bool empty() const { return Begin == End; } bool empty() const { return Begin == End; }
size_type size() const { return End-Begin; } size_type size() const { return End-Begin; }
@ -114,49 +114,49 @@ public:
assert(Begin + idx < End); assert(Begin + idx < End);
return Begin[idx]; return Begin[idx];
} }
reference front() { reference front() {
return begin()[0]; return begin()[0];
} }
const_reference front() const { const_reference front() const {
return begin()[0]; return begin()[0];
} }
reference back() { reference back() {
return end()[-1]; return end()[-1];
} }
const_reference back() const { const_reference back() const {
return end()[-1]; return end()[-1];
} }
void pop_back() { void pop_back() {
--End; --End;
End->~T(); End->~T();
} }
T pop_back_val() { T pop_back_val() {
T Result = back(); T Result = back();
pop_back(); pop_back();
return Result; return Result;
} }
void clear() { void clear() {
if (std::is_class<T>::value) { if (std::is_class<T>::value) {
destroy_range(Begin, End); destroy_range(Begin, End);
} }
End = Begin; End = Begin;
} }
/// data - Return a pointer to the vector's buffer, even if empty(). /// data - Return a pointer to the vector's buffer, even if empty().
pointer data() { pointer data() {
return pointer(Begin); return pointer(Begin);
} }
/// data - Return a pointer to the vector's buffer, even if empty(). /// data - Return a pointer to the vector's buffer, even if empty().
const_pointer data() const { const_pointer data() const {
return const_pointer(Begin); return const_pointer(Begin);
} }
void push_back(const_reference Elt, BumpVectorContext &C) { void push_back(const_reference Elt, BumpVectorContext &C) {
if (End < Capacity) { if (End < Capacity) {
Retry: Retry:
@ -165,7 +165,7 @@ public:
return; return;
} }
grow(C); grow(C);
goto Retry; goto Retry;
} }
/// insert - Insert some number of copies of element into a position. Return /// insert - Insert some number of copies of element into a position. Return
@ -193,18 +193,18 @@ public:
/// capacity - Return the total number of elements in the currently allocated /// capacity - Return the total number of elements in the currently allocated
/// buffer. /// buffer.
size_t capacity() const { return Capacity - Begin; } size_t capacity() const { return Capacity - Begin; }
private: private:
/// grow - double the size of the allocated memory, guaranteeing space for at /// grow - double the size of the allocated memory, guaranteeing space for at
/// least one more element or MinSize if specified. /// least one more element or MinSize if specified.
void grow(BumpVectorContext &C, size_type MinSize = 1); void grow(BumpVectorContext &C, size_type MinSize = 1);
void construct_range(T *S, T *E, const T &Elt) { void construct_range(T *S, T *E, const T &Elt) {
for (; S != E; ++S) for (; S != E; ++S)
new (S) T(Elt); new (S) T(Elt);
} }
void destroy_range(T *S, T *E) { void destroy_range(T *S, T *E) {
while (S != E) { while (S != E) {
--E; --E;
@ -220,7 +220,7 @@ private:
} }
} }
}; };
// Define this out-of-line to dissuade the C++ compiler from inlining it. // Define this out-of-line to dissuade the C++ compiler from inlining it.
template <typename T> template <typename T>
void BumpVector<T>::grow(BumpVectorContext &C, size_t MinSize) { void BumpVector<T>::grow(BumpVectorContext &C, size_t MinSize) {
@ -232,7 +232,7 @@ void BumpVector<T>::grow(BumpVectorContext &C, size_t MinSize) {
// Allocate the memory from the BumpPtrAllocator. // Allocate the memory from the BumpPtrAllocator.
T *NewElts = C.getAllocator().template Allocate<T>(NewCapacity); T *NewElts = C.getAllocator().template Allocate<T>(NewCapacity);
// Copy the elements over. // Copy the elements over.
if (Begin != End) { if (Begin != End) {
if (std::is_class<T>::value) { if (std::is_class<T>::value) {

View File

@ -81,12 +81,12 @@ struct ReturnAdjustment {
return memcmp(this, &RHS, sizeof(RHS)) < 0; return memcmp(this, &RHS, sizeof(RHS)) < 0;
} }
} Virtual; } Virtual;
ReturnAdjustment() : NonVirtual(0) {} ReturnAdjustment() : NonVirtual(0) {}
bool isEmpty() const { return !NonVirtual && Virtual.isEmpty(); } bool isEmpty() const { return !NonVirtual && Virtual.isEmpty(); }
friend bool operator==(const ReturnAdjustment &LHS, friend bool operator==(const ReturnAdjustment &LHS,
const ReturnAdjustment &RHS) { const ReturnAdjustment &RHS) {
return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Equals(RHS.Virtual); return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Equals(RHS.Virtual);
} }
@ -103,7 +103,7 @@ struct ReturnAdjustment {
return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Less(RHS.Virtual); return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Less(RHS.Virtual);
} }
}; };
/// A \c this pointer adjustment. /// A \c this pointer adjustment.
struct ThisAdjustment { struct ThisAdjustment {
/// The non-virtual adjustment from the derived object to its /// The non-virtual adjustment from the derived object to its
@ -149,12 +149,12 @@ struct ThisAdjustment {
return memcmp(this, &RHS, sizeof(RHS)) < 0; return memcmp(this, &RHS, sizeof(RHS)) < 0;
} }
} Virtual; } Virtual;
ThisAdjustment() : NonVirtual(0) { } ThisAdjustment() : NonVirtual(0) { }
bool isEmpty() const { return !NonVirtual && Virtual.isEmpty(); } bool isEmpty() const { return !NonVirtual && Virtual.isEmpty(); }
friend bool operator==(const ThisAdjustment &LHS, friend bool operator==(const ThisAdjustment &LHS,
const ThisAdjustment &RHS) { const ThisAdjustment &RHS) {
return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Equals(RHS.Virtual); return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Equals(RHS.Virtual);
} }
@ -162,12 +162,12 @@ struct ThisAdjustment {
friend bool operator!=(const ThisAdjustment &LHS, const ThisAdjustment &RHS) { friend bool operator!=(const ThisAdjustment &LHS, const ThisAdjustment &RHS) {
return !(LHS == RHS); return !(LHS == RHS);
} }
friend bool operator<(const ThisAdjustment &LHS, friend bool operator<(const ThisAdjustment &LHS,
const ThisAdjustment &RHS) { const ThisAdjustment &RHS) {
if (LHS.NonVirtual < RHS.NonVirtual) if (LHS.NonVirtual < RHS.NonVirtual)
return true; return true;
return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Less(RHS.Virtual); return LHS.NonVirtual == RHS.NonVirtual && LHS.Virtual.Less(RHS.Virtual);
} }
}; };
@ -179,7 +179,7 @@ class CXXMethodDecl;
struct ThunkInfo { struct ThunkInfo {
/// The \c this pointer adjustment. /// The \c this pointer adjustment.
ThisAdjustment This; ThisAdjustment This;
/// The return adjustment. /// The return adjustment.
ReturnAdjustment Return; ReturnAdjustment Return;
@ -204,7 +204,7 @@ struct ThunkInfo {
bool isEmpty() const { bool isEmpty() const {
return This.isEmpty() && Return.isEmpty() && Method == nullptr; return This.isEmpty() && Return.isEmpty() && Method == nullptr;
} }
}; };
} // end namespace clang } // end namespace clang

View File

@ -34,9 +34,9 @@ class StringSizerHelper {
public: public:
enum { Size = SizeOfStr }; enum { Size = SizeOfStr };
}; };
} // end namespace clang } // end namespace clang
#define STR_SIZE(str, fieldTy) clang::StringSizerHelper<sizeof(str)-1, \ #define STR_SIZE(str, fieldTy) clang::StringSizerHelper<sizeof(str)-1, \
fieldTy>::Size fieldTy>::Size
#endif #endif

View File

@ -456,7 +456,7 @@ class Attr {
// Set to true if all of the attribute's arguments should be parsed in an // Set to true if all of the attribute's arguments should be parsed in an
// unevaluated context. // unevaluated context.
bit ParseArgumentsAsUnevaluated = 0; bit ParseArgumentsAsUnevaluated = 0;
// Set to true if this attribute meaningful when applied to or inherited // Set to true if this attribute meaningful when applied to or inherited
// in a class template definition. // in a class template definition.
bit MeaningfulToClassTemplateDefinition = 0; bit MeaningfulToClassTemplateDefinition = 0;
// Set to true if this attribute can be used with '#pragma clang attribute'. // Set to true if this attribute can be used with '#pragma clang attribute'.
@ -583,7 +583,7 @@ def AlignValue : Attr {
// the future (and a corresponding C++ attribute), but this can be done // the future (and a corresponding C++ attribute), but this can be done
// later once we decide if we also want them to have slightly-different // later once we decide if we also want them to have slightly-different
// semantics than Intel's align_value. // semantics than Intel's align_value.
// //
// Does not get a [[]] spelling because the attribute is not exposed as such // Does not get a [[]] spelling because the attribute is not exposed as such
// by Intel. // by Intel.
GNU<"align_value"> GNU<"align_value">
@ -1703,7 +1703,7 @@ def Overloadable : Attr {
let Documentation = [OverloadableDocs]; let Documentation = [OverloadableDocs];
} }
def Override : InheritableAttr { def Override : InheritableAttr {
let Spellings = [Keyword<"override">]; let Spellings = [Keyword<"override">];
let SemaHandler = 0; let SemaHandler = 0;
let Documentation = [Undocumented]; let Documentation = [Undocumented];
@ -1782,7 +1782,7 @@ def RequireConstantInit : InheritableAttr {
def WorkGroupSizeHint : InheritableAttr { def WorkGroupSizeHint : InheritableAttr {
// Does not have a [[]] spelling because it is an OpenCL-related attribute. // Does not have a [[]] spelling because it is an OpenCL-related attribute.
let Spellings = [GNU<"work_group_size_hint">]; let Spellings = [GNU<"work_group_size_hint">];
let Args = [UnsignedArgument<"XDim">, let Args = [UnsignedArgument<"XDim">,
UnsignedArgument<"YDim">, UnsignedArgument<"YDim">,
UnsignedArgument<"ZDim">]; UnsignedArgument<"ZDim">];
let Subjects = SubjectList<[Function], ErrorDiag>; let Subjects = SubjectList<[Function], ErrorDiag>;

View File

@ -956,7 +956,7 @@ LIBBUILTIN(strlcpy, "zc*cC*z", "f", "string.h", ALL_GNU_LANGUAGES)
LIBBUILTIN(strlcat, "zc*cC*z", "f", "string.h", ALL_GNU_LANGUAGES) LIBBUILTIN(strlcat, "zc*cC*z", "f", "string.h", ALL_GNU_LANGUAGES)
// id objc_msgSend(id, SEL, ...) // id objc_msgSend(id, SEL, ...)
LIBBUILTIN(objc_msgSend, "GGH.", "f", "objc/message.h", OBJC_LANG) LIBBUILTIN(objc_msgSend, "GGH.", "f", "objc/message.h", OBJC_LANG)
// long double objc_msgSend_fpret(id self, SEL op, ...) // long double objc_msgSend_fpret(id self, SEL op, ...)
LIBBUILTIN(objc_msgSend_fpret, "LdGH.", "f", "objc/message.h", OBJC_LANG) LIBBUILTIN(objc_msgSend_fpret, "LdGH.", "f", "objc/message.h", OBJC_LANG)
// _Complex long double objc_msgSend_fp2ret(id self, SEL op, ...) // _Complex long double objc_msgSend_fp2ret(id self, SEL op, ...)
LIBBUILTIN(objc_msgSend_fp2ret, "XLdGH.", "f", "objc/message.h", OBJC_LANG) LIBBUILTIN(objc_msgSend_fp2ret, "XLdGH.", "f", "objc/message.h", OBJC_LANG)

View File

@ -58,7 +58,7 @@ BUILTIN(__builtin_altivec_vctuxs, "V4UiV4fIi", "")
BUILTIN(__builtin_altivec_dss, "vUi", "") BUILTIN(__builtin_altivec_dss, "vUi", "")
BUILTIN(__builtin_altivec_dssall, "v", "") BUILTIN(__builtin_altivec_dssall, "v", "")
BUILTIN(__builtin_altivec_dst, "vvC*iUi", "") BUILTIN(__builtin_altivec_dst, "vvC*iUi", "")
BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "") BUILTIN(__builtin_altivec_dstt, "vvC*iUi", "")
BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "") BUILTIN(__builtin_altivec_dstst, "vvC*iUi", "")
BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "") BUILTIN(__builtin_altivec_dststt, "vvC*iUi", "")

View File

@ -25,7 +25,7 @@
#include "llvm/ADT/SmallVector.h" #include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h" #include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Compiler.h" #include "llvm/Support/Compiler.h"
#include <cassert> #include <cassert>
#include <cstdint> #include <cstdint>
#include <limits> #include <limits>
@ -86,7 +86,7 @@ public:
bool isNull() const { bool isNull() const {
return !RemoveRange.isValid(); return !RemoveRange.isValid();
} }
/// Create a code modification hint that inserts the given /// Create a code modification hint that inserts the given
/// code string at a specific location. /// code string at a specific location.
static FixItHint CreateInsertion(SourceLocation InsertionLoc, static FixItHint CreateInsertion(SourceLocation InsertionLoc,
@ -99,7 +99,7 @@ public:
Hint.BeforePreviousInsertions = BeforePreviousInsertions; Hint.BeforePreviousInsertions = BeforePreviousInsertions;
return Hint; return Hint;
} }
/// Create a code modification hint that inserts the given /// Create a code modification hint that inserts the given
/// code from \p FromRange at a specific location. /// code from \p FromRange at a specific location.
static FixItHint CreateInsertionFromRange(SourceLocation InsertionLoc, static FixItHint CreateInsertionFromRange(SourceLocation InsertionLoc,
@ -123,7 +123,7 @@ public:
static FixItHint CreateRemoval(SourceRange RemoveRange) { static FixItHint CreateRemoval(SourceRange RemoveRange) {
return CreateRemoval(CharSourceRange::getTokenRange(RemoveRange)); return CreateRemoval(CharSourceRange::getTokenRange(RemoveRange));
} }
/// Create a code modification hint that replaces the given /// Create a code modification hint that replaces the given
/// source range with the given code string. /// source range with the given code string.
static FixItHint CreateReplacement(CharSourceRange RemoveRange, static FixItHint CreateReplacement(CharSourceRange RemoveRange,
@ -133,7 +133,7 @@ public:
Hint.CodeToInsert = Code; Hint.CodeToInsert = Code;
return Hint; return Hint;
} }
static FixItHint CreateReplacement(SourceRange RemoveRange, static FixItHint CreateReplacement(SourceRange RemoveRange,
StringRef Code) { StringRef Code) {
return CreateReplacement(CharSourceRange::getTokenRange(RemoveRange), Code); return CreateReplacement(CharSourceRange::getTokenRange(RemoveRange), Code);
@ -348,7 +348,7 @@ private:
unsigned Offset; unsigned Offset;
DiagStatePoint(DiagState *State, unsigned Offset) DiagStatePoint(DiagState *State, unsigned Offset)
: State(State), Offset(Offset) {} : State(State), Offset(Offset) {}
}; };
/// Description of the diagnostic states and state transitions for a /// Description of the diagnostic states and state transitions for a
@ -420,7 +420,7 @@ private:
/// Indicates that an unrecoverable error has occurred. /// Indicates that an unrecoverable error has occurred.
bool UnrecoverableErrorOccurred; bool UnrecoverableErrorOccurred;
/// Counts for DiagnosticErrorTrap to check whether an error occurred /// Counts for DiagnosticErrorTrap to check whether an error occurred
/// during a parsing section, e.g. during parsing a function. /// during a parsing section, e.g. during parsing a function.
unsigned TrapNumErrorsOccurred; unsigned TrapNumErrorsOccurred;
@ -556,7 +556,7 @@ public:
/// ///
/// Zero disables the limit. /// Zero disables the limit.
void setErrorLimit(unsigned Limit) { ErrorLimit = Limit; } void setErrorLimit(unsigned Limit) { ErrorLimit = Limit; }
/// Specify the maximum number of template instantiation /// Specify the maximum number of template instantiation
/// notes to emit along with a given diagnostic. /// notes to emit along with a given diagnostic.
void setTemplateBacktraceLimit(unsigned Limit) { void setTemplateBacktraceLimit(unsigned Limit) {
@ -626,11 +626,11 @@ public:
return GetCurDiagState()->SuppressSystemWarnings; return GetCurDiagState()->SuppressSystemWarnings;
} }
/// Suppress all diagnostics, to silence the front end when we /// Suppress all diagnostics, to silence the front end when we
/// know that we don't want any more diagnostics to be passed along to the /// know that we don't want any more diagnostics to be passed along to the
/// client /// client
void setSuppressAllDiagnostics(bool Val = true) { void setSuppressAllDiagnostics(bool Val = true) {
SuppressAllDiagnostics = Val; SuppressAllDiagnostics = Val;
} }
bool getSuppressAllDiagnostics() const { return SuppressAllDiagnostics; } bool getSuppressAllDiagnostics() const { return SuppressAllDiagnostics; }
@ -638,12 +638,12 @@ public:
/// template types. /// template types.
void setElideType(bool Val = true) { ElideType = Val; } void setElideType(bool Val = true) { ElideType = Val; }
bool getElideType() { return ElideType; } bool getElideType() { return ElideType; }
/// Set tree printing, to outputting the template difference in a /// Set tree printing, to outputting the template difference in a
/// tree format. /// tree format.
void setPrintTemplateTree(bool Val = false) { PrintTemplateTree = Val; } void setPrintTemplateTree(bool Val = false) { PrintTemplateTree = Val; }
bool getPrintTemplateTree() { return PrintTemplateTree; } bool getPrintTemplateTree() { return PrintTemplateTree; }
/// Set color printing, so the type diffing will inject color markers /// Set color printing, so the type diffing will inject color markers
/// into the output. /// into the output.
void setShowColors(bool Val = false) { ShowColors = Val; } void setShowColors(bool Val = false) { ShowColors = Val; }
@ -657,7 +657,7 @@ public:
ShowOverloads = Val; ShowOverloads = Val;
} }
OverloadsShown getShowOverloads() const { return ShowOverloads; } OverloadsShown getShowOverloads() const { return ShowOverloads; }
/// Pretend that the last diagnostic issued was ignored, so any /// Pretend that the last diagnostic issued was ignored, so any
/// subsequent notes will be suppressed, or restore a prior ignoring /// subsequent notes will be suppressed, or restore a prior ignoring
/// state after ignoring some diagnostics and their notes, possibly in /// state after ignoring some diagnostics and their notes, possibly in
@ -751,12 +751,12 @@ public:
return UncompilableErrorOccurred; return UncompilableErrorOccurred;
} }
bool hasFatalErrorOccurred() const { return FatalErrorOccurred; } bool hasFatalErrorOccurred() const { return FatalErrorOccurred; }
/// Determine whether any kind of unrecoverable error has occurred. /// Determine whether any kind of unrecoverable error has occurred.
bool hasUnrecoverableErrorOccurred() const { bool hasUnrecoverableErrorOccurred() const {
return FatalErrorOccurred || UnrecoverableErrorOccurred; return FatalErrorOccurred || UnrecoverableErrorOccurred;
} }
unsigned getNumWarnings() const { return NumWarnings; } unsigned getNumWarnings() const { return NumWarnings; }
void setNumWarnings(unsigned NumWarnings) { void setNumWarnings(unsigned NumWarnings) {
@ -799,10 +799,10 @@ public:
LastDiagLevel = Other.LastDiagLevel; LastDiagLevel = Other.LastDiagLevel;
} }
/// Reset the state of the diagnostic object to its initial /// Reset the state of the diagnostic object to its initial
/// configuration. /// configuration.
void Reset(); void Reset();
//===--------------------------------------------------------------------===// //===--------------------------------------------------------------------===//
// DiagnosticsEngine classification and reporting interfaces. // DiagnosticsEngine classification and reporting interfaces.
// //
@ -875,7 +875,7 @@ public:
/// DiagnosticsEngine object itself. /// DiagnosticsEngine object itself.
void SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1 = "", void SetDelayedDiagnostic(unsigned DiagID, StringRef Arg1 = "",
StringRef Arg2 = ""); StringRef Arg2 = "");
/// Clear out the current diagnostic. /// Clear out the current diagnostic.
void Clear() { CurDiagID = std::numeric_limits<unsigned>::max(); } void Clear() { CurDiagID = std::numeric_limits<unsigned>::max(); }
@ -894,7 +894,7 @@ private:
friend class DiagnosticErrorTrap; friend class DiagnosticErrorTrap;
friend class DiagnosticIDs; friend class DiagnosticIDs;
friend class PartialDiagnostic; friend class PartialDiagnostic;
/// Report the delayed diagnostic. /// Report the delayed diagnostic.
void ReportDelayed(); void ReportDelayed();
@ -1042,7 +1042,7 @@ public:
class DiagnosticBuilder { class DiagnosticBuilder {
friend class DiagnosticsEngine; friend class DiagnosticsEngine;
friend class PartialDiagnostic; friend class PartialDiagnostic;
mutable DiagnosticsEngine *DiagObj = nullptr; mutable DiagnosticsEngine *DiagObj = nullptr;
mutable unsigned NumArgs = 0; mutable unsigned NumArgs = 0;
@ -1105,7 +1105,7 @@ protected:
return Result; return Result;
} }
public: public:
/// Copy constructor. When copied, this "takes" the diagnostic info from the /// Copy constructor. When copied, this "takes" the diagnostic info from the
/// input and neuters it. /// input and neuters it.
@ -1430,8 +1430,8 @@ public:
}; };
/** /**
* Represents a diagnostic in a form that can be retained until its * Represents a diagnostic in a form that can be retained until its
* corresponding source manager is destroyed. * corresponding source manager is destroyed.
*/ */
class StoredDiagnostic { class StoredDiagnostic {
unsigned ID; unsigned ID;
@ -1444,9 +1444,9 @@ class StoredDiagnostic {
public: public:
StoredDiagnostic() = default; StoredDiagnostic() = default;
StoredDiagnostic(DiagnosticsEngine::Level Level, const Diagnostic &Info); StoredDiagnostic(DiagnosticsEngine::Level Level, const Diagnostic &Info);
StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID, StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
StringRef Message); StringRef Message);
StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID, StoredDiagnostic(DiagnosticsEngine::Level Level, unsigned ID,
StringRef Message, FullSourceLoc Loc, StringRef Message, FullSourceLoc Loc,
ArrayRef<CharSourceRange> Ranges, ArrayRef<CharSourceRange> Ranges,
ArrayRef<FixItHint> Fixits); ArrayRef<FixItHint> Fixits);
@ -1466,7 +1466,7 @@ public:
range_iterator range_begin() const { return Ranges.begin(); } range_iterator range_begin() const { return Ranges.begin(); }
range_iterator range_end() const { return Ranges.end(); } range_iterator range_end() const { return Ranges.end(); }
unsigned range_size() const { return Ranges.size(); } unsigned range_size() const { return Ranges.size(); }
ArrayRef<CharSourceRange> getRanges() const { ArrayRef<CharSourceRange> getRanges() const {
return llvm::makeArrayRef(Ranges); return llvm::makeArrayRef(Ranges);
} }
@ -1476,7 +1476,7 @@ public:
fixit_iterator fixit_begin() const { return FixIts.begin(); } fixit_iterator fixit_begin() const { return FixIts.begin(); }
fixit_iterator fixit_end() const { return FixIts.end(); } fixit_iterator fixit_end() const { return FixIts.end(); }
unsigned fixit_size() const { return FixIts.size(); } unsigned fixit_size() const { return FixIts.size(); }
ArrayRef<FixItHint> getFixIts() const { ArrayRef<FixItHint> getFixIts() const {
return llvm::makeArrayRef(FixIts); return llvm::makeArrayRef(FixIts);
} }
@ -1488,7 +1488,7 @@ class DiagnosticConsumer {
protected: protected:
unsigned NumWarnings = 0; ///< Number of warnings reported unsigned NumWarnings = 0; ///< Number of warnings reported
unsigned NumErrors = 0; ///< Number of errors reported unsigned NumErrors = 0; ///< Number of errors reported
public: public:
DiagnosticConsumer() = default; DiagnosticConsumer() = default;
virtual ~DiagnosticConsumer(); virtual ~DiagnosticConsumer();
@ -1506,7 +1506,7 @@ public:
/// in between BeginSourceFile() and EndSourceFile(). /// in between BeginSourceFile() and EndSourceFile().
/// ///
/// \param LangOpts The language options for the source file being processed. /// \param LangOpts The language options for the source file being processed.
/// \param PP The preprocessor object being used for the source; this is /// \param PP The preprocessor object being used for the source; this is
/// optional, e.g., it may not be present when processing AST source files. /// optional, e.g., it may not be present when processing AST source files.
virtual void BeginSourceFile(const LangOptions &LangOpts, virtual void BeginSourceFile(const LangOptions &LangOpts,
const Preprocessor *PP = nullptr) {} const Preprocessor *PP = nullptr) {}

View File

@ -168,7 +168,7 @@ def warn_integer_constant_overflow : Warning<
"overflow in expression; result is %0 with type %1">, "overflow in expression; result is %0 with type %1">,
InGroup<DiagGroup<"integer-overflow">>; InGroup<DiagGroup<"integer-overflow">>;
// This is a temporary diagnostic, and shall be removed once our // This is a temporary diagnostic, and shall be removed once our
// implementation is complete, and like the preceding constexpr notes belongs // implementation is complete, and like the preceding constexpr notes belongs
// in Sema. // in Sema.
def note_unimplemented_constexpr_lambda_feature_ast : Note< def note_unimplemented_constexpr_lambda_feature_ast : Note<

View File

@ -83,19 +83,19 @@ def warn_doc_function_method_decl_mismatch : Warning<
"%select{a function|a function|an Objective-C method|an Objective-C method|" "%select{a function|a function|an Objective-C method|an Objective-C method|"
"a pointer to function}2 declaration">, "a pointer to function}2 declaration">,
InGroup<Documentation>, DefaultIgnore; InGroup<Documentation>, DefaultIgnore;
def warn_doc_api_container_decl_mismatch : Warning< def warn_doc_api_container_decl_mismatch : Warning<
"'%select{\\|@}0%select{class|interface|protocol|struct|union}1' " "'%select{\\|@}0%select{class|interface|protocol|struct|union}1' "
"command should not be used in a comment attached to a " "command should not be used in a comment attached to a "
"non-%select{class|interface|protocol|struct|union}2 declaration">, "non-%select{class|interface|protocol|struct|union}2 declaration">,
InGroup<Documentation>, DefaultIgnore; InGroup<Documentation>, DefaultIgnore;
def warn_doc_container_decl_mismatch : Warning< def warn_doc_container_decl_mismatch : Warning<
"'%select{\\|@}0%select{classdesign|coclass|dependency|helper" "'%select{\\|@}0%select{classdesign|coclass|dependency|helper"
"|helperclass|helps|instancesize|ownership|performance|security|superclass}1' " "|helperclass|helps|instancesize|ownership|performance|security|superclass}1' "
"command should not be used in a comment attached to a non-container declaration">, "command should not be used in a comment attached to a non-container declaration">,
InGroup<Documentation>, DefaultIgnore; InGroup<Documentation>, DefaultIgnore;
def warn_doc_param_duplicate : Warning< def warn_doc_param_duplicate : Warning<
"parameter '%0' is already documented">, "parameter '%0' is already documented">,
InGroup<Documentation>, DefaultIgnore; InGroup<Documentation>, DefaultIgnore;

View File

@ -16,7 +16,7 @@ let Component = "Common" in {
// Basic. // Basic.
def fatal_too_many_errors def fatal_too_many_errors
: Error<"too many errors emitted, stopping now">, DefaultFatal; : Error<"too many errors emitted, stopping now">, DefaultFatal;
def note_declared_at : Note<"declared here">; def note_declared_at : Note<"declared here">;
def note_previous_definition : Note<"previous definition is here">; def note_previous_definition : Note<"previous definition is here">;
@ -97,11 +97,11 @@ def remark_module_lock_timeout : Remark<
def err_module_shadowed : Error<"import of shadowed module '%0'">, DefaultFatal; def err_module_shadowed : Error<"import of shadowed module '%0'">, DefaultFatal;
def err_module_build_shadowed_submodule : Error< def err_module_build_shadowed_submodule : Error<
"build a shadowed submodule '%0'">, DefaultFatal; "build a shadowed submodule '%0'">, DefaultFatal;
def err_module_cycle : Error<"cyclic dependency in module '%0': %1">, def err_module_cycle : Error<"cyclic dependency in module '%0': %1">,
DefaultFatal; DefaultFatal;
def err_module_prebuilt : Error< def err_module_prebuilt : Error<
"error in loading module '%0' from prebuilt module path">, DefaultFatal; "error in loading module '%0' from prebuilt module path">, DefaultFatal;
def note_pragma_entered_here : Note<"#pragma entered here">; def note_pragma_entered_here : Note<"#pragma entered here">;
def note_decl_hiding_tag_type : Note< def note_decl_hiding_tag_type : Note<
"%1 %0 is hidden by a non-type declaration of %0 here">; "%1 %0 is hidden by a non-type declaration of %0 here">;
def err_attribute_not_type_attr : Error< def err_attribute_not_type_attr : Error<
@ -115,7 +115,7 @@ let CategoryName = "Nullability Issue" in {
def warn_nullability_duplicate : Warning< def warn_nullability_duplicate : Warning<
"duplicate nullability specifier %0">, "duplicate nullability specifier %0">,
InGroup<Nullability>; InGroup<Nullability>;
def warn_conflicting_nullability_attr_overriding_ret_types : Warning< def warn_conflicting_nullability_attr_overriding_ret_types : Warning<
"conflicting nullability specifier on return types, %0 " "conflicting nullability specifier on return types, %0 "
"conflicts with existing specifier %1">, "conflicts with existing specifier %1">,
@ -223,7 +223,7 @@ def err_unable_to_rename_temp : Error<
"unable to rename temporary '%0' to output file '%1': '%2'">; "unable to rename temporary '%0' to output file '%1': '%2'">;
def err_unable_to_make_temp : Error< def err_unable_to_make_temp : Error<
"unable to make temporary file: %0">; "unable to make temporary file: %0">;
// Modules // Modules
def err_module_format_unhandled : Error< def err_module_format_unhandled : Error<
"no handler registered for module format '%0'">, DefaultFatal; "no handler registered for module format '%0'">, DefaultFatal;

View File

@ -208,7 +208,7 @@ def err_drv_omp_host_target_not_supported : Error<
def err_drv_expecting_fopenmp_with_fopenmp_targets : Error< def err_drv_expecting_fopenmp_with_fopenmp_targets : Error<
"The option -fopenmp-targets must be used in conjunction with a -fopenmp option compatible with offloading, please use -fopenmp=libomp or -fopenmp=libiomp5.">; "The option -fopenmp-targets must be used in conjunction with a -fopenmp option compatible with offloading, please use -fopenmp=libomp or -fopenmp=libiomp5.">;
def warn_drv_omp_offload_target_duplicate : Warning< def warn_drv_omp_offload_target_duplicate : Warning<
"The OpenMP offloading target '%0' is similar to target '%1' already specified - will be ignored.">, "The OpenMP offloading target '%0' is similar to target '%1' already specified - will be ignored.">,
InGroup<OpenMPTarget>; InGroup<OpenMPTarget>;
def warn_drv_omp_offload_target_missingbcruntime : Warning< def warn_drv_omp_offload_target_missingbcruntime : Warning<
"No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.">, "No library '%0' found in the default clang lib directory or in LIBRARY_PATH. Expect degraded performance due to no inlining of runtime functions on target devices.">,

View File

@ -36,7 +36,7 @@ def remark_fe_backend_plugin: Remark<"%0">, BackendInfo, InGroup<RemarkBackendPl
def note_fe_backend_plugin: Note<"%0">, BackendInfo; def note_fe_backend_plugin: Note<"%0">, BackendInfo;
def warn_fe_override_module : Warning< def warn_fe_override_module : Warning<
"overriding the module target triple with %0">, "overriding the module target triple with %0">,
InGroup<DiagGroup<"override-module">>; InGroup<DiagGroup<"override-module">>;
def remark_fe_backend_optimization_remark : Remark<"%0">, BackendInfo, def remark_fe_backend_optimization_remark : Remark<"%0">, BackendInfo,
@ -190,10 +190,10 @@ def err_module_interface_requires_modules_ts : Error<
def warn_module_config_mismatch : Warning< def warn_module_config_mismatch : Warning<
"module file %0 cannot be loaded due to a configuration mismatch with the current " "module file %0 cannot be loaded due to a configuration mismatch with the current "
"compilation">, InGroup<DiagGroup<"module-file-config-mismatch">>, DefaultError; "compilation">, InGroup<DiagGroup<"module-file-config-mismatch">>, DefaultError;
def err_module_map_not_found : Error<"module map file '%0' not found">, def err_module_map_not_found : Error<"module map file '%0' not found">,
DefaultFatal; DefaultFatal;
def err_missing_module_name : Error< def err_missing_module_name : Error<
"no module name provided; specify one with -fmodule-name=">, "no module name provided; specify one with -fmodule-name=">,
DefaultFatal; DefaultFatal;
def err_missing_module : Error< def err_missing_module : Error<
"no module named '%0' declared in module map file '%1'">, DefaultFatal; "no module named '%0' declared in module map file '%1'">, DefaultFatal;

View File

@ -288,7 +288,7 @@ def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
def : DiagGroup<"import">; def : DiagGroup<"import">;
def GNUIncludeNext : DiagGroup<"gnu-include-next">; def GNUIncludeNext : DiagGroup<"gnu-include-next">;
def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">; def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">;
def IncompatiblePointerTypesDiscardsQualifiers def IncompatiblePointerTypesDiscardsQualifiers
: DiagGroup<"incompatible-pointer-types-discards-qualifiers">; : DiagGroup<"incompatible-pointer-types-discards-qualifiers">;
def IncompatibleFunctionPointerTypes def IncompatibleFunctionPointerTypes
: DiagGroup<"incompatible-function-pointer-types">; : DiagGroup<"incompatible-function-pointer-types">;
@ -800,14 +800,14 @@ def Most : DiagGroup<"most", [
UserDefinedWarnings UserDefinedWarnings
]>; ]>;
// Thread Safety warnings // Thread Safety warnings
def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">; def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">; def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">;
def ThreadSafetyPrecise : DiagGroup<"thread-safety-precise">; def ThreadSafetyPrecise : DiagGroup<"thread-safety-precise">;
def ThreadSafetyReference : DiagGroup<"thread-safety-reference">; def ThreadSafetyReference : DiagGroup<"thread-safety-reference">;
def ThreadSafetyNegative : DiagGroup<"thread-safety-negative">; def ThreadSafetyNegative : DiagGroup<"thread-safety-negative">;
def ThreadSafety : DiagGroup<"thread-safety", def ThreadSafety : DiagGroup<"thread-safety",
[ThreadSafetyAttributes, [ThreadSafetyAttributes,
ThreadSafetyAnalysis, ThreadSafetyAnalysis,
ThreadSafetyPrecise, ThreadSafetyPrecise,
ThreadSafetyReference]>; ThreadSafetyReference]>;

View File

@ -214,7 +214,7 @@ public:
bool ignored; bool ignored;
return isBuiltinExtensionDiag(DiagID, ignored); return isBuiltinExtensionDiag(DiagID, ignored);
} }
/// Determine whether the given built-in diagnostic ID is for an /// Determine whether the given built-in diagnostic ID is for an
/// extension of some sort, and whether it is enabled by default. /// extension of some sort, and whether it is enabled by default.
/// ///
@ -223,14 +223,14 @@ public:
/// treated as a warning/error by default. /// treated as a warning/error by default.
/// ///
static bool isBuiltinExtensionDiag(unsigned DiagID, bool &EnabledByDefault); static bool isBuiltinExtensionDiag(unsigned DiagID, bool &EnabledByDefault);
/// Return the lowest-level warning option that enables the specified /// Return the lowest-level warning option that enables the specified
/// diagnostic. /// diagnostic.
/// ///
/// If there is no -Wfoo flag that controls the diagnostic, this returns null. /// If there is no -Wfoo flag that controls the diagnostic, this returns null.
static StringRef getWarningOptionForDiag(unsigned DiagID); static StringRef getWarningOptionForDiag(unsigned DiagID);
/// Return the category number that a specified \p DiagID belongs to, /// Return the category number that a specified \p DiagID belongs to,
/// or 0 if no category. /// or 0 if no category.
static unsigned getCategoryNumberForDiag(unsigned DiagID); static unsigned getCategoryNumberForDiag(unsigned DiagID);
@ -240,7 +240,7 @@ public:
/// Given a category ID, return the name of the category. /// Given a category ID, return the name of the category.
static StringRef getCategoryNameFromID(unsigned CategoryID); static StringRef getCategoryNameFromID(unsigned CategoryID);
/// Return true if a given diagnostic falls into an ARC diagnostic /// Return true if a given diagnostic falls into an ARC diagnostic
/// category. /// category.
static bool isARCDiagnostic(unsigned DiagID); static bool isARCDiagnostic(unsigned DiagID);
@ -251,26 +251,26 @@ public:
/// The diagnostic should not be reported, but it should cause /// The diagnostic should not be reported, but it should cause
/// template argument deduction to fail. /// template argument deduction to fail.
/// ///
/// The vast majority of errors that occur during template argument /// The vast majority of errors that occur during template argument
/// deduction fall into this category. /// deduction fall into this category.
SFINAE_SubstitutionFailure, SFINAE_SubstitutionFailure,
/// The diagnostic should be suppressed entirely. /// The diagnostic should be suppressed entirely.
/// ///
/// Warnings generally fall into this category. /// Warnings generally fall into this category.
SFINAE_Suppress, SFINAE_Suppress,
/// The diagnostic should be reported. /// The diagnostic should be reported.
/// ///
/// The diagnostic should be reported. Various fatal errors (e.g., /// The diagnostic should be reported. Various fatal errors (e.g.,
/// template instantiation depth exceeded) fall into this category. /// template instantiation depth exceeded) fall into this category.
SFINAE_Report, SFINAE_Report,
/// The diagnostic is an access-control diagnostic, which will be /// The diagnostic is an access-control diagnostic, which will be
/// substitution failures in some contexts and reported in others. /// substitution failures in some contexts and reported in others.
SFINAE_AccessControl SFINAE_AccessControl
}; };
/// Determines whether the given built-in diagnostic ID is /// Determines whether the given built-in diagnostic ID is
/// for an error that is suppressed if it occurs during C++ template /// for an error that is suppressed if it occurs during C++ template
/// argument deduction. /// argument deduction.
@ -306,7 +306,7 @@ public:
private: private:
/// Classify the specified diagnostic ID into a Level, consumable by /// Classify the specified diagnostic ID into a Level, consumable by
/// the DiagnosticClient. /// the DiagnosticClient.
/// ///
/// The classification is based on the way the client configured the /// The classification is based on the way the client configured the
/// DiagnosticsEngine object. /// DiagnosticsEngine object.
/// ///

View File

@ -53,7 +53,7 @@ def ext_multi_line_line_comment : Extension<"multi-line // comment">,
def ext_line_comment : Extension< def ext_line_comment : Extension<
"// comments are not allowed in this language">, "// comments are not allowed in this language">,
InGroup<Comment>; InGroup<Comment>;
def ext_no_newline_eof : Extension<"no newline at end of file">, def ext_no_newline_eof : Extension<"no newline at end of file">,
InGroup<NewlineEOF>; InGroup<NewlineEOF>;
def warn_no_newline_eof : Warning<"no newline at end of file">, def warn_no_newline_eof : Warning<"no newline at end of file">,
InGroup<NewlineEOF>, DefaultIgnore; InGroup<NewlineEOF>, DefaultIgnore;
@ -294,7 +294,7 @@ def pp_nonportable_path : NonportablePath,
InGroup<DiagGroup<"nonportable-include-path">>; InGroup<DiagGroup<"nonportable-include-path">>;
def pp_nonportable_system_path : NonportablePath, DefaultIgnore, def pp_nonportable_system_path : NonportablePath, DefaultIgnore,
InGroup<DiagGroup<"nonportable-system-include-path">>; InGroup<DiagGroup<"nonportable-system-include-path">>;
def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">, def pp_pragma_once_in_main_file : Warning<"#pragma once in main file">,
InGroup<DiagGroup<"pragma-once-outside-header">>; InGroup<DiagGroup<"pragma-once-outside-header">>;
def pp_pragma_sysheader_in_main_file : Warning< def pp_pragma_sysheader_in_main_file : Warning<
@ -353,7 +353,7 @@ def ext_pp_warning_directive : Extension<"#warning is a language extension">;
def ext_pp_extra_tokens_at_eol : ExtWarn< def ext_pp_extra_tokens_at_eol : ExtWarn<
"extra tokens at end of #%0 directive">, InGroup<ExtraTokens>; "extra tokens at end of #%0 directive">, InGroup<ExtraTokens>;
def ext_pp_comma_expr : Extension<"comma operator in operand of #if">; def ext_pp_comma_expr : Extension<"comma operator in operand of #if">;
def ext_pp_bad_vaargs_use : Extension< def ext_pp_bad_vaargs_use : Extension<
"__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">; "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro">;
@ -594,7 +594,7 @@ def err_pp_illegal_floating_literal : Error<
def err_pp_line_requires_integer : Error< def err_pp_line_requires_integer : Error<
"#line directive requires a positive integer argument">; "#line directive requires a positive integer argument">;
def ext_pp_line_zero : Extension< def ext_pp_line_zero : Extension<
"#line directive with zero argument is a GNU extension">, "#line directive with zero argument is a GNU extension">,
InGroup<GNUZeroLineDirective>; InGroup<GNUZeroLineDirective>;
def err_pp_line_invalid_filename : Error< def err_pp_line_invalid_filename : Error<
"invalid filename for #line directive">; "invalid filename for #line directive">;
@ -736,7 +736,7 @@ def warn_auto_module_import : Warning<
def note_implicit_top_level_module_import_here : Note< def note_implicit_top_level_module_import_here : Note<
"submodule of top-level module '%0' implicitly imported here">; "submodule of top-level module '%0' implicitly imported here">;
def warn_uncovered_module_header : Warning< def warn_uncovered_module_header : Warning<
"umbrella header for module '%0' does not include header '%1'">, "umbrella header for module '%0' does not include header '%1'">,
InGroup<IncompleteUmbrella>; InGroup<IncompleteUmbrella>;
def warn_mmap_umbrella_dir_not_found : Warning< def warn_mmap_umbrella_dir_not_found : Warning<
"umbrella directory '%0' not found">, "umbrella directory '%0' not found">,
@ -755,7 +755,7 @@ def warn_non_modular_include_in_module : Warning<
"include of non-modular header inside module '%0': '%1'">, "include of non-modular header inside module '%0': '%1'">,
InGroup<NonModularIncludeInModule>, DefaultIgnore; InGroup<NonModularIncludeInModule>, DefaultIgnore;
def warn_module_conflict : Warning< def warn_module_conflict : Warning<
"module '%0' conflicts with already-imported module '%1': %2">, "module '%0' conflicts with already-imported module '%1': %2">,
InGroup<ModuleConflict>; InGroup<ModuleConflict>;
def warn_header_guard : Warning< def warn_header_guard : Warning<

View File

@ -61,9 +61,9 @@ DIAGOPT(ShowOptionNames, 1, 0) /// Show the option name for mappable
DIAGOPT(ShowNoteIncludeStack, 1, 0) /// Show include stacks for notes. DIAGOPT(ShowNoteIncludeStack, 1, 0) /// Show include stacks for notes.
VALUE_DIAGOPT(ShowCategories, 2, 0) /// Show categories: 0 -> none, 1 -> Number, VALUE_DIAGOPT(ShowCategories, 2, 0) /// Show categories: 0 -> none, 1 -> Number,
/// 2 -> Full Name. /// 2 -> Full Name.
ENUM_DIAGOPT(Format, TextDiagnosticFormat, 2, Clang) /// Format for diagnostics: ENUM_DIAGOPT(Format, TextDiagnosticFormat, 2, Clang) /// Format for diagnostics:
DIAGOPT(ShowColors, 1, 0) /// Show diagnostics with ANSI color sequences. DIAGOPT(ShowColors, 1, 0) /// Show diagnostics with ANSI color sequences.
ENUM_DIAGOPT(ShowOverloads, OverloadsShown, 1, ENUM_DIAGOPT(ShowOverloads, OverloadsShown, 1,
Ovl_All) /// Overload candidates to show. Ovl_All) /// Overload candidates to show.

View File

@ -91,7 +91,7 @@ protected:
public: public:
/// The file to log diagnostic output to. /// The file to log diagnostic output to.
std::string DiagnosticLogFile; std::string DiagnosticLogFile;
/// The file to serialize diagnostics to (non-appending). /// The file to serialize diagnostics to (non-appending).
std::string DiagnosticSerializationFile; std::string DiagnosticSerializationFile;

View File

@ -86,7 +86,7 @@ def err_enumerator_list_missing_comma : Error<
def err_enumerator_unnamed_no_def : Error< def err_enumerator_unnamed_no_def : Error<
"unnamed enumeration must be a definition">; "unnamed enumeration must be a definition">;
def ext_cxx11_enum_fixed_underlying_type : Extension< def ext_cxx11_enum_fixed_underlying_type : Extension<
"enumeration types with a fixed underlying type are a C++11 extension">, "enumeration types with a fixed underlying type are a C++11 extension">,
InGroup<CXX11>; InGroup<CXX11>;
def ext_c_enum_fixed_underlying_type : Extension< def ext_c_enum_fixed_underlying_type : Extension<
"enumeration types with a fixed underlying type are a Microsoft extension">, "enumeration types with a fixed underlying type are a Microsoft extension">,
@ -101,7 +101,7 @@ def ext_alignof_expr : ExtWarn<
"%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>; "%0 applied to an expression is a GNU extension">, InGroup<GNUAlignofExpression>;
def warn_microsoft_dependent_exists : Warning< def warn_microsoft_dependent_exists : Warning<
"dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">, "dependent %select{__if_not_exists|__if_exists}0 declarations are ignored">,
InGroup<DiagGroup<"microsoft-exists">>; InGroup<DiagGroup<"microsoft-exists">>;
def warn_microsoft_qualifiers_ignored : Warning< def warn_microsoft_qualifiers_ignored : Warning<
"qualifiers after comma in declarator list are ignored">, "qualifiers after comma in declarator list are ignored">,
@ -134,14 +134,14 @@ def ext_gnu_conditional_expr : Extension<
"use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>; "use of GNU ?: conditional expression extension, omitting middle operand">, InGroup<GNUConditionalOmittedOperand>;
def ext_gnu_empty_initializer : Extension< def ext_gnu_empty_initializer : Extension<
"use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>; "use of GNU empty initializer extension">, InGroup<GNUEmptyInitializer>;
def ext_gnu_array_range : Extension<"use of GNU array range extension">, def ext_gnu_array_range : Extension<"use of GNU array range extension">,
InGroup<GNUDesignator>; InGroup<GNUDesignator>;
def ext_gnu_missing_equal_designator : ExtWarn< def ext_gnu_missing_equal_designator : ExtWarn<
"use of GNU 'missing =' extension in designator">, "use of GNU 'missing =' extension in designator">,
InGroup<GNUDesignator>; InGroup<GNUDesignator>;
def err_expected_equal_designator : Error<"expected '=' or another designator">; def err_expected_equal_designator : Error<"expected '=' or another designator">;
def ext_gnu_old_style_field_designator : ExtWarn< def ext_gnu_old_style_field_designator : ExtWarn<
"use of GNU old-style field designator extension">, "use of GNU old-style field designator extension">,
InGroup<GNUDesignator>; InGroup<GNUDesignator>;
def ext_gnu_case_range : Extension<"use of GNU case range extension">, def ext_gnu_case_range : Extension<"use of GNU case range extension">,
InGroup<GNUCaseRange>; InGroup<GNUCaseRange>;
@ -168,16 +168,16 @@ def err_unexpected_semi : Error<"unexpected ';' before %0">;
def err_expected_fn_body : Error< def err_expected_fn_body : Error<
"expected function body after function declarator">; "expected function body after function declarator">;
def warn_attribute_on_function_definition : Warning< def warn_attribute_on_function_definition : Warning<
"GCC does not allow %0 attribute in this position on a function definition">, "GCC does not allow %0 attribute in this position on a function definition">,
InGroup<GccCompat>; InGroup<GccCompat>;
def warn_gcc_attribute_location : Warning< def warn_gcc_attribute_location : Warning<
"GCC does not allow an attribute in this position on a function declaration">, "GCC does not allow an attribute in this position on a function declaration">,
InGroup<GccCompat>; InGroup<GccCompat>;
def warn_gcc_variable_decl_in_for_loop : Warning< def warn_gcc_variable_decl_in_for_loop : Warning<
"GCC does not allow variable declarations in for loop initializers before " "GCC does not allow variable declarations in for loop initializers before "
"C99">, InGroup<GccCompat>; "C99">, InGroup<GccCompat>;
def warn_attribute_no_decl : Warning< def warn_attribute_no_decl : Warning<
"attribute %0 ignored, because it is not attached to a declaration">, "attribute %0 ignored, because it is not attached to a declaration">,
InGroup<IgnoredAttributes>; InGroup<IgnoredAttributes>;
def err_ms_attributes_not_enabled : Error< def err_ms_attributes_not_enabled : Error<
"'__declspec' attributes are not enabled; use '-fdeclspec' or " "'__declspec' attributes are not enabled; use '-fdeclspec' or "
@ -319,7 +319,7 @@ def warn_cxx98_compat_decltype : Warning<
def err_unexpected_scope_on_base_decltype : Error< def err_unexpected_scope_on_base_decltype : Error<
"unexpected namespace scope prior to decltype">; "unexpected namespace scope prior to decltype">;
def err_expected_class_name : Error<"expected class name">; def err_expected_class_name : Error<"expected class name">;
def err_expected_class_name_not_template : def err_expected_class_name_not_template :
Error<"'typename' is redundant; base classes are implicitly types">; Error<"'typename' is redundant; base classes are implicitly types">;
def err_unspecified_vla_size_with_static : Error< def err_unspecified_vla_size_with_static : Error<
"'static' may not be used with an unspecified variable length array size">; "'static' may not be used with an unspecified variable length array size">;
@ -395,7 +395,7 @@ def warn_arc_bridge_cast_nonarc : Warning<
"'%0' casts have no effect when not using ARC">, "'%0' casts have no effect when not using ARC">,
InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>; InGroup<DiagGroup<"arc-bridge-casts-disallowed-in-nonarc">>;
} }
def err_objc_illegal_visibility_spec : Error< def err_objc_illegal_visibility_spec : Error<
"illegal visibility specification">; "illegal visibility specification">;
def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">; def err_objc_illegal_interface_qual : Error<"illegal interface qualifier">;
@ -687,7 +687,7 @@ def warn_cxx98_compat_extern_template : Warning<
def warn_static_inline_explicit_inst_ignored : Warning< def warn_static_inline_explicit_inst_ignored : Warning<
"ignoring '%select{static|inline}0' keyword on explicit template " "ignoring '%select{static|inline}0' keyword on explicit template "
"instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>; "instantiation">, InGroup<DiagGroup<"static-inline-explicit-instantiation">>;
// Constructor template diagnostics. // Constructor template diagnostics.
def err_out_of_line_constructor_template_id : Error< def err_out_of_line_constructor_template_id : Error<
"out-of-line constructor for %0 cannot have template arguments">; "out-of-line constructor for %0 cannot have template arguments">;
@ -703,7 +703,7 @@ def err_expected_type_name_after_typename : Error<
"expected an identifier or template-id after '::'">; "expected an identifier or template-id after '::'">;
def err_explicit_spec_non_template : Error< def err_explicit_spec_non_template : Error<
"explicit %select{specialization|instantiation}0 of non-template %1 %2">; "explicit %select{specialization|instantiation}0 of non-template %1 %2">;
def err_default_template_template_parameter_not_template : Error< def err_default_template_template_parameter_not_template : Error<
"default template argument for a template template parameter must be a class " "default template argument for a template template parameter must be a class "
"template">; "template">;
@ -850,7 +850,7 @@ def err_zero_version : Error<
"version number must have non-zero major, minor, or sub-minor version">; "version number must have non-zero major, minor, or sub-minor version">;
def err_availability_expected_platform : Error< def err_availability_expected_platform : Error<
"expected a platform name, e.g., 'macos'">; "expected a platform name, e.g., 'macos'">;
// objc_bridge_related attribute // objc_bridge_related attribute
def err_objcbridge_related_expected_related_class : Error< def err_objcbridge_related_expected_related_class : Error<
"expected a related ObjectiveC class name, e.g., 'NSColor'">; "expected a related ObjectiveC class name, e.g., 'NSColor'">;
@ -994,7 +994,7 @@ def warn_pragma_init_seg_unsupported_target : Warning<
// - #pragma fp_contract // - #pragma fp_contract
def err_pragma_fp_contract_scope : Error< def err_pragma_fp_contract_scope : Error<
"'#pragma fp_contract' can only appear at file scope or at the start of a " "'#pragma fp_contract' can only appear at file scope or at the start of a "
"compound statement">; "compound statement">;
// - #pragma stdc unknown // - #pragma stdc unknown
def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">, def ext_stdc_pragma_ignored : ExtWarn<"unknown pragma in STDC namespace">,
InGroup<UnknownPragmas>; InGroup<UnknownPragmas>;

View File

@ -243,7 +243,7 @@ def err_invalid_vector_double_decl_spec : Error <
"(available on POWER7 or later)">; "(available on POWER7 or later)">;
def err_invalid_vector_long_long_decl_spec : Error < def err_invalid_vector_long_long_decl_spec : Error <
"use of 'long long' with '__vector bool' requires VSX support (available on " "use of 'long long' with '__vector bool' requires VSX support (available on "
"POWER7 or later) or extended Altivec support (available on POWER8 or later) " "POWER7 or later) or extended Altivec support (available on POWER8 or later) "
"to be enabled">; "to be enabled">;
def err_invalid_vector_long_double_decl_spec : Error< def err_invalid_vector_long_double_decl_spec : Error<
"cannot use 'long double' with '__vector'">; "cannot use 'long double' with '__vector'">;
@ -388,7 +388,7 @@ def err_inline_non_function : Error<
"'inline' can only appear on functions%select{| and non-local variables}0">; "'inline' can only appear on functions%select{| and non-local variables}0">;
def err_noreturn_non_function : Error< def err_noreturn_non_function : Error<
"'_Noreturn' can only appear on functions">; "'_Noreturn' can only appear on functions">;
def warn_qual_return_type : Warning< def warn_qual_return_type : Warning<
"'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">, "'%0' type qualifier%s1 on return type %plural{1:has|:have}1 no effect">,
InGroup<IgnoredQualifiers>, DefaultIgnore; InGroup<IgnoredQualifiers>, DefaultIgnore;
def warn_deprecated_redundant_constexpr_static_def : Warning< def warn_deprecated_redundant_constexpr_static_def : Warning<
@ -640,8 +640,8 @@ def warn_dyn_class_memaccess : Warning<
def note_bad_memaccess_silence : Note< def note_bad_memaccess_silence : Note<
"explicitly cast the pointer to silence this warning">; "explicitly cast the pointer to silence this warning">;
def warn_sizeof_pointer_expr_memaccess : Warning< def warn_sizeof_pointer_expr_memaccess : Warning<
"'%0' call operates on objects of type %1 while the size is based on a " "'%0' call operates on objects of type %1 while the size is based on a "
"different type %2">, "different type %2">,
InGroup<SizeofPointerMemaccess>; InGroup<SizeofPointerMemaccess>;
def warn_sizeof_pointer_expr_memaccess_note : Note< def warn_sizeof_pointer_expr_memaccess_note : Note<
"did you mean to %select{dereference the argument to 'sizeof' (and multiply " "did you mean to %select{dereference the argument to 'sizeof' (and multiply "
@ -679,14 +679,14 @@ def note_suspicious_bzero_size_silence : Note<
"parenthesize the second argument to silence">; "parenthesize the second argument to silence">;
def warn_strncat_large_size : Warning< def warn_strncat_large_size : Warning<
"the value of the size argument in 'strncat' is too large, might lead to a " "the value of the size argument in 'strncat' is too large, might lead to a "
"buffer overflow">, InGroup<StrncatSize>; "buffer overflow">, InGroup<StrncatSize>;
def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears " def warn_strncat_src_size : Warning<"size argument in 'strncat' call appears "
"to be size of the source">, InGroup<StrncatSize>; "to be size of the source">, InGroup<StrncatSize>;
def warn_strncat_wrong_size : Warning< def warn_strncat_wrong_size : Warning<
"the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>; "the value of the size argument to 'strncat' is wrong">, InGroup<StrncatSize>;
def note_strncat_wrong_size : Note< def note_strncat_wrong_size : Note<
"change the argument to be the free space in the destination buffer minus " "change the argument to be the free space in the destination buffer minus "
"the terminating null byte">; "the terminating null byte">;
def warn_assume_side_effects : Warning< def warn_assume_side_effects : Warning<
@ -1030,15 +1030,15 @@ def note_property_attribute : Note<"property %0 is declared "
"%select{deprecated|unavailable|partial}1 here">; "%select{deprecated|unavailable|partial}1 here">;
def err_setter_type_void : Error<"type of setter must be void">; def err_setter_type_void : Error<"type of setter must be void">;
def err_duplicate_method_decl : Error<"duplicate declaration of method %0">; def err_duplicate_method_decl : Error<"duplicate declaration of method %0">;
def warn_duplicate_method_decl : def warn_duplicate_method_decl :
Warning<"multiple declarations of method %0 found and ignored">, Warning<"multiple declarations of method %0 found and ignored">,
InGroup<MethodDuplicate>, DefaultIgnore; InGroup<MethodDuplicate>, DefaultIgnore;
def warn_objc_cdirective_format_string : def warn_objc_cdirective_format_string :
Warning<"using %0 directive in %select{NSString|CFString}1 " Warning<"using %0 directive in %select{NSString|CFString}1 "
"which is being passed as a formatting argument to the formatting " "which is being passed as a formatting argument to the formatting "
"%select{method|CFfunction}2">, "%select{method|CFfunction}2">,
InGroup<ObjCCStringFormat>, DefaultIgnore; InGroup<ObjCCStringFormat>, DefaultIgnore;
def err_objc_var_decl_inclass : def err_objc_var_decl_inclass :
Error<"cannot declare variable inside @interface or @protocol">; Error<"cannot declare variable inside @interface or @protocol">;
def err_missing_method_context : Error< def err_missing_method_context : Error<
"missing context for method declaration">; "missing context for method declaration">;
@ -1250,7 +1250,7 @@ def warn_auto_implicit_atomic_property : Warning<
"property is assumed atomic when auto-synthesizing the property">, "property is assumed atomic when auto-synthesizing the property">,
InGroup<ImplicitAtomic>, DefaultIgnore; InGroup<ImplicitAtomic>, DefaultIgnore;
def warn_unimplemented_selector: Warning< def warn_unimplemented_selector: Warning<
"no method with selector %0 is implemented in this translation unit">, "no method with selector %0 is implemented in this translation unit">,
InGroup<Selector>, DefaultIgnore; InGroup<Selector>, DefaultIgnore;
def warn_unimplemented_protocol_method : Warning< def warn_unimplemented_protocol_method : Warning<
"method %0 in protocol %1 not implemented">, InGroup<Protocol>; "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
@ -1379,7 +1379,7 @@ def err_capture_default_non_local : Error<
"non-local lambda expression cannot have a capture-default">; "non-local lambda expression cannot have a capture-default">;
def err_multiple_final_overriders : Error< def err_multiple_final_overriders : Error<
"virtual function %q0 has more than one final overrider in %1">; "virtual function %q0 has more than one final overrider in %1">;
def note_final_overrider : Note<"final overrider of %q0 in %1">; def note_final_overrider : Note<"final overrider of %q0 in %1">;
def err_type_defined_in_type_specifier : Error< def err_type_defined_in_type_specifier : Error<
@ -1421,7 +1421,7 @@ def warn_weak_template_vtable : Warning<
def ext_using_undefined_std : ExtWarn< def ext_using_undefined_std : ExtWarn<
"using directive refers to implicitly-defined namespace 'std'">; "using directive refers to implicitly-defined namespace 'std'">;
// C++ exception specifications // C++ exception specifications
def err_exception_spec_in_typedef : Error< def err_exception_spec_in_typedef : Error<
"exception specifications are not allowed in %select{typedefs|type aliases}0">; "exception specifications are not allowed in %select{typedefs|type aliases}0">;
@ -1475,7 +1475,7 @@ def ext_ms_using_declaration_inaccessible : ExtWarn<
"to accessible member '%1') is a Microsoft compatibility extension">, "to accessible member '%1') is a Microsoft compatibility extension">,
AccessControl, InGroup<MicrosoftUsingDecl>; AccessControl, InGroup<MicrosoftUsingDecl>;
def err_access_ctor : Error< def err_access_ctor : Error<
"calling a %select{private|protected}0 constructor of class %2">, "calling a %select{private|protected}0 constructor of class %2">,
AccessControl; AccessControl;
def ext_rvalue_to_reference_access_ctor : Extension< def ext_rvalue_to_reference_access_ctor : Extension<
"C++98 requires an accessible copy constructor for class %2 when binding " "C++98 requires an accessible copy constructor for class %2 when binding "
@ -1498,7 +1498,7 @@ def err_access_friend_function : Error<
AccessControl; AccessControl;
def err_access_dtor : Error< def err_access_dtor : Error<
"calling a %select{private|protected}1 destructor of class %0">, "calling a %select{private|protected}1 destructor of class %0">,
AccessControl; AccessControl;
def err_access_dtor_base : def err_access_dtor_base :
Error<"base class %0 has %select{private|protected}1 destructor">, Error<"base class %0 has %select{private|protected}1 destructor">,
@ -1540,7 +1540,7 @@ def note_access_protected_restricted_object : Note<
def warn_cxx98_compat_sfinae_access_control : Warning< def warn_cxx98_compat_sfinae_access_control : Warning<
"substitution failure due to access control is incompatible with C++98">, "substitution failure due to access control is incompatible with C++98">,
InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE; InGroup<CXX98Compat>, DefaultIgnore, NoSFINAE;
// C++ name lookup // C++ name lookup
def err_incomplete_nested_name_spec : Error< def err_incomplete_nested_name_spec : Error<
"incomplete type %0 named in nested name specifier">; "incomplete type %0 named in nested name specifier">;
@ -1981,7 +1981,7 @@ def note_explicit_ctor_deduction_guide_here : Note<
// C++11 decltype // C++11 decltype
def err_decltype_in_declarator : Error< def err_decltype_in_declarator : Error<
"'decltype' cannot be used to name a declaration">; "'decltype' cannot be used to name a declaration">;
// C++11 auto // C++11 auto
def warn_cxx98_compat_auto_type_specifier : Warning< def warn_cxx98_compat_auto_type_specifier : Warning<
"'auto' type specifier is incompatible with C++98">, "'auto' type specifier is incompatible with C++98">,
@ -2634,7 +2634,7 @@ def warn_objc_literal_comparison : Warning<
def err_missing_atsign_prefix : Error< def err_missing_atsign_prefix : Error<
"string literal must be prefixed by '@' ">; "string literal must be prefixed by '@' ">;
def warn_objc_string_literal_comparison : Warning< def warn_objc_string_literal_comparison : Warning<
"direct comparison of a string literal has undefined behavior">, "direct comparison of a string literal has undefined behavior">,
InGroup<ObjCStringComparison>; InGroup<ObjCStringComparison>;
def warn_concatenated_nsarray_literal : Warning< def warn_concatenated_nsarray_literal : Warning<
"concatenated NSString literal for an NSArray expression - " "concatenated NSString literal for an NSArray expression - "
@ -2748,7 +2748,7 @@ def warn_cxx11_gnu_attribute_on_type : Warning<
"attribute %0 ignored, because it cannot be applied to a type">, "attribute %0 ignored, because it cannot be applied to a type">,
InGroup<IgnoredAttributes>; InGroup<IgnoredAttributes>;
def warn_unhandled_ms_attribute_ignored : Warning< def warn_unhandled_ms_attribute_ignored : Warning<
"__declspec attribute %0 is not supported">, "__declspec attribute %0 is not supported">,
InGroup<IgnoredAttributes>; InGroup<IgnoredAttributes>;
def err_decl_attribute_invalid_on_stmt : Error< def err_decl_attribute_invalid_on_stmt : Error<
"%0 attribute cannot be applied to a statement">; "%0 attribute cannot be applied to a statement">;
@ -3003,7 +3003,7 @@ def err_attribute_argument_out_of_range : Error<
"1:can only be 1, since there is one parameter|" "1:can only be 1, since there is one parameter|"
":must be between 1 and %2}2">; ":must be between 1 and %2}2">;
// Thread Safety Analysis // Thread Safety Analysis
def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">, def warn_unlock_but_no_lock : Warning<"releasing %0 '%1' that was not held">,
InGroup<ThreadSafetyAnalysis>, DefaultIgnore; InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
def warn_unlock_kind_mismatch : Warning< def warn_unlock_kind_mismatch : Warning<
@ -3017,7 +3017,7 @@ def warn_no_unlock : Warning<
InGroup<ThreadSafetyAnalysis>, DefaultIgnore; InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
def warn_expecting_locked : Warning< def warn_expecting_locked : Warning<
"expecting %0 '%1' to be held at the end of function">, "expecting %0 '%1' to be held at the end of function">,
InGroup<ThreadSafetyAnalysis>, DefaultIgnore; InGroup<ThreadSafetyAnalysis>, DefaultIgnore;
// FIXME: improve the error message about locks not in scope // FIXME: improve the error message about locks not in scope
def warn_lock_some_predecessors : Warning< def warn_lock_some_predecessors : Warning<
"%0 '%1' is not held on every path through here">, "%0 '%1' is not held on every path through here">,
@ -3094,13 +3094,13 @@ def warn_fun_requires_lock_precise :
def note_found_mutex_near_match : Note<"found near match '%0'">; def note_found_mutex_near_match : Note<"found near match '%0'">;
// Verbose thread safety warnings // Verbose thread safety warnings
def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">, def warn_thread_safety_verbose : Warning<"Thread safety verbose warning.">,
InGroup<ThreadSafetyVerbose>, DefaultIgnore; InGroup<ThreadSafetyVerbose>, DefaultIgnore;
def note_thread_warning_in_fun : Note<"Thread warning in function %0">; def note_thread_warning_in_fun : Note<"Thread warning in function %0">;
def note_guarded_by_declared_here : Note<"Guarded_by declared here.">; def note_guarded_by_declared_here : Note<"Guarded_by declared here.">;
// Dummy warning that will trigger "beta" warnings from the analysis if enabled. // Dummy warning that will trigger "beta" warnings from the analysis if enabled.
def warn_thread_safety_beta : Warning<"Thread safety beta warning.">, def warn_thread_safety_beta : Warning<"Thread safety beta warning.">,
InGroup<ThreadSafetyBeta>, DefaultIgnore; InGroup<ThreadSafetyBeta>, DefaultIgnore;
// Consumed warnings // Consumed warnings
@ -3356,7 +3356,7 @@ def err_attribute_sentinel_not_zero_or_one : Error<
"'sentinel' parameter 2 not 0 or 1">; "'sentinel' parameter 2 not 0 or 1">;
def warn_cleanup_ext : Warning< def warn_cleanup_ext : Warning<
"GCC does not allow the 'cleanup' attribute argument to be anything other " "GCC does not allow the 'cleanup' attribute argument to be anything other "
"than a simple identifier">, "than a simple identifier">,
InGroup<GccCompat>; InGroup<GccCompat>;
def err_attribute_cleanup_arg_not_function : Error< def err_attribute_cleanup_arg_not_function : Error<
"'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">; "'cleanup' argument %select{|%1 |%1 }0is not a %select{||single }0function">;
@ -3391,7 +3391,7 @@ def warn_iboutlet_object_type : Warning<
def warn_iboutletcollection_property_assign : Warning< def warn_iboutletcollection_property_assign : Warning<
"IBOutletCollection properties should be copy/strong and not assign">, "IBOutletCollection properties should be copy/strong and not assign">,
InGroup<ObjCInvalidIBOutletProperty>; InGroup<ObjCInvalidIBOutletProperty>;
def err_attribute_overloadable_mismatch : Error< def err_attribute_overloadable_mismatch : Error<
"redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">; "redeclaration of %0 must %select{not |}1have the 'overloadable' attribute">;
def note_attribute_overloadable_prev_overload : Note< def note_attribute_overloadable_prev_overload : Note<
@ -3856,7 +3856,7 @@ def note_template_param_different_kind : Note<
def err_invalid_decl_specifier_in_nontype_parm : Error< def err_invalid_decl_specifier_in_nontype_parm : Error<
"invalid declaration specifier in template non-type parameter">; "invalid declaration specifier in template non-type parameter">;
def err_template_nontype_parm_different_type : Error< def err_template_nontype_parm_different_type : Error<
"template non-type parameter has a different type %0 in template " "template non-type parameter has a different type %0 in template "
"%select{|template parameter }1redeclaration">; "%select{|template parameter }1redeclaration">;
@ -4158,7 +4158,7 @@ def err_dependent_typed_non_type_arg_in_partial_spec : Error<
def err_partial_spec_args_match_primary_template : Error< def err_partial_spec_args_match_primary_template : Error<
"%select{class|variable}0 template partial specialization does not " "%select{class|variable}0 template partial specialization does not "
"specialize any template argument; to %select{declare|define}1 the " "specialize any template argument; to %select{declare|define}1 the "
"primary template, remove the template argument list">; "primary template, remove the template argument list">;
def ext_partial_spec_not_more_specialized_than_primary : ExtWarn< def ext_partial_spec_not_more_specialized_than_primary : ExtWarn<
"%select{class|variable}0 template partial specialization is not " "%select{class|variable}0 template partial specialization is not "
"more specialized than the primary template">, DefaultError, "more specialized than the primary template">, DefaultError,
@ -4193,7 +4193,7 @@ def err_var_spec_no_template : Error<
def err_var_spec_no_template_but_method : Error< def err_var_spec_no_template_but_method : Error<
"no variable template matches specialization; " "no variable template matches specialization; "
"did you mean to use %0 as function template instead?">; "did you mean to use %0 as function template instead?">;
// C++ Function template specializations // C++ Function template specializations
def err_function_template_spec_no_match : Error< def err_function_template_spec_no_match : Error<
"no function template matches function template specialization %0">; "no function template matches function template specialization %0">;
@ -4314,12 +4314,12 @@ def err_explicit_instantiation_out_of_scope : Error<
def err_explicit_instantiation_must_be_global : Error< def err_explicit_instantiation_must_be_global : Error<
"explicit instantiation of %0 must occur at global scope">; "explicit instantiation of %0 must occur at global scope">;
def warn_explicit_instantiation_out_of_scope_0x : Warning< def warn_explicit_instantiation_out_of_scope_0x : Warning<
"explicit instantiation of %0 not in a namespace enclosing %1">, "explicit instantiation of %0 not in a namespace enclosing %1">,
InGroup<CXX11Compat>, DefaultIgnore; InGroup<CXX11Compat>, DefaultIgnore;
def warn_explicit_instantiation_must_be_global_0x : Warning< def warn_explicit_instantiation_must_be_global_0x : Warning<
"explicit instantiation of %0 must occur at global scope">, "explicit instantiation of %0 must occur at global scope">,
InGroup<CXX11Compat>, DefaultIgnore; InGroup<CXX11Compat>, DefaultIgnore;
def err_explicit_instantiation_requires_name : Error< def err_explicit_instantiation_requires_name : Error<
"explicit instantiation declaration requires a name">; "explicit instantiation declaration requires a name">;
def err_explicit_instantiation_of_typedef : Error< def err_explicit_instantiation_of_typedef : Error<
@ -4380,7 +4380,7 @@ def err_mismatched_exception_spec_explicit_instantiation : Error<
def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn< def ext_mismatched_exception_spec_explicit_instantiation : ExtWarn<
err_mismatched_exception_spec_explicit_instantiation.Text>, err_mismatched_exception_spec_explicit_instantiation.Text>,
InGroup<MicrosoftExceptionSpec>; InGroup<MicrosoftExceptionSpec>;
// C++ typename-specifiers // C++ typename-specifiers
def err_typename_nested_not_found : Error<"no type named %0 in %1">; def err_typename_nested_not_found : Error<"no type named %0 in %1">;
def err_typename_nested_not_found_enable_if : Error< def err_typename_nested_not_found_enable_if : Error<
@ -4458,7 +4458,7 @@ def note_template_parameter_pack_non_pack : Note<
def note_template_parameter_pack_here : Note< def note_template_parameter_pack_here : Note<
"previous %select{template type|non-type template|template template}0 " "previous %select{template type|non-type template|template template}0 "
"parameter%select{| pack}1 declared here">; "parameter%select{| pack}1 declared here">;
def err_unexpanded_parameter_pack : Error< def err_unexpanded_parameter_pack : Error<
"%select{expression|base type|declaration type|data member type|bit-field " "%select{expression|base type|declaration type|data member type|bit-field "
"size|static assertion|fixed underlying type|enumerator value|" "size|static assertion|fixed underlying type|enumerator value|"
@ -4562,7 +4562,7 @@ def warn_missing_prototype : Warning<
"no previous prototype for function %0">, "no previous prototype for function %0">,
InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore; InGroup<DiagGroup<"missing-prototypes">>, DefaultIgnore;
def note_declaration_not_a_prototype : Note< def note_declaration_not_a_prototype : Note<
"this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">; "this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function">;
def warn_strict_prototypes : Warning< def warn_strict_prototypes : Warning<
"this %select{function declaration is not|block declaration is not|" "this %select{function declaration is not|block declaration is not|"
"old-style function definition is not preceded by}0 a prototype">, "old-style function definition is not preceded by}0 a prototype">,
@ -4770,7 +4770,7 @@ def ext_ms_forward_ref_enum : ExtWarn<
def ext_forward_ref_enum_def : Extension< def ext_forward_ref_enum_def : Extension<
"redeclaration of already-defined enum %0 is a GNU extension">, "redeclaration of already-defined enum %0 is a GNU extension">,
InGroup<GNURedeclaredEnum>; InGroup<GNURedeclaredEnum>;
def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">; def err_redefinition_of_enumerator : Error<"redefinition of enumerator %0">;
def err_duplicate_member : Error<"duplicate member %0">; def err_duplicate_member : Error<"duplicate member %0">;
def err_misplaced_ivar : Error< def err_misplaced_ivar : Error<
@ -4789,7 +4789,7 @@ def ext_enumerator_increment_too_large : ExtWarn<
def warn_flag_enum_constant_out_of_range : Warning< def warn_flag_enum_constant_out_of_range : Warning<
"enumeration value %0 is out of range of flags in enumeration type %1">, "enumeration value %0 is out of range of flags in enumeration type %1">,
InGroup<FlagEnum>; InGroup<FlagEnum>;
def warn_illegal_constant_array_size : Extension< def warn_illegal_constant_array_size : Extension<
"size of static array must be an integer constant expression">; "size of static array must be an integer constant expression">;
def err_vm_decl_in_file_scope : Error< def err_vm_decl_in_file_scope : Error<
@ -4894,7 +4894,7 @@ def err_illegal_initializer : Error<
"illegal initializer (only variables can be initialized)">; "illegal initializer (only variables can be initialized)">;
def err_illegal_initializer_type : Error<"illegal initializer type %0">; def err_illegal_initializer_type : Error<"illegal initializer type %0">;
def ext_init_list_type_narrowing : ExtWarn< def ext_init_list_type_narrowing : ExtWarn<
"type %0 cannot be narrowed to %1 in initializer list">, "type %0 cannot be narrowed to %1 in initializer list">,
InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure; InGroup<CXX11Narrowing>, DefaultError, SFINAEFailure;
def ext_init_list_variable_narrowing : ExtWarn< def ext_init_list_variable_narrowing : ExtWarn<
"non-constant-expression cannot be narrowed from type %0 to %1 in " "non-constant-expression cannot be narrowed from type %0 to %1 in "
@ -5232,9 +5232,9 @@ def err_arc_illegal_method_def : Error<
def warn_arc_strong_pointer_objc_pointer : Warning< def warn_arc_strong_pointer_objc_pointer : Warning<
"method parameter of type %0 with no explicit ownership">, "method parameter of type %0 with no explicit ownership">,
InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore; InGroup<DiagGroup<"explicit-ownership-type">>, DefaultIgnore;
} // end "ARC Restrictions" category } // end "ARC Restrictions" category
def err_arc_lost_method_convention : Error< def err_arc_lost_method_convention : Error<
"method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 " "method was declared as %select{an 'alloc'|a 'copy'|an 'init'|a 'new'}0 "
"method, but its implementation doesn't match because %select{" "method, but its implementation doesn't match because %select{"
@ -5303,7 +5303,7 @@ def warn_receiver_forward_instance : Warning<
InGroup<ForwardClassReceiver>, DefaultIgnore; InGroup<ForwardClassReceiver>, DefaultIgnore;
def err_arc_collection_forward : Error< def err_arc_collection_forward : Error<
"collection expression type %0 is a forward declaration">; "collection expression type %0 is a forward declaration">;
def err_arc_multiple_method_decl : Error< def err_arc_multiple_method_decl : Error<
"multiple methods named %0 found with mismatched result, " "multiple methods named %0 found with mismatched result, "
"parameter type or attributes">; "parameter type or attributes">;
def warn_arc_lifetime_result_type : Warning< def warn_arc_lifetime_result_type : Warning<
@ -5696,7 +5696,7 @@ def warn_namespace_member_extra_qualification : Warning<
"extra qualification on member %0">, "extra qualification on member %0">,
InGroup<DiagGroup<"extra-qualification">>; InGroup<DiagGroup<"extra-qualification">>;
def err_member_qualification : Error< def err_member_qualification : Error<
"non-friend class member %0 cannot have a qualified name">; "non-friend class member %0 cannot have a qualified name">;
def note_member_def_close_match : Note<"member declaration nearly matches">; def note_member_def_close_match : Note<"member declaration nearly matches">;
def note_member_def_close_const_match : Note< def note_member_def_close_const_match : Note<
"member declaration does not match because " "member declaration does not match because "
@ -5802,7 +5802,7 @@ def err_typecheck_invalid_lvalue_addrof_addrof_function : Error<
def err_typecheck_invalid_lvalue_addrof : Error< def err_typecheck_invalid_lvalue_addrof : Error<
"cannot take the address of an rvalue of type %0">; "cannot take the address of an rvalue of type %0">;
def ext_typecheck_addrof_temporary : ExtWarn< def ext_typecheck_addrof_temporary : ExtWarn<
"taking the address of a temporary object of type %0">, "taking the address of a temporary object of type %0">,
InGroup<AddressOfTemporary>, DefaultError; InGroup<AddressOfTemporary>, DefaultError;
def err_typecheck_addrof_temporary : Error< def err_typecheck_addrof_temporary : Error<
"taking the address of a temporary object of type %0">; "taking the address of a temporary object of type %0">;
@ -5913,7 +5913,7 @@ def warn_mixed_sign_comparison : Warning<
"comparison of integers of different signs: %0 and %1">, "comparison of integers of different signs: %0 and %1">,
InGroup<SignCompare>, DefaultIgnore; InGroup<SignCompare>, DefaultIgnore;
def warn_out_of_range_compare : Warning< def warn_out_of_range_compare : Warning<
"result of comparison of %select{constant %0|true|false}1 with " "result of comparison of %select{constant %0|true|false}1 with "
"%select{expression of type %2|boolean expression}3 is always %4">, "%select{expression of type %2|boolean expression}3 is always %4">,
InGroup<TautologicalOutOfRangeCompare>; InGroup<TautologicalOutOfRangeCompare>;
def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>, def warn_tautological_bool_compare : Warning<warn_out_of_range_compare.Text>,
@ -6071,7 +6071,7 @@ def err_no_subobject_property_setting : Error<
"expression is not assignable">; "expression is not assignable">;
def err_qualified_objc_access : Error< def err_qualified_objc_access : Error<
"%select{property|instance variable}0 access cannot be qualified with '%1'">; "%select{property|instance variable}0 access cannot be qualified with '%1'">;
def ext_freestanding_complex : Extension< def ext_freestanding_complex : Extension<
"complex numbers are an extension in a freestanding C99 implementation">; "complex numbers are an extension in a freestanding C99 implementation">;
@ -6237,13 +6237,13 @@ def warn_cxx98_compat_cast_fn_obj : Warning<
def err_bad_reinterpret_cast_small_int : Error< def err_bad_reinterpret_cast_small_int : Error<
"cast from pointer to smaller type %2 loses information">; "cast from pointer to smaller type %2 loses information">;
def err_bad_cxx_cast_vector_to_scalar_different_size : Error< def err_bad_cxx_cast_vector_to_scalar_different_size : Error<
"%select{||reinterpret_cast||C-style cast|}0 from vector %1 " "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
"to scalar %2 of different size">; "to scalar %2 of different size">;
def err_bad_cxx_cast_scalar_to_vector_different_size : Error< def err_bad_cxx_cast_scalar_to_vector_different_size : Error<
"%select{||reinterpret_cast||C-style cast|}0 from scalar %1 " "%select{||reinterpret_cast||C-style cast|}0 from scalar %1 "
"to vector %2 of different size">; "to vector %2 of different size">;
def err_bad_cxx_cast_vector_to_vector_different_size : Error< def err_bad_cxx_cast_vector_to_vector_different_size : Error<
"%select{||reinterpret_cast||C-style cast|}0 from vector %1 " "%select{||reinterpret_cast||C-style cast|}0 from vector %1 "
"to vector %2 of different size">; "to vector %2 of different size">;
def err_bad_lvalue_to_rvalue_cast : Error< def err_bad_lvalue_to_rvalue_cast : Error<
"cannot cast from lvalue of type %1 to rvalue reference type %2; types are " "cannot cast from lvalue of type %1 to rvalue reference type %2; types are "
@ -6645,7 +6645,7 @@ def err_typecheck_nonviable_condition_incomplete : Error<
def err_typecheck_deleted_function : Error< def err_typecheck_deleted_function : Error<
"conversion function %diff{from $ to $|between types}0,1 " "conversion function %diff{from $ to $|between types}0,1 "
"invokes a deleted function">; "invokes a deleted function">;
def err_expected_class_or_namespace : Error<"%0 is not a class" def err_expected_class_or_namespace : Error<"%0 is not a class"
"%select{ or namespace|, namespace, or enumeration}1">; "%select{ or namespace|, namespace, or enumeration}1">;
def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here " def err_invalid_declarator_scope : Error<"cannot define or redeclare %0 here "
@ -7013,11 +7013,11 @@ def err_typecheck_call_too_many_args_at_most_suggest : Error<
"too many %select{|||execution configuration }0arguments to " "too many %select{|||execution configuration }0arguments to "
"%select{function|block|method|kernel function}0 call, " "%select{function|block|method|kernel function}0 call, "
"expected at most %1, have %2; did you mean %3?">; "expected at most %1, have %2; did you mean %3?">;
def err_arc_typecheck_convert_incompatible_pointer : Error< def err_arc_typecheck_convert_incompatible_pointer : Error<
"incompatible pointer types passing retainable parameter of type %0" "incompatible pointer types passing retainable parameter of type %0"
"to a CF function expecting %1 type">; "to a CF function expecting %1 type">;
def err_builtin_fn_use : Error<"builtin functions must be directly called">; def err_builtin_fn_use : Error<"builtin functions must be directly called">;
def warn_call_wrong_number_of_arguments : Warning< def warn_call_wrong_number_of_arguments : Warning<
@ -7508,8 +7508,8 @@ def err_reference_to_local_in_enclosing_context : Error<
"%select{%3|block literal|lambda expression|context}2">; "%select{%3|block literal|lambda expression|context}2">;
def err_static_data_member_not_allowed_in_local_class : Error< def err_static_data_member_not_allowed_in_local_class : Error<
"static data member %0 not allowed in local class %1">; "static data member %0 not allowed in local class %1">;
// C++ derived classes // C++ derived classes
def err_base_clause_on_union : Error<"unions cannot have base classes">; def err_base_clause_on_union : Error<"unions cannot have base classes">;
def err_base_must_be_class : Error<"base specifier must name a class">; def err_base_must_be_class : Error<"base specifier must name a class">;
@ -8222,7 +8222,7 @@ def err_vector_incorrect_num_initializers : Error<
def err_altivec_empty_initializer : Error<"expected initializer">; def err_altivec_empty_initializer : Error<"expected initializer">;
def err_invalid_neon_type_code : Error< def err_invalid_neon_type_code : Error<
"incompatible constant for this __builtin_neon function">; "incompatible constant for this __builtin_neon function">;
def err_argument_invalid_range : Error< def err_argument_invalid_range : Error<
"argument value %0 is outside the valid range [%1, %2]">; "argument value %0 is outside the valid range [%1, %2]">;
def warn_argument_invalid_range : Warning< def warn_argument_invalid_range : Warning<
@ -8278,7 +8278,7 @@ def err_constant_integer_arg_type : Error<
def ext_mixed_decls_code : Extension< def ext_mixed_decls_code : Extension<
"ISO C90 forbids mixing declarations and code">, "ISO C90 forbids mixing declarations and code">,
InGroup<DiagGroup<"declaration-after-statement">>; InGroup<DiagGroup<"declaration-after-statement">>;
def err_non_local_variable_decl_in_for : Error< def err_non_local_variable_decl_in_for : Error<
"declaration of non-local variable in 'for' loop">; "declaration of non-local variable in 'for' loop">;
def err_non_variable_decl_in_for : Error< def err_non_variable_decl_in_for : Error<
@ -8346,7 +8346,7 @@ def warn_nsconsumed_attribute_mismatch : Warning<
err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>; err_nsconsumed_attribute_mismatch.Text>, InGroup<NSConsumedMismatch>;
def warn_nsreturns_retained_attribute_mismatch : Warning< def warn_nsreturns_retained_attribute_mismatch : Warning<
err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>; err_nsreturns_retained_attribute_mismatch.Text>, InGroup<NSReturnsMismatch>;
def note_getter_unavailable : Note< def note_getter_unavailable : Note<
"or because setter is declared here, but no getter method %0 is found">; "or because setter is declared here, but no getter method %0 is found">;
def err_invalid_protocol_qualifiers : Error< def err_invalid_protocol_qualifiers : Error<
@ -8602,7 +8602,7 @@ def err_opencl_extern_block_declaration : Error<
def err_opencl_block_ref_block : Error< def err_opencl_block_ref_block : Error<
"cannot refer to a block inside block">; "cannot refer to a block inside block">;
// OpenCL v2.0 s6.13.9 - Address space qualifier functions. // OpenCL v2.0 s6.13.9 - Address space qualifier functions.
def err_opencl_builtin_to_addr_arg_num : Error< def err_opencl_builtin_to_addr_arg_num : Error<
"invalid number of arguments to function: %0">; "invalid number of arguments to function: %0">;
def err_opencl_builtin_to_addr_invalid_arg : Error< def err_opencl_builtin_to_addr_invalid_arg : Error<

View File

@ -49,7 +49,7 @@ def err_pch_diagopt_mismatch : Error<"%0 is currently enabled, but was not in "
"the PCH file">; "the PCH file">;
def err_pch_modulecache_mismatch : Error<"PCH was compiled with module cache " def err_pch_modulecache_mismatch : Error<"PCH was compiled with module cache "
"path '%0', but the path is currently '%1'">; "path '%0', but the path is currently '%1'">;
def err_pch_version_too_old : Error< def err_pch_version_too_old : Error<
"PCH file uses an older PCH format that is no longer supported">; "PCH file uses an older PCH format that is no longer supported">;
def err_pch_version_too_new : Error< def err_pch_version_too_new : Error<

View File

@ -62,7 +62,7 @@ protected:
public: public:
virtual ~FileSystemStatCache() = default; virtual ~FileSystemStatCache() = default;
enum LookupResult { enum LookupResult {
/// We know the file exists and its cached stat data. /// We know the file exists and its cached stat data.
CacheExists, CacheExists,
@ -90,10 +90,10 @@ public:
void setNextStatCache(std::unique_ptr<FileSystemStatCache> Cache) { void setNextStatCache(std::unique_ptr<FileSystemStatCache> Cache) {
NextStatCache = std::move(Cache); NextStatCache = std::move(Cache);
} }
/// Retrieve the next stat call cache in the chain. /// Retrieve the next stat call cache in the chain.
FileSystemStatCache *getNextStatCache() { return NextStatCache.get(); } FileSystemStatCache *getNextStatCache() { return NextStatCache.get(); }
/// Retrieve the next stat call cache in the chain, transferring /// Retrieve the next stat call cache in the chain, transferring
/// ownership of this cache (and, transitively, all of the remaining caches) /// ownership of this cache (and, transitively, all of the remaining caches)
/// to the caller. /// to the caller.

View File

@ -63,7 +63,7 @@ class IdentifierInfo {
bool IsPoisoned : 1; // True if identifier is poisoned. bool IsPoisoned : 1; // True if identifier is poisoned.
bool IsCPPOperatorKeyword : 1; // True if ident is a C++ operator keyword. bool IsCPPOperatorKeyword : 1; // True if ident is a C++ operator keyword.
bool NeedsHandleIdentifier : 1; // See "RecomputeNeedsHandleIdentifier". bool NeedsHandleIdentifier : 1; // See "RecomputeNeedsHandleIdentifier".
bool IsFromAST : 1; // True if identifier was loaded (at least bool IsFromAST : 1; // True if identifier was loaded (at least
// partially) from an AST file. // partially) from an AST file.
bool ChangedAfterLoad : 1; // True if identifier has changed from the bool ChangedAfterLoad : 1; // True if identifier has changed from the
// definition loaded from an AST file. // definition loaded from an AST file.
@ -308,7 +308,7 @@ public:
bool hasChangedSinceDeserialization() const { bool hasChangedSinceDeserialization() const {
return ChangedAfterLoad; return ChangedAfterLoad;
} }
/// Note that this identifier has changed since it was loaded from /// Note that this identifier has changed since it was loaded from
/// an AST file. /// an AST file.
void setChangedSinceDeserialization() { void setChangedSinceDeserialization() {
@ -320,7 +320,7 @@ public:
bool hasFETokenInfoChangedSinceDeserialization() const { bool hasFETokenInfoChangedSinceDeserialization() const {
return FEChangedAfterLoad; return FEChangedAfterLoad;
} }
/// Note that the frontend token information for this identifier has /// Note that the frontend token information for this identifier has
/// changed since it was loaded from an AST file. /// changed since it was loaded from an AST file.
void setFETokenInfoChangedSinceDeserialization() { void setFETokenInfoChangedSinceDeserialization() {
@ -330,7 +330,7 @@ public:
/// Determine whether the information for this identifier is out of /// Determine whether the information for this identifier is out of
/// date with respect to the external source. /// date with respect to the external source.
bool isOutOfDate() const { return OutOfDate; } bool isOutOfDate() const { return OutOfDate; }
/// Set whether the information for this identifier is out of /// Set whether the information for this identifier is out of
/// date with respect to the external source. /// date with respect to the external source.
void setOutOfDate(bool OOD) { void setOutOfDate(bool OOD) {
@ -340,10 +340,10 @@ public:
else else
RecomputeNeedsHandleIdentifier(); RecomputeNeedsHandleIdentifier();
} }
/// Determine whether this is the contextual keyword \c import. /// Determine whether this is the contextual keyword \c import.
bool isModulesImport() const { return IsModulesImport; } bool isModulesImport() const { return IsModulesImport; }
/// Set whether this identifier is the contextual keyword \c import. /// Set whether this identifier is the contextual keyword \c import.
void setModulesImport(bool I) { void setModulesImport(bool I) {
IsModulesImport = I; IsModulesImport = I;
@ -419,7 +419,7 @@ public:
class IdentifierIterator { class IdentifierIterator {
protected: protected:
IdentifierIterator() = default; IdentifierIterator() = default;
public: public:
IdentifierIterator(const IdentifierIterator &) = delete; IdentifierIterator(const IdentifierIterator &) = delete;
IdentifierIterator &operator=(const IdentifierIterator &) = delete; IdentifierIterator &operator=(const IdentifierIterator &) = delete;
@ -490,7 +490,7 @@ public:
IdentifierInfoLookup *getExternalIdentifierLookup() const { IdentifierInfoLookup *getExternalIdentifierLookup() const {
return ExternalLookup; return ExternalLookup;
} }
llvm::BumpPtrAllocator& getAllocator() { llvm::BumpPtrAllocator& getAllocator() {
return HashTable.getAllocator(); return HashTable.getAllocator();
} }
@ -572,7 +572,7 @@ public:
void AddKeywords(const LangOptions &LangOpts); void AddKeywords(const LangOptions &LangOpts);
}; };
/// A family of Objective-C methods. /// A family of Objective-C methods.
/// ///
/// These families have no inherent meaning in the language, but are /// These families have no inherent meaning in the language, but are
/// nonetheless central enough in the existing implementations to /// nonetheless central enough in the existing implementations to
@ -687,13 +687,13 @@ class Selector {
MultiKeywordSelector *getMultiKeywordSelector() const { MultiKeywordSelector *getMultiKeywordSelector() const {
return reinterpret_cast<MultiKeywordSelector *>(InfoPtr & ~ArgFlags); return reinterpret_cast<MultiKeywordSelector *>(InfoPtr & ~ArgFlags);
} }
unsigned getIdentifierInfoFlag() const { unsigned getIdentifierInfoFlag() const {
return InfoPtr & ArgFlags; return InfoPtr & ArgFlags;
} }
static ObjCMethodFamily getMethodFamilyImpl(Selector sel); static ObjCMethodFamily getMethodFamilyImpl(Selector sel);
static ObjCStringFormatFamily getStringFormatFamilyImpl(Selector sel); static ObjCStringFormatFamily getStringFormatFamilyImpl(Selector sel);
public: public:
@ -730,11 +730,11 @@ public:
} }
unsigned getNumArgs() const; unsigned getNumArgs() const;
/// Retrieve the identifier at a given position in the selector. /// Retrieve the identifier at a given position in the selector.
/// ///
/// Note that the identifier pointer returned may be NULL. Clients that only /// Note that the identifier pointer returned may be NULL. Clients that only
/// care about the text of the identifier string, and not the specific, /// care about the text of the identifier string, and not the specific,
/// uniqued identifier pointer, should use \c getNameForSlot(), which returns /// uniqued identifier pointer, should use \c getNameForSlot(), which returns
/// an empty string when the identifier pointer would be NULL. /// an empty string when the identifier pointer would be NULL.
/// ///
@ -745,7 +745,7 @@ public:
/// \returns the uniqued identifier for this slot, or NULL if this slot has /// \returns the uniqued identifier for this slot, or NULL if this slot has
/// no corresponding identifier. /// no corresponding identifier.
IdentifierInfo *getIdentifierInfoForSlot(unsigned argIndex) const; IdentifierInfo *getIdentifierInfoForSlot(unsigned argIndex) const;
/// Retrieve the name at a given position in the selector. /// Retrieve the name at a given position in the selector.
/// ///
/// \param argIndex The index for which we want to retrieve the name. /// \param argIndex The index for which we want to retrieve the name.
@ -755,7 +755,7 @@ public:
/// \returns the name for this slot, which may be the empty string if no /// \returns the name for this slot, which may be the empty string if no
/// name was supplied. /// name was supplied.
StringRef getNameForSlot(unsigned argIndex) const; StringRef getNameForSlot(unsigned argIndex) const;
/// Derive the full selector name (e.g. "foo:bar:") and return /// Derive the full selector name (e.g. "foo:bar:") and return
/// it as an std::string. /// it as an std::string.
std::string getAsString() const; std::string getAsString() const;
@ -769,11 +769,11 @@ public:
ObjCMethodFamily getMethodFamily() const { ObjCMethodFamily getMethodFamily() const {
return getMethodFamilyImpl(*this); return getMethodFamilyImpl(*this);
} }
ObjCStringFormatFamily getStringFormatFamily() const { ObjCStringFormatFamily getStringFormatFamily() const {
return getStringFormatFamilyImpl(*this); return getStringFormatFamilyImpl(*this);
} }
static Selector getEmptyMarker() { static Selector getEmptyMarker() {
return Selector(uintptr_t(-1)); return Selector(uintptr_t(-1));
} }
@ -781,7 +781,7 @@ public:
static Selector getTombstoneMarker() { static Selector getTombstoneMarker() {
return Selector(uintptr_t(-2)); return Selector(uintptr_t(-2));
} }
static ObjCInstanceTypeFamily getInstTypeMethodFamily(Selector sel); static ObjCInstanceTypeFamily getInstTypeMethodFamily(Selector sel);
}; };
@ -901,7 +901,7 @@ struct PointerLikeTypeTraits<clang::Selector> {
return clang::Selector(reinterpret_cast<uintptr_t>(P)); return clang::Selector(reinterpret_cast<uintptr_t>(P));
} }
enum { NumLowBitsAvailable = 0 }; enum { NumLowBitsAvailable = 0 };
}; };
// Provide PointerLikeTypeTraits for IdentifierInfo pointers, which // Provide PointerLikeTypeTraits for IdentifierInfo pointers, which

View File

@ -59,7 +59,7 @@ namespace clang {
using llvm::dyn_cast; using llvm::dyn_cast;
using llvm::dyn_cast_or_null; using llvm::dyn_cast_or_null;
using llvm::cast_or_null; using llvm::cast_or_null;
// ADT's. // ADT's.
using llvm::ArrayRef; using llvm::ArrayRef;
using llvm::MutableArrayRef; using llvm::MutableArrayRef;

View File

@ -50,10 +50,10 @@ protected:
class LangOptions : public LangOptionsBase { class LangOptions : public LangOptionsBase {
public: public:
using Visibility = clang::Visibility; using Visibility = clang::Visibility;
enum GCMode { NonGC, GCOnly, HybridGC }; enum GCMode { NonGC, GCOnly, HybridGC };
enum StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq }; enum StackProtectorMode { SSPOff, SSPOn, SSPStrong, SSPReq };
enum SignedOverflowBehaviorTy { enum SignedOverflowBehaviorTy {
// Default C standard behavior. // Default C standard behavior.
SOB_Undefined, SOB_Undefined,
@ -165,7 +165,7 @@ public:
clang::ObjCRuntime ObjCRuntime; clang::ObjCRuntime ObjCRuntime;
std::string ObjCConstantStringClass; std::string ObjCConstantStringClass;
/// The name of the handler function to be called when -ftrapv is /// The name of the handler function to be called when -ftrapv is
/// specified. /// specified.
/// ///
@ -209,10 +209,10 @@ public:
LangOptions(); LangOptions();
// Define accessors/mutators for language options of enumeration type. // Define accessors/mutators for language options of enumeration type.
#define LANGOPT(Name, Bits, Default, Description) #define LANGOPT(Name, Bits, Default, Description)
#define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \ #define ENUM_LANGOPT(Name, Type, Bits, Default, Description) \
Type get##Name() const { return static_cast<Type>(Name); } \ Type get##Name() const { return static_cast<Type>(Name); } \
void set##Name(Type Value) { Name = static_cast<unsigned>(Value); } void set##Name(Type Value) { Name = static_cast<unsigned>(Value); }
#include "clang/Basic/LangOptions.def" #include "clang/Basic/LangOptions.def"
/// Are we compiling a module interface (.cppm or module map)? /// Are we compiling a module interface (.cppm or module map)?
@ -228,7 +228,7 @@ public:
bool isSignedOverflowDefined() const { bool isSignedOverflowDefined() const {
return getSignedOverflowBehavior() == SOB_Defined; return getSignedOverflowBehavior() == SOB_Defined;
} }
bool isSubscriptPointerArithmetic() const { bool isSubscriptPointerArithmetic() const {
return ObjCRuntime.isSubscriptPointerArithmetic() && return ObjCRuntime.isSubscriptPointerArithmetic() &&
!ObjCSubscriptingLegacyRuntime; !ObjCSubscriptingLegacyRuntime;
@ -309,7 +309,7 @@ enum TranslationUnitKind {
/// The translation unit is a module. /// The translation unit is a module.
TU_Module TU_Module
}; };
} // namespace clang } // namespace clang
#endif // LLVM_CLANG_BASIC_LANGOPTIONS_H #endif // LLVM_CLANG_BASIC_LANGOPTIONS_H

View File

@ -19,7 +19,7 @@
namespace clang { namespace clang {
/// Describes the different kinds of linkage /// Describes the different kinds of linkage
/// (C++ [basic.link], C99 6.2.2) that an entity may have. /// (C++ [basic.link], C99 6.2.2) that an entity may have.
enum Linkage : unsigned char { enum Linkage : unsigned char {
/// No linkage, which means that the entity is unique and /// No linkage, which means that the entity is unique and
@ -31,7 +31,7 @@ enum Linkage : unsigned char {
/// translation units). /// translation units).
InternalLinkage, InternalLinkage,
/// External linkage within a unique namespace. /// External linkage within a unique namespace.
/// ///
/// From the language perspective, these entities have external /// From the language perspective, these entities have external
/// linkage. However, since they reside in an anonymous namespace, /// linkage. However, since they reside in an anonymous namespace,

View File

@ -44,7 +44,7 @@ class raw_ostream;
} // namespace llvm } // namespace llvm
namespace clang { namespace clang {
class LangOptions; class LangOptions;
class TargetInfo; class TargetInfo;
@ -66,7 +66,7 @@ class Module {
public: public:
/// The name of this module. /// The name of this module.
std::string Name; std::string Name;
/// The location of the module definition. /// The location of the module definition.
SourceLocation DefinitionLoc; SourceLocation DefinitionLoc;
@ -111,12 +111,12 @@ public:
/// The module through which entities defined in this module will /// The module through which entities defined in this module will
/// eventually be exposed, for use in "private" modules. /// eventually be exposed, for use in "private" modules.
std::string ExportAsModule; std::string ExportAsModule;
private: private:
/// The submodules of this module, indexed by name. /// The submodules of this module, indexed by name.
std::vector<Module *> SubModules; std::vector<Module *> SubModules;
/// A mapping from the submodule name to the index into the /// A mapping from the submodule name to the index into the
/// \c SubModules vector at which that submodule resides. /// \c SubModules vector at which that submodule resides.
llvm::StringMap<unsigned> SubModuleIndex; llvm::StringMap<unsigned> SubModuleIndex;
@ -214,13 +214,13 @@ public:
/// Whether this module was loaded from a module file. /// Whether this module was loaded from a module file.
unsigned IsFromModuleFile : 1; unsigned IsFromModuleFile : 1;
/// Whether this is a framework module. /// Whether this is a framework module.
unsigned IsFramework : 1; unsigned IsFramework : 1;
/// Whether this is an explicit submodule. /// Whether this is an explicit submodule.
unsigned IsExplicit : 1; unsigned IsExplicit : 1;
/// Whether this is a "system" module (which assumes that all /// Whether this is a "system" module (which assumes that all
/// headers in it are system headers). /// headers in it are system headers).
unsigned IsSystem : 1; unsigned IsSystem : 1;
@ -233,16 +233,16 @@ public:
/// Whether this is an inferred submodule (module * { ... }). /// Whether this is an inferred submodule (module * { ... }).
unsigned IsInferred : 1; unsigned IsInferred : 1;
/// Whether we should infer submodules for this module based on /// Whether we should infer submodules for this module based on
/// the headers. /// the headers.
/// ///
/// Submodules can only be inferred for modules with an umbrella header. /// Submodules can only be inferred for modules with an umbrella header.
unsigned InferSubmodules : 1; unsigned InferSubmodules : 1;
/// Whether, when inferring submodules, the inferred submodules /// Whether, when inferring submodules, the inferred submodules
/// should be explicit. /// should be explicit.
unsigned InferExplicitSubmodules : 1; unsigned InferExplicitSubmodules : 1;
/// Whether, when inferring submodules, the inferr submodules should /// Whether, when inferring submodules, the inferr submodules should
/// export all modules they import (e.g., the equivalent of "export *"). /// export all modules they import (e.g., the equivalent of "export *").
unsigned InferExportWildcard : 1; unsigned InferExportWildcard : 1;
@ -280,31 +280,31 @@ public:
/// The set of modules imported by this module, and on which this /// The set of modules imported by this module, and on which this
/// module depends. /// module depends.
llvm::SmallSetVector<Module *, 2> Imports; llvm::SmallSetVector<Module *, 2> Imports;
/// Describes an exported module. /// Describes an exported module.
/// ///
/// The pointer is the module being re-exported, while the bit will be true /// The pointer is the module being re-exported, while the bit will be true
/// to indicate that this is a wildcard export. /// to indicate that this is a wildcard export.
using ExportDecl = llvm::PointerIntPair<Module *, 1, bool>; using ExportDecl = llvm::PointerIntPair<Module *, 1, bool>;
/// The set of export declarations. /// The set of export declarations.
SmallVector<ExportDecl, 2> Exports; SmallVector<ExportDecl, 2> Exports;
/// Describes an exported module that has not yet been resolved /// Describes an exported module that has not yet been resolved
/// (perhaps because the module it refers to has not yet been loaded). /// (perhaps because the module it refers to has not yet been loaded).
struct UnresolvedExportDecl { struct UnresolvedExportDecl {
/// The location of the 'export' keyword in the module map file. /// The location of the 'export' keyword in the module map file.
SourceLocation ExportLoc; SourceLocation ExportLoc;
/// The name of the module. /// The name of the module.
ModuleId Id; ModuleId Id;
/// Whether this export declaration ends in a wildcard, indicating /// Whether this export declaration ends in a wildcard, indicating
/// that all of its submodules should be exported (rather than the named /// that all of its submodules should be exported (rather than the named
/// module itself). /// module itself).
bool Wildcard; bool Wildcard;
}; };
/// The set of export declarations that have yet to be resolved. /// The set of export declarations that have yet to be resolved.
SmallVector<UnresolvedExportDecl, 2> UnresolvedExports; SmallVector<UnresolvedExportDecl, 2> UnresolvedExports;
@ -320,7 +320,7 @@ public:
LinkLibrary() = default; LinkLibrary() = default;
LinkLibrary(const std::string &Library, bool IsFramework) LinkLibrary(const std::string &Library, bool IsFramework)
: Library(Library), IsFramework(IsFramework) {} : Library(Library), IsFramework(IsFramework) {}
/// The library to link against. /// The library to link against.
/// ///
/// This will typically be a library or framework name, but can also /// This will typically be a library or framework name, but can also
@ -371,9 +371,9 @@ public:
/// Construct a new module or submodule. /// Construct a new module or submodule.
Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
bool IsFramework, bool IsExplicit, unsigned VisibilityID); bool IsFramework, bool IsExplicit, unsigned VisibilityID);
~Module(); ~Module();
/// Determine whether this module is available for use within the /// Determine whether this module is available for use within the
/// current translation unit. /// current translation unit.
bool isAvailable() const { return IsAvailable; } bool isAvailable() const { return IsAvailable; }
@ -395,7 +395,7 @@ public:
/// ///
/// \param ShadowingModule If this module is unavailable because it is /// \param ShadowingModule If this module is unavailable because it is
/// shadowed, this parameter will be set to the shadowing module. /// shadowed, this parameter will be set to the shadowing module.
bool isAvailable(const LangOptions &LangOpts, bool isAvailable(const LangOptions &LangOpts,
const TargetInfo &Target, const TargetInfo &Target,
Requirement &Req, Requirement &Req,
UnresolvedHeaderDirective &MissingHeader, UnresolvedHeaderDirective &MissingHeader,
@ -403,19 +403,19 @@ public:
/// Determine whether this module is a submodule. /// Determine whether this module is a submodule.
bool isSubModule() const { return Parent != nullptr; } bool isSubModule() const { return Parent != nullptr; }
/// Determine whether this module is a submodule of the given other /// Determine whether this module is a submodule of the given other
/// module. /// module.
bool isSubModuleOf(const Module *Other) const; bool isSubModuleOf(const Module *Other) const;
/// Determine whether this module is a part of a framework, /// Determine whether this module is a part of a framework,
/// either because it is a framework module or because it is a submodule /// either because it is a framework module or because it is a submodule
/// of a framework module. /// of a framework module.
bool isPartOfFramework() const { bool isPartOfFramework() const {
for (const Module *Mod = this; Mod; Mod = Mod->Parent) for (const Module *Mod = this; Mod; Mod = Mod->Parent)
if (Mod->IsFramework) if (Mod->IsFramework)
return true; return true;
return false; return false;
} }
@ -456,7 +456,7 @@ public:
/// Retrieve the top-level module for this (sub)module, which may /// Retrieve the top-level module for this (sub)module, which may
/// be this module. /// be this module.
const Module *getTopLevelModule() const; const Module *getTopLevelModule() const;
/// Retrieve the name of the top-level module. /// Retrieve the name of the top-level module.
StringRef getTopLevelModuleName() const { StringRef getTopLevelModuleName() const {
return getTopLevelModule()->Name; return getTopLevelModule()->Name;
@ -552,7 +552,7 @@ public:
using submodule_iterator = std::vector<Module *>::iterator; using submodule_iterator = std::vector<Module *>::iterator;
using submodule_const_iterator = std::vector<Module *>::const_iterator; using submodule_const_iterator = std::vector<Module *>::const_iterator;
submodule_iterator submodule_begin() { return SubModules.begin(); } submodule_iterator submodule_begin() { return SubModules.begin(); }
submodule_const_iterator submodule_begin() const {return SubModules.begin();} submodule_const_iterator submodule_begin() const {return SubModules.begin();}
submodule_iterator submodule_end() { return SubModules.end(); } submodule_iterator submodule_end() { return SubModules.end(); }
@ -575,9 +575,9 @@ public:
return "<module-includes>"; return "<module-includes>";
} }
/// Print the module map for this module to the given stream. /// Print the module map for this module to the given stream.
void print(raw_ostream &OS, unsigned Indent = 0) const; void print(raw_ostream &OS, unsigned Indent = 0) const;
/// Dump the contents of this module to the given output stream. /// Dump the contents of this module to the given output stream.
void dump() const; void dump() const;

View File

@ -154,7 +154,7 @@ public:
llvm_unreachable("bad kind"); llvm_unreachable("bad kind");
} }
/// Does this runtime natively provide the ARC entrypoints? /// Does this runtime natively provide the ARC entrypoints?
/// ///
/// ARC cannot be directly supported on a platform that does not provide /// ARC cannot be directly supported on a platform that does not provide
/// these entrypoints, although it may be supportable via a stub /// these entrypoints, although it may be supportable via a stub

View File

@ -27,7 +27,7 @@ enum OverloadedOperatorKind : int {
NUM_OVERLOADED_OPERATORS NUM_OVERLOADED_OPERATORS
}; };
/// Retrieve the spelling of the given overloaded operator, without /// Retrieve the spelling of the given overloaded operator, without
/// the preceding "operator" keyword. /// the preceding "operator" keyword.
const char *getOperatorSpelling(OverloadedOperatorKind Operator); const char *getOperatorSpelling(OverloadedOperatorKind Operator);

View File

@ -38,7 +38,7 @@ class SourceManager;
/// source file (MemoryBuffer) along with its \#include path and \#line data. /// source file (MemoryBuffer) along with its \#include path and \#line data.
/// ///
class FileID { class FileID {
/// A mostly-opaque identifier, where 0 is "invalid", >0 is /// A mostly-opaque identifier, where 0 is "invalid", >0 is
/// this module, and <-1 is something loaded from another module. /// this module, and <-1 is something loaded from another module.
int ID = 0; int ID = 0;
@ -60,7 +60,7 @@ private:
friend class ASTWriter; friend class ASTWriter;
friend class ASTReader; friend class ASTReader;
friend class SourceManager; friend class SourceManager;
static FileID get(int V) { static FileID get(int V) {
FileID F; FileID F;
F.ID = V; F.ID = V;
@ -221,7 +221,7 @@ public:
return B != X.B || E != X.E; return B != X.B || E != X.E;
} }
}; };
/// Represents a character-granular source range. /// Represents a character-granular source range.
/// ///
/// The underlying SourceRange can either specify the starting/ending character /// The underlying SourceRange can either specify the starting/ending character
@ -229,7 +229,7 @@ public:
/// last token of the range (a "token range"). In the token range case, the /// last token of the range (a "token range"). In the token range case, the
/// size of the last token must be measured to determine the actual end of the /// size of the last token must be measured to determine the actual end of the
/// range. /// range.
class CharSourceRange { class CharSourceRange {
SourceRange Range; SourceRange Range;
bool IsTokenRange = false; bool IsTokenRange = false;
@ -244,7 +244,7 @@ public:
static CharSourceRange getCharRange(SourceRange R) { static CharSourceRange getCharRange(SourceRange R) {
return CharSourceRange(R, false); return CharSourceRange(R, false);
} }
static CharSourceRange getTokenRange(SourceLocation B, SourceLocation E) { static CharSourceRange getTokenRange(SourceLocation B, SourceLocation E) {
return getTokenRange(SourceRange(B, E)); return getTokenRange(SourceRange(B, E));
} }
@ -252,21 +252,21 @@ public:
static CharSourceRange getCharRange(SourceLocation B, SourceLocation E) { static CharSourceRange getCharRange(SourceLocation B, SourceLocation E) {
return getCharRange(SourceRange(B, E)); return getCharRange(SourceRange(B, E));
} }
/// Return true if the end of this range specifies the start of /// Return true if the end of this range specifies the start of
/// the last token. Return false if the end of this range specifies the last /// the last token. Return false if the end of this range specifies the last
/// character in the range. /// character in the range.
bool isTokenRange() const { return IsTokenRange; } bool isTokenRange() const { return IsTokenRange; }
bool isCharRange() const { return !IsTokenRange; } bool isCharRange() const { return !IsTokenRange; }
SourceLocation getBegin() const { return Range.getBegin(); } SourceLocation getBegin() const { return Range.getBegin(); }
SourceLocation getEnd() const { return Range.getEnd(); } SourceLocation getEnd() const { return Range.getEnd(); }
SourceRange getAsRange() const { return Range; } SourceRange getAsRange() const { return Range; }
void setBegin(SourceLocation b) { Range.setBegin(b); } void setBegin(SourceLocation b) { Range.setBegin(b); }
void setEnd(SourceLocation e) { Range.setEnd(e); } void setEnd(SourceLocation e) { Range.setEnd(e); }
void setTokenRange(bool TR) { IsTokenRange = TR; } void setTokenRange(bool TR) { IsTokenRange = TR; }
bool isValid() const { return Range.isValid(); } bool isValid() const { return Range.isValid(); }
bool isInvalid() const { return !isValid(); } bool isInvalid() const { return !isValid(); }
}; };
@ -453,7 +453,7 @@ namespace llvm {
return LHS == RHS; return LHS == RHS;
} }
}; };
template <> template <>
struct isPodLike<clang::SourceLocation> { static const bool value = true; }; struct isPodLike<clang::SourceLocation> { static const bool value = true; };
template <> template <>

View File

@ -155,7 +155,7 @@ namespace SrcMgr {
ContentCache(const FileEntry *Ent, const FileEntry *contentEnt) ContentCache(const FileEntry *Ent, const FileEntry *contentEnt)
: Buffer(nullptr, false), OrigEntry(Ent), ContentsEntry(contentEnt), : Buffer(nullptr, false), OrigEntry(Ent), ContentsEntry(contentEnt),
BufferOverridden(false), IsSystemFile(false), IsTransient(false) {} BufferOverridden(false), IsSystemFile(false), IsTransient(false) {}
/// The copy ctor does not allow copies where source object has either /// The copy ctor does not allow copies where source object has either
/// a non-NULL Buffer or SourceLineCache. Ownership of allocated memory /// a non-NULL Buffer or SourceLineCache. Ownership of allocated memory
/// is not transferred, so this is a logical error. /// is not transferred, so this is a logical error.
@ -1072,7 +1072,7 @@ public:
unsigned FileOffset = Entry.getOffset(); unsigned FileOffset = Entry.getOffset();
return SourceLocation::getFileLoc(FileOffset); return SourceLocation::getFileLoc(FileOffset);
} }
/// Return the source location corresponding to the last byte of the /// Return the source location corresponding to the last byte of the
/// specified file. /// specified file.
SourceLocation getLocForEndOfFile(FileID FID) const { SourceLocation getLocForEndOfFile(FileID FID) const {
@ -1080,7 +1080,7 @@ public:
const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid); const SrcMgr::SLocEntry &Entry = getSLocEntry(FID, &Invalid);
if (Invalid || !Entry.isFile()) if (Invalid || !Entry.isFile())
return SourceLocation(); return SourceLocation();
unsigned FileOffset = Entry.getOffset(); unsigned FileOffset = Entry.getOffset();
return SourceLocation::getFileLoc(FileOffset + getFileIDSize(FID)); return SourceLocation::getFileLoc(FileOffset + getFileIDSize(FID));
} }
@ -1403,7 +1403,7 @@ public:
PresumedLoc getPresumedLoc(SourceLocation Loc, PresumedLoc getPresumedLoc(SourceLocation Loc,
bool UseLineDirectives = true) const; bool UseLineDirectives = true) const;
/// Returns whether the PresumedLoc for a given SourceLocation is /// Returns whether the PresumedLoc for a given SourceLocation is
/// in the main file. /// in the main file.
/// ///
/// This computes the "presumed" location for a SourceLocation, then checks /// This computes the "presumed" location for a SourceLocation, then checks

View File

@ -79,7 +79,7 @@ inline bool operator<(unsigned Offset, const LineEntry &E) {
/// Used to hold and unique data used to represent \#line information. /// Used to hold and unique data used to represent \#line information.
class LineTableInfo { class LineTableInfo {
/// Map used to assign unique IDs to filenames in \#line directives. /// Map used to assign unique IDs to filenames in \#line directives.
/// ///
/// This allows us to unique the filenames that /// This allows us to unique the filenames that
/// frequently reoccur and reference them with indices. FilenameIDs holds /// frequently reoccur and reference them with indices. FilenameIDs holds

View File

@ -28,14 +28,14 @@ namespace clang {
TSW_long, TSW_long,
TSW_longlong TSW_longlong
}; };
/// Specifies the signedness of a type, e.g., signed or unsigned. /// Specifies the signedness of a type, e.g., signed or unsigned.
enum TypeSpecifierSign { enum TypeSpecifierSign {
TSS_unspecified, TSS_unspecified,
TSS_signed, TSS_signed,
TSS_unsigned TSS_unsigned
}; };
enum TypeSpecifiersPipe { enum TypeSpecifiersPipe {
TSP_unspecified, TSP_unspecified,
TSP_pipe TSP_pipe
@ -134,7 +134,7 @@ namespace clang {
/// An Objective-C property is a logical field of an Objective-C /// An Objective-C property is a logical field of an Objective-C
/// object which is read and written via Objective-C method calls. /// object which is read and written via Objective-C method calls.
OK_ObjCProperty, OK_ObjCProperty,
/// An Objective-C array/dictionary subscripting which reads an /// An Objective-C array/dictionary subscripting which reads an
/// object or writes at the subscripted array/dictionary element via /// object or writes at the subscripted array/dictionary element via
/// Objective-C method calls. /// Objective-C method calls.

View File

@ -187,7 +187,7 @@ def TypoExpr : DStmt<Expr>;
// Microsoft Extensions. // Microsoft Extensions.
def MSPropertyRefExpr : DStmt<Expr>; def MSPropertyRefExpr : DStmt<Expr>;
def MSPropertySubscriptExpr : DStmt<Expr>; def MSPropertySubscriptExpr : DStmt<Expr>;
def CXXUuidofExpr : DStmt<Expr>; def CXXUuidofExpr : DStmt<Expr>;
def SEHTryStmt : Stmt; def SEHTryStmt : Stmt;
def SEHExceptStmt : Stmt; def SEHExceptStmt : Stmt;
def SEHFinallyStmt : Stmt; def SEHFinallyStmt : Stmt;

View File

@ -31,7 +31,7 @@ enum TemplateNameKind {
/// The name refers to a variable template whose specialization produces a /// The name refers to a variable template whose specialization produces a
/// variable. /// variable.
TNK_Var_template, TNK_Var_template,
/// The name refers to a dependent template name: /// The name refers to a dependent template name:
/// \code /// \code
/// template<typename MetaFun, typename T1, typename T2> struct apply2 { /// template<typename MetaFun, typename T1, typename T2> struct apply2 {
/// typedef typename MetaFun::template apply<T1, T2>::type type; /// typedef typename MetaFun::template apply<T1, T2>::type type;
@ -39,7 +39,7 @@ enum TemplateNameKind {
/// \endcode /// \endcode
/// ///
/// Here, "apply" is a dependent template name within the typename /// Here, "apply" is a dependent template name within the typename
/// specifier in the typedef. "apply" is a nested template, and /// specifier in the typedef. "apply" is a nested template, and
/// whether the template name is assumed to refer to a type template or a /// whether the template name is assumed to refer to a type template or a
/// function template depends on the context in which the template /// function template depends on the context in which the template
/// name occurs. /// name occurs.

View File

@ -772,9 +772,9 @@ def RSHRN_HIGH_N : IOpInst<"vrshrn_high_n", "hmdi",
"HsHiHlHUsHUiHUl", OP_NARROW_HI>; "HsHiHlHUsHUiHUl", OP_NARROW_HI>;
def QRSHRUN_HIGH_N : SOpInst<"vqrshrun_high_n", "hmdi", def QRSHRUN_HIGH_N : SOpInst<"vqrshrun_high_n", "hmdi",
"HsHiHl", OP_NARROW_HI>; "HsHiHl", OP_NARROW_HI>;
def QSHRN_HIGH_N : SOpInst<"vqshrn_high_n", "hmdi", def QSHRN_HIGH_N : SOpInst<"vqshrn_high_n", "hmdi",
"HsHiHlHUsHUiHUl", OP_NARROW_HI>; "HsHiHlHUsHUiHUl", OP_NARROW_HI>;
def QRSHRN_HIGH_N : SOpInst<"vqrshrn_high_n", "hmdi", def QRSHRN_HIGH_N : SOpInst<"vqrshrn_high_n", "hmdi",
"HsHiHlHUsHUiHUl", OP_NARROW_HI>; "HsHiHlHUsHUiHUl", OP_NARROW_HI>;
} }
@ -927,7 +927,7 @@ def VMINV : SInst<"vminv", "sd", "csifUcUsUiQcQsQiQUcQUsQUiQfQd">;
def VADDV : SInst<"vaddv", "sd", "csifUcUsUiQcQsQiQUcQUsQUiQfQdQlQUl">; def VADDV : SInst<"vaddv", "sd", "csifUcUsUiQcQsQiQUcQUsQUiQfQdQlQUl">;
def FMAXNMV : SInst<"vmaxnmv", "sd", "fQfQd">; def FMAXNMV : SInst<"vmaxnmv", "sd", "fQfQd">;
def FMINNMV : SInst<"vminnmv", "sd", "fQfQd">; def FMINNMV : SInst<"vminnmv", "sd", "fQfQd">;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// Newly added Vector Extract for f64 // Newly added Vector Extract for f64
def VEXT_A64 : WInst<"vext", "dddi", "dQdPlQPl">; def VEXT_A64 : WInst<"vext", "dddi", "dQdPlQPl">;

Some files were not shown because too many files have changed in this diff Show More