Skip to content

Commit

Permalink
[Clang][NFC] Remove trailing whitespace from clang/tools/libclang/CX…
Browse files Browse the repository at this point in the history
…StoredDIagnostic.cpp
  • Loading branch information
philnik777 committed Sep 12, 2024
1 parent 6093c26 commit 21692a6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions clang/tools/libclang/CXStoredDiagnostic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@ CXDiagnosticSeverity CXStoredDiagnostic::getSeverity() const {
case DiagnosticsEngine::Error: return CXDiagnostic_Error;
case DiagnosticsEngine::Fatal: return CXDiagnostic_Fatal;
}

llvm_unreachable("Invalid diagnostic level");
}

CXSourceLocation CXStoredDiagnostic::getLocation() const {
if (Diag.getLocation().isInvalid())
return clang_getNullLocation();

return translateSourceLocation(Diag.getLocation().getManager(),
LangOpts, Diag.getLocation());
}
Expand All @@ -57,7 +57,7 @@ CXString CXStoredDiagnostic::getDiagnosticOption(CXString *Disable) const {
*Disable = cxstring::createDup((Twine("-Wno-") + Option).str());
return cxstring::createDup((Twine("-W") + Option).str());
}

if (ID == diag::fatal_too_many_errors) {
if (Disable)
*Disable = cxstring::createRef("-ferror-limit=0");
Expand All @@ -79,7 +79,7 @@ CXString CXStoredDiagnostic::getCategoryText() const {
unsigned CXStoredDiagnostic::getNumRanges() const {
if (Diag.getLocation().isInvalid())
return 0;

return Diag.range_size();
}

Expand All @@ -92,12 +92,12 @@ CXSourceRange CXStoredDiagnostic::getRange(unsigned int Range) const {

unsigned CXStoredDiagnostic::getNumFixIts() const {
if (Diag.getLocation().isInvalid())
return 0;
return 0;
return Diag.fixit_size();
}

CXString CXStoredDiagnostic::getFixIt(unsigned FixIt,
CXSourceRange *ReplacementRange) const {
CXSourceRange *ReplacementRange) const {
const FixItHint &Hint = Diag.fixit_begin()[FixIt];
if (ReplacementRange) {
// Create a range that covers the entire replacement (or
Expand All @@ -108,4 +108,3 @@ CXString CXStoredDiagnostic::getFixIt(unsigned FixIt,
}
return cxstring::createDup(Hint.CodeToInsert);
}

0 comments on commit 21692a6

Please sign in to comment.