clang: include/clang/AST/LambdaCapture.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14#ifndef LLVM_CLANG_AST_LAMBDACAPTURE_H

15#define LLVM_CLANG_AST_LAMBDACAPTURE_H

16

19#include "llvm/ADT/PointerIntPair.h"

20

22

23

24

26 enum {

27

28

29 Capture_Implicit = 0x01,

30

31

32

33

34

35 Capture_ByCopy = 0x02,

36

37

38

39 Capture_This = 0x04

40 };

41

42

43

44

45

46

47

48

49 llvm::PointerIntPair<Decl*, 3> DeclAndBits;

50

53

56

57public:

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

76

77

79

80

81

83 return DeclAndBits.getPointer() == nullptr &&

84 (DeclAndBits.getInt() & Capture_This);

85 }

86

87

89 return isa_and_nonnull(DeclAndBits.getPointer());

90 }

91

92

93

95 return DeclAndBits.getPointer() == nullptr &&

96 !(DeclAndBits.getInt() & Capture_This);

97 }

98

99

100

101

102

103

105 assert(capturesVariable() && "No variable available for capture");

106 return static_cast<ValueDecl *>(DeclAndBits.getPointer());

107 }

108

109

110

112 return DeclAndBits.getInt() & Capture_Implicit;

113 }

114

115

116

118

119

120

121

122

123

124

126

127

128

130

131

132

134 assert(isPackExpansion() && "No ellipsis location for a non-expansion");

135 return EllipsisLoc;

136 }

137};

138

139}

140

141#endif

enum clang::sema::@1725::IndirectLocalPathEntry::EntryKind Kind

Defines several types used to describe C++ lambda expressions that are shared between the parser and ...

Describes the capture of a variable or of this, or of a C++1y init-capture.

bool capturesVariable() const

Determine whether this capture handles a variable.

bool isPackExpansion() const

Determine whether this capture is a pack expansion, which captures a function parameter pack.

bool capturesVLAType() const

Determine whether this captures a variable length array bound expression.

bool isExplicit() const

Determine whether this was an explicit capture (written between the square brackets introducing the l...

SourceLocation getEllipsisLoc() const

Retrieve the location of the ellipsis for a capture that is a pack expansion.

LambdaCaptureKind getCaptureKind() const

Determine the kind of capture.

bool capturesThis() const

Determine whether this capture handles the C++ this pointer.

ValueDecl * getCapturedVar() const

Retrieve the declaration of the local variable being captured.

bool isImplicit() const

Determine whether this was an implicit capture (not written between the square brackets introducing t...

SourceLocation getLocation() const

Retrieve the source location of the capture.

Encodes a location in the source.

bool isValid() const

Return true if this is a valid SourceLocation object.

Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...

The JSON file list parser is used to communicate input to InstallAPI.

LambdaCaptureKind

The different capture forms in a lambda introducer.

@ Implicit

An implicit conversion.