]> granicus.if.org Git - clang/commitdiff
Change OptionalFlag::setPosition() to set the flag as well.
authorTed Kremenek <kremenek@apple.com>
Thu, 2 Jul 2015 05:39:10 +0000 (05:39 +0000)
committerTed Kremenek <kremenek@apple.com>
Thu, 2 Jul 2015 05:39:10 +0000 (05:39 +0000)
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

include/clang/Analysis/Analyses/FormatString.h

index 2e8058dabda295b26c941657527642c51ba640b2..78299bafdce6ebe38d31503acebfa61412d58074 100644 (file)
@@ -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);
   }