Skip to content

Commit

Permalink
Change OptionalFlag::setPosition() to set the flag as well.
Browse files Browse the repository at this point in the history
This change reduces some unnecessary boilerplate
since all calls to 'setPosition' are currently paired
with setting the flag of OptionalFlag.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241242 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
tkremenek committed Jul 2, 2015
1 parent 99d997e commit fc2e5d1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions include/clang/Analysis/Analyses/FormatString.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class OptionalFlag {
void clear() { flag = false; }
void setPosition(const char *position) {
assert(position);
flag = true;
this->position = position;
}
const char *getPosition() const {
Expand Down Expand Up @@ -449,27 +450,21 @@ class PrintfSpecifier : public analyze_format_string::FormatSpecifier {
CS = cs;
}
void setHasThousandsGrouping(const char *position) {
HasThousandsGrouping = true;
HasThousandsGrouping.setPosition(position);
}
void setIsLeftJustified(const char *position) {
IsLeftJustified = true;
IsLeftJustified.setPosition(position);
}
void setHasPlusPrefix(const char *position) {
HasPlusPrefix = true;
HasPlusPrefix.setPosition(position);
}
void setHasSpacePrefix(const char *position) {
HasSpacePrefix = true;
HasSpacePrefix.setPosition(position);
}
void setHasAlternativeForm(const char *position) {
HasAlternativeForm = true;
HasAlternativeForm.setPosition(position);
}
void setHasLeadingZeros(const char *position) {
HasLeadingZeroes = true;
HasLeadingZeroes.setPosition(position);
}
void setUsesPositionalArg() { UsesPositionalArg = true; }
Expand Down Expand Up @@ -565,7 +560,6 @@ class ScanfSpecifier : public analyze_format_string::FormatSpecifier {
SuppressAssignment("*") {}

void setSuppressAssignment(const char *position) {
SuppressAssignment = true;
SuppressAssignment.setPosition(position);
}

Expand Down

0 comments on commit fc2e5d1

Please sign in to comment.