clang 8.0.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 "clang/AST/DeclObjC.h"
18 #include "llvm/ADT/PointerIntPair.h"
19
20 namespace clang {
21
22 class ObjCMethodDecl;
23
24 /// a linked list of methods with the same selector name but different
25 /// signatures.
26 struct ObjCMethodList {
27 // NOTE: If you add any members to this struct, make sure to serialize them.
28 /// If there is more than one decl with this signature.
29 llvm::PointerIntPair<ObjCMethodDecl *, 1> MethodAndHasMoreThanOneDecl;
30 /// The next list object and 2 bits for extra info.
31 llvm::PointerIntPair<ObjCMethodList *, 2> NextAndExtraBits;
32
33 ObjCMethodList() { }
34 ObjCMethodList(ObjCMethodDecl *M)
35 : MethodAndHasMoreThanOneDecl(M, 0) {}
36 ObjCMethodList(const ObjCMethodList &L)
37 : MethodAndHasMoreThanOneDecl(L.MethodAndHasMoreThanOneDecl),
38 NextAndExtraBits(L.NextAndExtraBits) {}
39
40 ObjCMethodList *getNext() const { return NextAndExtraBits.getPointer(); }
41 unsigned getBits() const { return NextAndExtraBits.getInt(); }
42 void setNext(ObjCMethodList *L) { NextAndExtraBits.setPointer(L); }
43 void setBits(unsigned B) { NextAndExtraBits.setInt(B); }
44
45 ObjCMethodDecl *getMethod() const {
46 return MethodAndHasMoreThanOneDecl.getPointer();
47 }
48 void setMethod(ObjCMethodDecl *M) {
49 return MethodAndHasMoreThanOneDecl.setPointer(M);
50 }
51
52 bool hasMoreThanOneDecl() const {
53 return MethodAndHasMoreThanOneDecl.getInt();
54 }
55 void setHasMoreThanOneDecl(bool B) {
56 return MethodAndHasMoreThanOneDecl.setInt(B);
57 }
58 };
59
60 }
61
62 #endif
clang::ObjCMethodList::ObjCMethodList
ObjCMethodList(const ObjCMethodList &L)
Definition: ObjCMethodList.h:36
clang::ObjCMethodList::getBits
unsigned getBits() const
Definition: ObjCMethodList.h:41
clang::ObjCMethodList::setHasMoreThanOneDecl
void setHasMoreThanOneDecl(bool B)
Definition: ObjCMethodList.h:55
DeclObjC.h
clang::ObjCMethodList::getMethod
ObjCMethodDecl * getMethod() const
Definition: ObjCMethodList.h:45
clang::ObjCMethodDecl
ObjCMethodDecl - Represents an instance or class method declaration.
Definition: DeclObjC.h:139
clang::ObjCMethodList::ObjCMethodList
ObjCMethodList(ObjCMethodDecl *M)
Definition: ObjCMethodList.h:34
clang::ObjCMethodList::setMethod
void setMethod(ObjCMethodDecl *M)
Definition: ObjCMethodList.h:48
clang::ObjCMethodList::ObjCMethodList
ObjCMethodList()
Definition: ObjCMethodList.h:33
clang::ObjCMethodList::NextAndExtraBits
llvm::PointerIntPair< ObjCMethodList *, 2 > NextAndExtraBits
The next list object and 2 bits for extra info.
Definition: ObjCMethodList.h:31
clang::ObjCMethodList::getNext
ObjCMethodList * getNext() const
Definition: ObjCMethodList.h:40
clang::ObjCMethodList::MethodAndHasMoreThanOneDecl
llvm::PointerIntPair< ObjCMethodDecl *, 1 > MethodAndHasMoreThanOneDecl
If there is more than one decl with this signature.
Definition: ObjCMethodList.h:29
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::ObjCMethodList::setNext
void setNext(ObjCMethodList *L)
Definition: ObjCMethodList.h:42
clang::ObjCMethodList::setBits
void setBits(unsigned B)
Definition: ObjCMethodList.h:43
clang::ObjCMethodList::hasMoreThanOneDecl
bool hasMoreThanOneDecl() const
Definition: ObjCMethodList.h:52
clang::ObjCMethodList
a linked list of methods with the same selector name but different signatures.
Definition: ObjCMethodList.h:26