aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-07-25 04:35:50 +0000
committerJohn McCall <rjmccall@apple.com>2009-07-25 04:35:50 +0000
commit8fceb57f6980c67bb8f12e29d75736cf057951e8 (patch)
tree8f65838fbf8653f0f02aa8655bb0cab3e15bfebd
parent0c41c8aa450a16997e8328d50846a11872d1044f (diff)
Flesh out the QualifierSet API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77046 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/Type.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/clang/AST/Type.h b/include/clang/AST/Type.h
index 5ef3539e69..761f3fc922 100644
--- a/include/clang/AST/Type.h
+++ b/include/clang/AST/Type.h
@@ -571,6 +571,30 @@ public:
CVRMask(0), AddressSpace(0), GCAttrType(QualType::GCNone) {
}
+ void removeConst() { removeCVR(QualType::Const); }
+ void removeVolatile() { removeCVR(QualType::Volatile); }
+ void removeRestrict() { removeCVR(QualType::Restrict); }
+ void removeCVR(unsigned mask) { CVRMask &= ~mask; }
+ void removeAddressSpace() { AddressSpace = 0; }
+ void removeGCAttrType() { GCAttrType = QualType::GCNone; }
+
+ void addConst() { addCVR(QualType::Const); }
+ void addVolatile() { addCVR(QualType::Volatile); }
+ void addRestrict() { addCVR(QualType::Restrict); }
+ void addCVR(unsigned mask) { CVRMask |= mask; }
+ void addAddressSpace(unsigned space) {
+ assert(space);
+ AddressSpace = space;
+ }
+ void addGCAttrType(QualType::GCAttrTypes type) {
+ assert(type);
+ GCAttrType = type;
+ }
+
+ bool empty() {
+ return !CVRMask && !AddressSpace && !GCAttrType;
+ }
+
/// Collect any qualifiers on the given type and return an
/// unqualified type.
const Type *strip(QualType QT) {