1 //===--- ObjCMethodList.h - A singly linked list of methods -----*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines ObjCMethodList, a singly-linked list of methods.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CLANG_SEMA_OBJC_METHOD_LIST_H
15 #define LLVM_CLANG_SEMA_OBJC_METHOD_LIST_H
17 #include "llvm/ADT/PointerIntPair.h"
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;
29 ObjCMethodList() : Method(nullptr) { }
30 ObjCMethodList(ObjCMethodDecl *M, ObjCMethodList *C)
31 : Method(M), NextAndExtraBits(C, 0) { }
33 ObjCMethodList *getNext() const { return NextAndExtraBits.getPointer(); }
34 unsigned getBits() const { return NextAndExtraBits.getInt(); }
35 void setNext(ObjCMethodList *L) { NextAndExtraBits.setPointer(L); }
36 void setBits(unsigned B) { NextAndExtraBits.setInt(B); }