diff options
Diffstat (limited to 'clang/include/clang/Sema/SemaFixItUtils.h')
-rw-r--r-- | clang/include/clang/Sema/SemaFixItUtils.h | 46 |
1 files changed, 21 insertions, 25 deletions
diff --git a/clang/include/clang/Sema/SemaFixItUtils.h b/clang/include/clang/Sema/SemaFixItUtils.h index d7f08c47ba8..343ccfb3d63 100644 --- a/clang/include/clang/Sema/SemaFixItUtils.h +++ b/clang/include/clang/Sema/SemaFixItUtils.h @@ -1,4 +1,4 @@ -//===- SemaFixItUtils.h - Sema FixIts ---------------------------*- C++ -*-===// +//===--- SemaFixItUtils.h - Sema FixIts -----------------------------------===// // // The LLVM Compiler Infrastructure // @@ -10,22 +10,13 @@ // This file defines helper classes for generation of Sema FixItHints. // //===----------------------------------------------------------------------===// - #ifndef LLVM_CLANG_SEMA_SEMAFIXITUTILS_H #define LLVM_CLANG_SEMA_SEMAFIXITUTILS_H -#include "clang/AST/DeclarationName.h" -#include "clang/AST/Type.h" -#include "clang/Basic/Diagnostic.h" -#include "clang/Basic/SourceLocation.h" -#include "clang/Basic/Specifiers.h" -#include <vector> +#include "clang/AST/Expr.h" namespace clang { -class Expr; -class Sema; - enum OverloadFixItKind { OFIK_Undefined = 0, OFIK_Dereference, @@ -34,6 +25,8 @@ enum OverloadFixItKind { OFIK_RemoveTakeAddress }; +class Sema; + /// The class facilities generation and storage of conversion FixIts. Hints for /// new conversions are added using TryToFixConversion method. The default type /// conversion checker can be reset. @@ -50,25 +43,29 @@ struct ConversionFixItGenerator { /// The number of Conversions fixed. This can be different from the size /// of the Hints vector since we allow multiple FixIts per conversion. - unsigned NumConversionsFixed = 0; + unsigned NumConversionsFixed; /// The type of fix applied. If multiple conversions are fixed, corresponds /// to the kid of the very first conversion. - OverloadFixItKind Kind = OFIK_Undefined; - - using TypeComparisonFuncTy = bool (*) (const CanQualType FromTy, - const CanQualType ToTy, - Sema &S, - SourceLocation Loc, - ExprValueKind FromVK); + OverloadFixItKind Kind; + typedef bool (*TypeComparisonFuncTy) (const CanQualType FromTy, + const CanQualType ToTy, + Sema &S, + SourceLocation Loc, + ExprValueKind FromVK); /// The type comparison function used to decide if expression FromExpr of /// type FromTy can be converted to ToTy. For example, one could check if /// an implicit conversion exists. Returns true if comparison exists. - TypeComparisonFuncTy CompareTypes = compareTypesSimple; + TypeComparisonFuncTy CompareTypes; - ConversionFixItGenerator() = default; - ConversionFixItGenerator(TypeComparisonFuncTy Foo) : CompareTypes(Foo) {} + ConversionFixItGenerator(TypeComparisonFuncTy Foo): NumConversionsFixed(0), + Kind(OFIK_Undefined), + CompareTypes(Foo) {} + + ConversionFixItGenerator(): NumConversionsFixed(0), + Kind(OFIK_Undefined), + CompareTypes(compareTypesSimple) {} /// Resets the default conversion checker method. void setConversionChecker(TypeComparisonFuncTy Foo) { @@ -90,6 +87,5 @@ struct ConversionFixItGenerator { } }; -} // namespace clang - -#endif // LLVM_CLANG_SEMA_SEMAFIXITUTILS_H +} // endof namespace clang +#endif |