clang: include/clang/AST/BaseSubobject.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13#ifndef LLVM_CLANG_AST_BASESUBOBJECT_H
14#define LLVM_CLANG_AST_BASESUBOBJECT_H
15
18#include "llvm/ADT/DenseMapInfo.h"
19#include "llvm/Support/type_traits.h"
20#include
21#include
22
24
25class CXXRecordDecl;
26
27
28
29
31
33
34
36
37public:
40 : Base(Base), BaseOffset(BaseOffset) {}
41
42
44
45
47
49 return LHS.Base == RHS.Base && LHS.BaseOffset == RHS.BaseOffset;
50 }
51};
52
53}
54
55namespace llvm {
56
57template<> struct DenseMapInfo<clang::BaseSubobject> {
60 DenseMapInfo<const clang::CXXRecordDecl *>::getEmptyKey(),
62 }
63
66 DenseMapInfo<const clang::CXXRecordDecl *>::getTombstoneKey(),
68 }
69
71 using PairTy = std::pair<const clang::CXXRecordDecl *, clang::CharUnits>;
72
73 return DenseMapInfo::getHashValue(PairTy(Base.getBase(),
74 Base.getBaseOffset()));
75 }
76
79 return LHS == RHS;
80 }
81};
82
83}
84
85#endif
Defines the C++ Decl subclasses, other than those for templates (found in DeclTemplate....
const CXXRecordDecl * getBase() const
getBase - Returns the base class declaration.
BaseSubobject(const CXXRecordDecl *Base, CharUnits BaseOffset)
CharUnits getBaseOffset() const
getBaseOffset - Returns the base class offset.
friend bool operator==(const BaseSubobject &LHS, const BaseSubobject &RHS)
Represents a C++ struct/union/class.
CharUnits - This is an opaque type for sizes expressed in character units.
static CharUnits fromQuantity(QuantityType Quantity)
fromQuantity - Construct a CharUnits quantity from a raw integer type.
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
static bool isEqual(const clang::BaseSubobject &LHS, const clang::BaseSubobject &RHS)
static clang::BaseSubobject getTombstoneKey()
static clang::BaseSubobject getEmptyKey()
static unsigned getHashValue(const clang::BaseSubobject &Base)