clang  3.7.0
ObjCMethodList.h
Go to the documentation of this file.
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_OBJCMETHODLIST_H
15 #define LLVM_CLANG_SEMA_OBJCMETHODLIST_H
16 
17 #include "llvm/ADT/PointerIntPair.h"
18 
19 namespace clang {
20 
21 class ObjCMethodDecl;
22 
23 /// \brief a linked list of methods with the same selector name but different
24 /// signatures.
26  // NOTE: If you add any members to this struct, make sure to serialize them.
27  /// \brief If there is more than one decl with this signature.
28  llvm::PointerIntPair<ObjCMethodDecl *, 1> MethodAndHasMoreThanOneDecl;
29  /// \brief The next list object and 2 bits for extra info.
30  llvm::PointerIntPair<ObjCMethodList *, 2> NextAndExtraBits;
31 
35 
36  ObjCMethodList *getNext() const { return NextAndExtraBits.getPointer(); }
37  unsigned getBits() const { return NextAndExtraBits.getInt(); }
38  void setNext(ObjCMethodList *L) { NextAndExtraBits.setPointer(L); }
39  void setBits(unsigned B) { NextAndExtraBits.setInt(B); }
40 
42  return MethodAndHasMoreThanOneDecl.getPointer();
43  }
45  return MethodAndHasMoreThanOneDecl.setPointer(M);
46  }
47 
48  bool hasMoreThanOneDecl() const {
49  return MethodAndHasMoreThanOneDecl.getInt();
50  }
51  void setHasMoreThanOneDecl(bool B) {
52  return MethodAndHasMoreThanOneDecl.setInt(B);
53  }
54 };
55 
56 }
57 
58 #endif
void setHasMoreThanOneDecl(bool B)
ObjCMethodList(ObjCMethodDecl *M)
void setMethod(ObjCMethodDecl *M)
ObjCMethodDecl * getMethod() const
unsigned getBits() const
llvm::PointerIntPair< ObjCMethodList *, 2 > NextAndExtraBits
The next list object and 2 bits for extra info.
llvm::PointerIntPair< ObjCMethodDecl *, 1 > MethodAndHasMoreThanOneDecl
If there is more than one decl with this signature.
bool hasMoreThanOneDecl() const
void setNext(ObjCMethodList *L)
void setBits(unsigned B)
a linked list of methods with the same selector name but different signatures.
ObjCMethodList * getNext() const