[cfe-commits] r77046 - /cfe/trunk/include/clang/AST/Type.h
John McCall
rjmccall at apple.com
Fri Jul 24 21:35:50 PDT 2009
Author: rjmccall
Date: Fri Jul 24 23:35:50 2009
New Revision: 77046
URL: http://llvm.org/viewvc/llvm-project?rev=77046&view=rev
Log:
Flesh out the QualifierSet API.
Modified:
cfe/trunk/include/clang/AST/Type.h
Modified: cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Type.h?rev=77046&r1=77045&r2=77046&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/trunk/include/clang/AST/Type.h Fri Jul 24 23:35:50 2009
@@ -571,6 +571,30 @@
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) {
More information about the cfe-commits
mailing list