Skip to content

Commit 8b0aff7

Browse files
Remove unused local variables and private fields.
1 parent 1173e9f commit 8b0aff7

File tree

6 files changed

+6
-11
lines changed

6 files changed

+6
-11
lines changed

clang/include/clang/3C/AVarBoundsInfo.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,7 @@ class AVarBoundsInfo {
362362
class ContextSensitiveBoundsKeyVisitor
363363
: public RecursiveASTVisitor<ContextSensitiveBoundsKeyVisitor> {
364364
public:
365-
explicit ContextSensitiveBoundsKeyVisitor(ASTContext *C, ProgramInfo &I,
366-
ConstraintResolver *CResolver);
365+
explicit ContextSensitiveBoundsKeyVisitor(ASTContext *C, ProgramInfo &I);
367366

368367
virtual ~ContextSensitiveBoundsKeyVisitor();
369368

@@ -372,7 +371,6 @@ class ContextSensitiveBoundsKeyVisitor
372371
private:
373372
ASTContext *Context;
374373
ProgramInfo &Info;
375-
ConstraintResolver *CR;
376374
};
377375

378376
#endif // LLVM_CLANG_3C_AVARBOUNDSINFO_H

clang/include/clang/3C/RewriteUtils.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,14 +193,13 @@ class GlobalVariableGroups {
193193
// detected array variables.
194194
class ArrayBoundsRewriter {
195195
public:
196-
ArrayBoundsRewriter(ASTContext *C, ProgramInfo &I) : Context(C), Info(I) {}
196+
ArrayBoundsRewriter(ProgramInfo &I) : Info(I) {}
197197
// Get the string representation of the bounds for the given variable.
198198
std::string getBoundsString(PVConstraint *PV, Decl *D, bool Isitype = false);
199199
// Check if the constraint variable has newly created bounds string.
200200
bool hasNewBoundsString(PVConstraint *PV, Decl *D, bool Isitype = false);
201201

202202
private:
203-
ASTContext *Context;
204203
ProgramInfo &Info;
205204
};
206205

clang/lib/3C/AVarBoundsInfo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -898,7 +898,6 @@ bool AvarBoundsInference::inferBounds(BoundsKey K, AVarGraph &BKGraph,
898898
std::set<BoundsKey> PotentialB;
899899
PotentialB.clear();
900900
for (auto TK : PotBDs[K]) {
901-
ProgramVar *TKVar = BI->getProgramVar(TK);
902901
getReachableBoundKeys(Kvar->getScope(), TK, PotentialB, BKGraph,
903902
true);
904903
}
@@ -1333,8 +1332,8 @@ bool AVarBoundsInfo::areSameProgramVar(BoundsKey B1, BoundsKey B2) {
13331332
}
13341333

13351334
ContextSensitiveBoundsKeyVisitor::ContextSensitiveBoundsKeyVisitor(
1336-
ASTContext *C, ProgramInfo &I, ConstraintResolver *CResolver)
1337-
: Context(C), Info(I), CR(CResolver) {
1335+
ASTContext *C, ProgramInfo &I)
1336+
: Context(C), Info(I) {
13381337
Info.getABoundsInfo().resetContextSensitiveBoundsKey();
13391338
}
13401339

clang/lib/3C/ArrayBoundsInferenceConsumer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,6 @@ bool LocalVarABVisitor::VisitArraySubscriptExpr(ArraySubscriptExpr *E) {
613613

614614
bool LocalVarABVisitor::VisitDeclStmt(DeclStmt *S) {
615615
// Build rules based on initializers.
616-
auto &ABoundsInfo = Info.getABoundsInfo();
617616
for (const auto &D : S->decls())
618617
if (VarDecl *VD = dyn_cast<VarDecl>(D)) {
619618
Expr *InitE = VD->getInit();

clang/lib/3C/ConstraintBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ void ConstraintBuilderConsumer::HandleTranslationUnit(ASTContext &C) {
546546
TypeVarVisitor TV = TypeVarVisitor(&C, Info);
547547
ConstraintResolver CSResolver(Info, &C);
548548
ContextSensitiveBoundsKeyVisitor CSBV =
549-
ContextSensitiveBoundsKeyVisitor(&C, Info, &CSResolver);
549+
ContextSensitiveBoundsKeyVisitor(&C, Info);
550550
ConstraintGenVisitor GV = ConstraintGenVisitor(&C, Info, TV);
551551
TranslationUnitDecl *TUD = C.getTranslationUnitDecl();
552552
// Generate constraints.

clang/lib/3C/DeclRewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using namespace clang;
3030
void DeclRewriter::rewriteDecls(ASTContext &Context, ProgramInfo &Info,
3131
Rewriter &R) {
3232
// Compute the bounds information for all the array variables.
33-
ArrayBoundsRewriter ABRewriter(&Context, Info);
33+
ArrayBoundsRewriter ABRewriter(Info);
3434

3535
// Collect function and record declarations that need to be rewritten in a set
3636
// as well as their rewriten types in a map.

0 commit comments

Comments
 (0)