Skip to content

Commit

Permalink
Re-land "[-Wunsafe-buffer-usage] Remove an unnecessary const-qualifier"
Browse files Browse the repository at this point in the history
Re-land 7a0900f, which includes too
much clang-format changes.  This re-land gets rid of the format changes.
  • Loading branch information
ziqingluo-90 committed May 15, 2023
1 parent 9c9e507 commit 86c7e33
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion clang/include/clang/Sema/AnalysisBasedWarnings.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class AnalysisBasedWarnings {
const Decl *D, QualType BlockType);

// Issue warnings that require whole-translation-unit analysis.
void IssueWarnings(const TranslationUnitDecl *D);
void IssueWarnings(TranslationUnitDecl *D);

Policy getDefaultPolicy() { return DefaultPolicy; }

Expand Down
6 changes: 2 additions & 4 deletions clang/lib/Sema/AnalysisBasedWarnings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2340,7 +2340,7 @@ class CallableVisitor : public RecursiveASTVisitor<CallableVisitor> {
};

void clang::sema::AnalysisBasedWarnings::IssueWarnings(
const TranslationUnitDecl *TU) {
TranslationUnitDecl *TU) {
if (!TU)
return; // This is unexpected, give up quietly.

Expand Down Expand Up @@ -2370,9 +2370,7 @@ void clang::sema::AnalysisBasedWarnings::IssueWarnings(
// reasoning. Check if any of them is enabled at all before scanning the AST:
if (!Diags.isIgnored(diag::warn_unsafe_buffer_operation, SourceLocation()) ||
!Diags.isIgnored(diag::warn_unsafe_buffer_variable, SourceLocation())) {
CallableVisitor(CallAnalyzers)
.TraverseTranslationUnitDecl(
std::remove_const_t<TranslationUnitDecl *>(TU));
CallableVisitor(CallAnalyzers).TraverseTranslationUnitDecl(TU);
}
}

Expand Down

0 comments on commit 86c7e33

Please sign in to comment.