1 //===--- ObjCMethodList.h - A singly linked list of methods -----*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file defines ObjCMethodList, a singly-linked list of methods. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef LLVM_CLANG_SEMA_OBJC_METHOD_LIST_H 15 #define LLVM_CLANG_SEMA_OBJC_METHOD_LIST_H 16 17 #include "llvm/ADT/PointerIntPair.h" 18 19 namespace clang { 20 21 class ObjCMethodDecl; 22 23 /// ObjCMethodList - a linked list of methods with different signatures. 24 struct ObjCMethodList { 25 ObjCMethodDecl *Method; 26 /// \brief The next list object and 2 bits for extra info. 27 llvm::PointerIntPair<ObjCMethodList *, 2> NextAndExtraBits; 28 ObjCMethodListObjCMethodList29 ObjCMethodList() : Method(0) { } ObjCMethodListObjCMethodList30 ObjCMethodList(ObjCMethodDecl *M, ObjCMethodList *C) 31 : Method(M), NextAndExtraBits(C, 0) { } 32 getNextObjCMethodList33 ObjCMethodList *getNext() const { return NextAndExtraBits.getPointer(); } getBitsObjCMethodList34 unsigned getBits() const { return NextAndExtraBits.getInt(); } setNextObjCMethodList35 void setNext(ObjCMethodList *L) { NextAndExtraBits.setPointer(L); } setBitsObjCMethodList36 void setBits(unsigned B) { NextAndExtraBits.setInt(B); } 37 }; 38 39 } 40 41 #endif 42