Skip to content

Commit

Permalink
[-Wunsafe-buffer-usage] Remove an unnecessary const-qualifier
Browse files Browse the repository at this point in the history
A follow-up change for 6d861d4:
remove an unnecessary const-qualifier so that the code doesn't have to
remove the qualifier explicitly using `std::remove_const_t`, which
triggers a warning at some bots (e.g.,
https://lab.llvm.org/buildbot/#/builders/247/builds/4442).
  • Loading branch information
ziqingluo-90 committed May 12, 2023
1 parent 00e6d0e commit 7a0900f
Show file tree
Hide file tree
Showing 2 changed files with 399 additions and 423 deletions.
11 changes: 6 additions & 5 deletions clang/include/clang/Sema/AnalysisBasedWarnings.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class FunctionDecl;
class QualType;
class Sema;
namespace sema {
class FunctionScopeInfo;
class FunctionScopeInfo;
}

namespace sema {
Expand All @@ -38,6 +38,7 @@ class AnalysisBasedWarnings {
unsigned enableCheckUnreachable : 1;
unsigned enableThreadSafetyAnalysis : 1;
unsigned enableConsumedAnalysis : 1;

public:
Policy();
void disableCheckFallThrough() { enableCheckFallThrough = 0; }
Expand All @@ -51,7 +52,7 @@ class AnalysisBasedWarnings {
std::unique_ptr<InterProceduralData> IPData;

enum VisitFlag { NotVisited = 0, Visited = 1, Pending = 2 };
llvm::DenseMap<const FunctionDecl*, VisitFlag> VisitedFD;
llvm::DenseMap<const FunctionDecl *, VisitFlag> VisitedFD;

/// \name Statistics
/// @{
Expand Down Expand Up @@ -93,11 +94,11 @@ class AnalysisBasedWarnings {
AnalysisBasedWarnings(Sema &s);
~AnalysisBasedWarnings();

void IssueWarnings(Policy P, FunctionScopeInfo *fscope,
const Decl *D, QualType BlockType);
void IssueWarnings(Policy P, FunctionScopeInfo *fscope, 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

0 comments on commit 7a0900f

Please sign in to comment.