clang API Documentation

ObjCMethodList.h
Go to the documentation of this file.
00001 //===--- ObjCMethodList.h - A singly linked list of methods -----*- C++ -*-===//
00002 //
00003 //                     The LLVM Compiler Infrastructure
00004 //
00005 // This file is distributed under the University of Illinois Open Source
00006 // License. See LICENSE.TXT for details.
00007 //
00008 //===----------------------------------------------------------------------===//
00009 //
00010 // This file defines ObjCMethodList, a singly-linked list of methods.
00011 //
00012 //===----------------------------------------------------------------------===//
00013 
00014 #ifndef LLVM_CLANG_SEMA_OBJCMETHODLIST_H
00015 #define LLVM_CLANG_SEMA_OBJCMETHODLIST_H
00016 
00017 #include "llvm/ADT/PointerIntPair.h"
00018 
00019 namespace clang {
00020 
00021 class ObjCMethodDecl;
00022 
00023 /// ObjCMethodList - a linked list of methods with different signatures.
00024 struct ObjCMethodList {
00025   ObjCMethodDecl *Method;
00026   /// \brief count of methods with same signature.
00027   unsigned Count;
00028   /// \brief The next list object and 2 bits for extra info.
00029   llvm::PointerIntPair<ObjCMethodList *, 2> NextAndExtraBits;
00030 
00031   ObjCMethodList() : Method(nullptr), Count(0) { }
00032   ObjCMethodList(ObjCMethodDecl *M, unsigned count, ObjCMethodList *C)
00033     : Method(M), Count(count), NextAndExtraBits(C, 0) { }
00034 
00035   ObjCMethodList *getNext() const { return NextAndExtraBits.getPointer(); }
00036   unsigned getBits() const { return NextAndExtraBits.getInt(); }
00037   void setNext(ObjCMethodList *L) { NextAndExtraBits.setPointer(L); }
00038   void setBits(unsigned B) { NextAndExtraBits.setInt(B); }
00039 };
00040 
00041 }
00042 
00043 #endif