[cfe-commits] r39165 - /cfe/cfe/trunk/include/clang/AST/Type.h
sabre at cs.uiuc.edu
sabre at cs.uiuc.edu
Wed Jul 11 09:40:20 PDT 2007
Author: sabre
Date: Wed Jul 11 11:40:20 2007
New Revision: 39165
URL: http://llvm.org/viewvc/llvm-project?rev=39165&view=rev
Log:
Expand TypeRef itf
Modified:
cfe/cfe/trunk/include/clang/AST/Type.h
Modified: cfe/cfe/trunk/include/clang/AST/Type.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/AST/Type.h?rev=39165&r1=39164&r2=39165&view=diff
==============================================================================
--- cfe/cfe/trunk/include/clang/AST/Type.h (original)
+++ cfe/cfe/trunk/include/clang/AST/Type.h Wed Jul 11 11:40:20 2007
@@ -42,7 +42,9 @@
CVRFlags = Const|Volatile|Restrict
};
- TypeRef(Type *Ptr = 0, unsigned Quals = 0) {
+ TypeRef() : ThePtr(0) {}
+
+ TypeRef(Type *Ptr, unsigned Quals = 0) {
assert((Quals & ~CVRFlags) == 0 && "Invalid type qualifiers!");
ThePtr = reinterpret_cast<uintptr_t>(Ptr);
assert((ThePtr & CVRFlags) == 0 && "Type pointer not 8-byte aligned?");
@@ -56,6 +58,11 @@
Type *operator->() const {
return reinterpret_cast<Type*>(ThePtr & ~CVRFlags);
}
+
+ /// isNull - Return true if this TypeRef doesn't point to a type yet.
+ bool isNull() const {
+ return ThePtr == 0;
+ }
bool isConstQualified() const {
return ThePtr & Const;
More information about the cfe-commits
mailing list