projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80fc4bc
)
Add a couple of convenience operations to CharUnits.
author
John McCall
<rjmccall@apple.com>
Mon, 4 Apr 2016 18:33:00 +0000
(18:33 +0000)
committer
John McCall
<rjmccall@apple.com>
Mon, 4 Apr 2016 18:33:00 +0000
(18:33 +0000)
llvm-svn: 265323
clang/include/clang/AST/CharUnits.h
patch
|
blob
|
history
diff --git
a/clang/include/clang/AST/CharUnits.h
b/clang/include/clang/AST/CharUnits.h
index
3a819d5
..
b2da51c
100644
(file)
--- 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;
}