clang API Documentation
#include <Diagnostic.h>

Public Member Functions | |
| CodeModificationHint () | |
| Empty code modification hint, indicating that no code modification is known. | |
| bool | isNull () const |
Static Public Member Functions | |
| static CodeModificationHint | CreateInsertion (SourceLocation InsertionLoc, llvm::StringRef Code) |
| Create a code modification hint that inserts the given code string at a specific location. | |
| static CodeModificationHint | CreateRemoval (SourceRange RemoveRange) |
| Create a code modification hint that removes the given source range. | |
| static CodeModificationHint | CreateReplacement (SourceRange RemoveRange, llvm::StringRef Code) |
| Create a code modification hint that replaces the given source range with the given code string. | |
Public Attributes | |
| SourceRange | RemoveRange |
| Tokens that should be removed to correct the error. | |
| SourceLocation | InsertionLoc |
| The location at which we should insert code to correct the error. | |
| std::string | CodeToInsert |
| The actual code to insert at the insertion location, as a string. | |
This kind of hint should be used when we are certain that the introduction, removal, or modification of a particular (small!) amount of code will correct a compilation error. The compiler should also provide full recovery from such errors, such that suppressing the diagnostic output can still result in successful compilation.
Definition at line 98 of file Diagnostic.h.
| clang::CodeModificationHint::CodeModificationHint | ( | ) | [inline] |
Empty code modification hint, indicating that no code modification is known.
Definition at line 113 of file Diagnostic.h.
| static CodeModificationHint clang::CodeModificationHint::CreateInsertion | ( | SourceLocation | InsertionLoc, | |
| llvm::StringRef | Code | |||
| ) | [inline, static] |
Create a code modification hint that inserts the given code string at a specific location.
Definition at line 121 of file Diagnostic.h.
References CodeToInsert, and InsertionLoc.
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnFinishKNRParamDeclarations(), clang::Sema::ActOnFriendTypeDecl(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnUsingDeclaration(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckConstructor(), CheckCXXSwitchCondition(), clang::Preprocessor::CheckEndOfDirective(), clang::Sema::CheckEquivalentExceptionSpec(), ConvertDeclSpecToType(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::Sema::DiagnoseDtorReference(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::DiagnoseUnknownTemplateName(), clang::Sema::DiagnoseUnknownTypeName(), clang::DeclSpec::Finish(), clang::Sema::LookupMemberExpr(), MakeObjCStringLiteralCodeModificationHint(), clang::Sema::MatchTemplateParametersToScopeSpecifier(), and SuggestParentheses().
| static CodeModificationHint clang::CodeModificationHint::CreateRemoval | ( | SourceRange | RemoveRange | ) | [inline, static] |
Create a code modification hint that removes the given source range.
Definition at line 131 of file Diagnostic.h.
References RemoveRange.
Referenced by clang::Sema::ActOnCallExpr(), clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnFunctionDeclarator(), clang::Sema::ActOnVariableDeclarator(), and clang::DeclSpec::Finish().
| static CodeModificationHint clang::CodeModificationHint::CreateReplacement | ( | SourceRange | RemoveRange, | |
| llvm::StringRef | Code | |||
| ) | [inline, static] |
Create a code modification hint that replaces the given source range with the given code string.
Definition at line 139 of file Diagnostic.h.
References CodeToInsert, clang::SourceRange::getBegin(), InsertionLoc, and RemoveRange.
Referenced by clang::Sema::ActOnClassTemplateSpecialization(), clang::Sema::ActOnExplicitInstantiation(), clang::Sema::ActOnMemInitializer(), clang::Sema::ActOnPseudoDestructorExpr(), clang::Sema::ActOnStartClassImplementation(), clang::Sema::ActOnTag(), clang::Sema::ActOnTagTemplateIdType(), clang::Sema::BuildCXXNestedNameSpecifier(), clang::Sema::BuildPseudoDestructorExpr(), clang::Sema::CheckClassTemplate(), clang::Sema::CheckCompareOperands(), clang::Sema::CheckPointerToMemberOperands(), clang::Sema::DiagnoseAssignmentAsCondition(), clang::Sema::DiagnoseEmptyLookup(), clang::Sema::DiagnoseUnknownTypeName(), clang::Sema::getObjCInterfaceDecl(), clang::Sema::isAcceptableTagRedeclaration(), clang::Sema::LookupMemberExpr(), LookupMemberExprInRecord(), and clang::Sema::LookupTemplateName().
| bool clang::CodeModificationHint::isNull | ( | ) | const [inline] |
Definition at line 115 of file Diagnostic.h.
References InsertionLoc, clang::SourceLocation::isValid(), clang::SourceRange::isValid(), and RemoveRange.
Referenced by clang::DiagnosticBuilder::AddCodeModificationHint().
| std::string clang::CodeModificationHint::CodeToInsert |
The actual code to insert at the insertion location, as a string.
Definition at line 109 of file Diagnostic.h.
Referenced by CreateInsertion(), CreateReplacement(), clang::StoredDiagnostic::Deserialize(), and clang::FixItRewriter::HandleDiagnostic().
The location at which we should insert code to correct the error.
Definition at line 105 of file Diagnostic.h.
Referenced by CreateInsertion(), CreateReplacement(), clang::StoredDiagnostic::Deserialize(), clang::FixItRewriter::HandleDiagnostic(), and isNull().
Tokens that should be removed to correct the error.
Definition at line 101 of file Diagnostic.h.
Referenced by CreateRemoval(), CreateReplacement(), clang::StoredDiagnostic::Deserialize(), clang::TextDiagnosticPrinter::HandleDiagnostic(), clang::FixItRewriter::HandleDiagnostic(), and isNull().