clang: lib/AST/ByteCode/FunctionPointer.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_CLANG_AST_INTERP_FUNCTION_POINTER_H
10#define LLVM_CLANG_AST_INTERP_FUNCTION_POINTER_H
11
14
16class ASTContext;
18namespace interp {
19
21private:
23 uint64_t Offset;
24 bool Valid;
25
26public:
30
32 : Func(reinterpret_cast<const Function *>(IntVal)), Offset(0),
34
36 uint64_t getOffset() const { return Offset; }
38 bool isValid() const { return Valid; }
40 if ( || !Valid ||
->getDecl())
41 return false;
42
43 return Func->getDecl()->isWeak();
44 }
45
47 void print(llvm::raw_ostream &OS) const;
48
51 return "nullptr";
52
54 }
55
57 return static_cast<uint64_t>(reinterpret_cast<uintptr_t>(Func));
58 }
59
61 if (Func == RHS.Func && Offset == RHS.Offset)
64 }
65};
66
67inline llvm::raw_ostream &operator<<(llvm::raw_ostream &OS,
70 return OS;
71}
72
73}
74}
75
76#endif
APValue - This class implements a discriminated union of [uninitialized] [APSInt] [APFloat],...
std::string getAsString(const ASTContext &Ctx, QualType Ty) const
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
void print(llvm::raw_ostream &OS) const
const Function * getFunction() const
FunctionPointer(uintptr_t IntVal, const Descriptor *Desc=nullptr)
uint64_t getOffset() const
FunctionPointer()=default
ComparisonCategoryResult compare(const FunctionPointer &RHS) const
APValue toAPValue(const ASTContext &) const
FunctionPointer(const Function *Func, uint64_t Offset=0)
uint64_t getIntegerRepresentation() const
std::string toDiagnosticString(const ASTContext &Ctx) const
llvm::raw_ostream & operator<<(llvm::raw_ostream &OS, const Boolean &B)
The JSON file list parser is used to communicate input to InstallAPI.
ComparisonCategoryResult
An enumeration representing the possible results of a three-way comparison.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
Describes a memory block created by an allocation site.