From: Ted Kremenek Date: Thu, 2 Jul 2015 05:39:10 +0000 (+0000) Subject: Change OptionalFlag::setPosition() to set the flag as well. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc2e5d1db41a03ad418bfda1aba53597a17124ce;p=clang Change OptionalFlag::setPosition() to set the flag as well. 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 --- diff --git a/include/clang/Analysis/Analyses/FormatString.h b/include/clang/Analysis/Analyses/FormatString.h index 2e8058dabd..78299bafdc 100644 --- a/include/clang/Analysis/Analyses/FormatString.h +++ b/include/clang/Analysis/Analyses/FormatString.h @@ -40,6 +40,7 @@ public: void clear() { flag = false; } void setPosition(const char *position) { assert(position); + flag = true; this->position = position; } const char *getPosition() const { @@ -449,27 +450,21 @@ public: 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; } @@ -565,7 +560,6 @@ public: SuppressAssignment("*") {} void setSuppressAssignment(const char *position) { - SuppressAssignment = true; SuppressAssignment.setPosition(position); }