summaryrefslogtreecommitdiffstats
path: root/include/clang/AST/CharUnits.h
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2016-04-04 18:33:00 +0000
committerJohn McCall <rjmccall@apple.com>2016-04-04 18:33:00 +0000
commit9e5edc1c573523da86b291bda3d1406ab1e4ea0b (patch)
tree8012dc400cb99bc43148b60764e75dcabc84834c /include/clang/AST/CharUnits.h
parent885217218dd21498430d50c5a2f6dd8e329add4b (diff)
Add a couple of convenience operations to CharUnits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/AST/CharUnits.h')
-rw-r--r--include/clang/AST/CharUnits.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/clang/AST/CharUnits.h b/include/clang/AST/CharUnits.h
index 3a819d5ed6..b2da51c23b 100644
--- a/include/clang/AST/CharUnits.h
+++ b/include/clang/AST/CharUnits.h
@@ -142,9 +142,17 @@ namespace clang {
CharUnits operator* (QuantityType N) const {
return CharUnits(Quantity * N);
}
+ CharUnits &operator*= (QuantityType N) {
+ Quantity *= N;
+ return *this;
+ }
CharUnits operator/ (QuantityType N) const {
return CharUnits(Quantity / N);
}
+ CharUnits operator/= (QuantityType N) {
+ Quantity /= N;
+ return *this;
+ }
QuantityType operator/ (const CharUnits &Other) const {
return Quantity / Other.Quantity;
}