summaryrefslogtreecommitdiffstats
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
commitb8fa6541645e63e9983e0fff34cf4318d18bc420 (patch)
tree463f8ddc4097bdccfb8cb815be03d68795b99cac
parent80fc4bc68a79e5795fa0bed0c27b3d8231d3a560 (diff)
downloadbcm5719-llvm-b8fa6541645e63e9983e0fff34cf4318d18bc420.tar.gz
bcm5719-llvm-b8fa6541645e63e9983e0fff34cf4318d18bc420.zip
Add a couple of convenience operations to CharUnits.
llvm-svn: 265323
-rw-r--r--clang/include/clang/AST/CharUnits.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/include/clang/AST/CharUnits.h b/clang/include/clang/AST/CharUnits.h
index 3a819d5ed63..b2da51c23b8 100644
--- a/clang/include/clang/AST/CharUnits.h
+++ b/clang/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;
}
OpenPOWER on IntegriCloud