| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | #ifndef LLVM_CLANG_SEMA_OBJCMETHODLIST_H |
| 14 | #define LLVM_CLANG_SEMA_OBJCMETHODLIST_H |
| 15 | |
| 16 | #include "clang/AST/DeclObjC.h" |
| 17 | #include "llvm/ADT/PointerIntPair.h" |
| 18 | |
| 19 | namespace clang { |
| 20 | |
| 21 | class ObjCMethodDecl; |
| 22 | |
| 23 | |
| 24 | |
| 25 | struct ObjCMethodList { |
| 26 | |
| 27 | |
| 28 | llvm::PointerIntPair<ObjCMethodDecl *, 1> MethodAndHasMoreThanOneDecl; |
| 29 | |
| 30 | llvm::PointerIntPair<ObjCMethodList *, 2> NextAndExtraBits; |
| 31 | |
| 32 | ObjCMethodList() { } |
| 33 | ObjCMethodList(ObjCMethodDecl *M) |
| 34 | : MethodAndHasMoreThanOneDecl(M, 0) {} |
| 35 | ObjCMethodList(const ObjCMethodList &L) |
| 36 | : MethodAndHasMoreThanOneDecl(L.MethodAndHasMoreThanOneDecl), |
| 37 | NextAndExtraBits(L.NextAndExtraBits) {} |
| 38 | |
| 39 | ObjCMethodList *getNext() const { return NextAndExtraBits.getPointer(); } |
| 40 | unsigned getBits() const { return NextAndExtraBits.getInt(); } |
| 41 | void setNext(ObjCMethodList *L) { NextAndExtraBits.setPointer(L); } |
| 42 | void setBits(unsigned B) { NextAndExtraBits.setInt(B); } |
| 43 | |
| 44 | ObjCMethodDecl *getMethod() const { |
| 45 | return MethodAndHasMoreThanOneDecl.getPointer(); |
| 46 | } |
| 47 | void setMethod(ObjCMethodDecl *M) { |
| 48 | return MethodAndHasMoreThanOneDecl.setPointer(M); |
| 49 | } |
| 50 | |
| 51 | bool hasMoreThanOneDecl() const { |
| 52 | return MethodAndHasMoreThanOneDecl.getInt(); |
| 53 | } |
| 54 | void setHasMoreThanOneDecl(bool B) { |
| 55 | return MethodAndHasMoreThanOneDecl.setInt(B); |
| 56 | } |
| 57 | }; |
| 58 | |
| 59 | } |
| 60 | |
| 61 | #endif |
| 62 | |