diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-03-31 15:31:50 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-03-31 15:31:50 +0000 |
commit | d0ebe080eee7c37e73754068b47fd90cc506e128 (patch) | |
tree | 5136193af082bd362530944b9b43b23da9c6ff3d /lib/Sema/SemaDecl.cpp | |
parent | 6876fe615e16b0e76c7711e129e470305b7e9d41 (diff) |
Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index b8158bb7a0..6c15efb438 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -255,13 +255,13 @@ bool Sema::DiagnoseUnknownTypeName(const IdentifierInfo &II, if (!SS || !SS->isSet()) Diag(IILoc, diag::err_unknown_typename_suggest) << &II << Lookup.getLookupName() - << CodeModificationHint::CreateReplacement(SourceRange(IILoc), - Result->getNameAsString()); + << FixItHint::CreateReplacement(SourceRange(IILoc), + Result->getNameAsString()); else if (DeclContext *DC = computeDeclContext(*SS, false)) Diag(IILoc, diag::err_unknown_nested_typename_suggest) << &II << DC << Lookup.getLookupName() << SS->getRange() - << CodeModificationHint::CreateReplacement(SourceRange(IILoc), - Result->getNameAsString()); + << FixItHint::CreateReplacement(SourceRange(IILoc), + Result->getNameAsString()); else llvm_unreachable("could not have corrected a typo here"); @@ -285,8 +285,7 @@ bool Sema::DiagnoseUnknownTypeName(const IdentifierInfo &II, Diag(SS->getRange().getBegin(), diag::err_typename_missing) << (NestedNameSpecifier *)SS->getScopeRep() << II.getName() << SourceRange(SS->getRange().getBegin(), IILoc) - << CodeModificationHint::CreateInsertion(SS->getRange().getBegin(), - "typename "); + << FixItHint::CreateInsertion(SS->getRange().getBegin(), "typename "); SuggestedType = ActOnTypenameType(SourceLocation(), *SS, II, IILoc).get(); } else { assert(SS && SS->isInvalid() && @@ -590,8 +589,7 @@ ObjCInterfaceDecl *Sema::getObjCInterfaceDecl(IdentifierInfo *&Id, (IDecl = R.getAsSingle<ObjCInterfaceDecl>())) { Diag(RecoverLoc, diag::err_undef_interface_suggest) << Id << IDecl->getDeclName() - << CodeModificationHint::CreateReplacement(RecoverLoc, - IDecl->getNameAsString()); + << FixItHint::CreateReplacement(RecoverLoc, IDecl->getNameAsString()); Diag(IDecl->getLocation(), diag::note_previous_decl) << IDecl->getDeclName(); @@ -2345,8 +2343,7 @@ Sema::ActOnVariableDeclarator(Scope* S, Declarator& D, DeclContext* DC, if (SC == VarDecl::Static) { Diag(D.getDeclSpec().getStorageClassSpecLoc(), diag::err_static_out_of_line) - << CodeModificationHint::CreateRemoval( - D.getDeclSpec().getStorageClassSpecLoc()); + << FixItHint::CreateRemoval(D.getDeclSpec().getStorageClassSpecLoc()); } else if (SC == VarDecl::None) SC = VarDecl::Static; } @@ -2954,8 +2951,8 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, Diag(D.getIdentifierLoc(), diag::err_template_spec_decl_friend) << Name << RemoveRange - << CodeModificationHint::CreateRemoval(RemoveRange) - << CodeModificationHint::CreateInsertion(InsertLoc, "<>"); + << FixItHint::CreateRemoval(RemoveRange) + << FixItHint::CreateInsertion(InsertLoc, "<>"); } } @@ -2975,8 +2972,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, } else if (!CurContext->isRecord()) { // 'virtual' was specified outside of the class. Diag(D.getDeclSpec().getVirtualSpecLoc(), diag::err_virtual_out_of_class) - << CodeModificationHint::CreateRemoval( - D.getDeclSpec().getVirtualSpecLoc()); + << FixItHint::CreateRemoval(D.getDeclSpec().getVirtualSpecLoc()); } else { // Okay: Add virtual to the method. CXXRecordDecl *CurClass = cast<CXXRecordDecl>(DC); @@ -2993,16 +2989,14 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, // 'explicit' was specified outside of the class. Diag(D.getDeclSpec().getExplicitSpecLoc(), diag::err_explicit_out_of_class) - << CodeModificationHint::CreateRemoval( - D.getDeclSpec().getExplicitSpecLoc()); + << FixItHint::CreateRemoval(D.getDeclSpec().getExplicitSpecLoc()); } else if (!isa<CXXConstructorDecl>(NewFD) && !isa<CXXConversionDecl>(NewFD)) { // 'explicit' was specified on a function that wasn't a constructor // or conversion function. Diag(D.getDeclSpec().getExplicitSpecLoc(), diag::err_explicit_non_ctor_or_conv_function) - << CodeModificationHint::CreateRemoval( - D.getDeclSpec().getExplicitSpecLoc()); + << FixItHint::CreateRemoval(D.getDeclSpec().getExplicitSpecLoc()); } } @@ -3037,8 +3031,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, // member function definition. Diag(D.getDeclSpec().getStorageClassSpecLoc(), diag::err_static_out_of_line) - << CodeModificationHint::CreateRemoval( - D.getDeclSpec().getStorageClassSpecLoc()); + << FixItHint::CreateRemoval(D.getDeclSpec().getStorageClassSpecLoc()); } // Handle GNU asm-label extension (encoded as an attribute). @@ -3136,7 +3129,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, // too few of them). Diag(D.getIdentifierLoc(), diag::err_template_spec_needs_header) << SourceRange(TemplateId->LAngleLoc, TemplateId->RAngleLoc) - << CodeModificationHint::CreateInsertion( + << FixItHint::CreateInsertion( D.getDeclSpec().getSourceRange().getBegin(), "template<> "); isFunctionTemplateSpecialization = true; @@ -4174,7 +4167,7 @@ void Sema::ActOnFinishKNRParamDeclarations(Scope *S, Declarator &D, << ";\n"; Diag(FTI.ArgInfo[i].IdentLoc, diag::ext_param_not_declared) << FTI.ArgInfo[i].Ident - << CodeModificationHint::CreateInsertion(LocAfterDecls, Code.str()); + << FixItHint::CreateInsertion(LocAfterDecls, Code.str()); // Implicitly declare the argument as type 'int' for lack of a better // type. @@ -4684,7 +4677,7 @@ bool Sema::isAcceptableTagRedeclaration(const TagDecl *Previous, Diag(NewTagLoc, diag::warn_struct_class_tag_mismatch) << (NewTag == TagDecl::TK_class) << isTemplate << &Name - << CodeModificationHint::CreateReplacement(SourceRange(NewTagLoc), + << FixItHint::CreateReplacement(SourceRange(NewTagLoc), OldTag == TagDecl::TK_class? "class" : "struct"); Diag(Previous->getLocation(), diag::note_previous_use); return true; @@ -4930,8 +4923,8 @@ Sema::DeclPtrTy Sema::ActOnTag(Scope *S, unsigned TagSpec, TagUseKind TUK, if (SafeToContinue) Diag(KWLoc, diag::err_use_with_wrong_tag) << Name - << CodeModificationHint::CreateReplacement(SourceRange(KWLoc), - PrevTagDecl->getKindName()); + << FixItHint::CreateReplacement(SourceRange(KWLoc), + PrevTagDecl->getKindName()); else Diag(KWLoc, diag::err_use_with_wrong_tag) << Name; Diag(PrevTagDecl->getLocation(), diag::note_previous_use); |