clang: include/clang/Sema/EnterExpressionEvaluationContext.h Source File (original) (raw)

Go to the documentation of this file.

1

2

3

4

5

6

7

8

9#ifndef LLVM_CLANG_SEMA_ENTEREXPRESSIONEVALUATIONCONTEXT_H

10#define LLVM_CLANG_SEMA_ENTEREXPRESSIONEVALUATIONCONTEXT_H

11

13

15

17

18

20 Sema &Actions;

21 bool Entered = true;

22

23public:

26 Decl *LambdaContextDecl = nullptr,

29 bool ShouldEnter = true)

30 : Actions(Actions), Entered(ShouldEnter) {

31 if (Entered)

32 Actions.PushExpressionEvaluationContext(NewContext, LambdaContextDecl,

33 ExprContext);

34 }

40 : Actions(Actions) {

41 Actions.PushExpressionEvaluationContext(

43 }

44

47 bool ShouldEnter = true)

48 : Actions(Actions), Entered(false) {

49

50

51

52

53 if (ShouldEnter && Actions.isUnevaluatedContext() &&

54 Actions.getLangOpts().CPlusPlus11) {

55 Actions.PushExpressionEvaluationContext(

56 Sema::ExpressionEvaluationContext::UnevaluatedList);

57 Entered = true;

58 }

59 }

60

62 if (Entered)

63 Actions.PopExpressionEvaluationContext();

64 }

65};

66

67

69 Sema &Actions;

70

71public:

75 : Actions(Actions) {

76 Actions.PushExpressionEvaluationContextForFunction(NewContext, FD);

77 }

79 Actions.PopExpressionEvaluationContext();

80 }

81};

82

83}

84

85#endif

Decl - This represents one declaration (or definition), e.g.

EnterExpressionEvaluationContextForFunction(Sema &Actions, Sema::ExpressionEvaluationContext NewContext, FunctionDecl *FD=nullptr)

Definition EnterExpressionEvaluationContext.h:72

~EnterExpressionEvaluationContextForFunction()

Definition EnterExpressionEvaluationContext.h:78

EnterExpressionEvaluationContext(Sema &Actions, InitListTag, bool ShouldEnter=true)

Definition EnterExpressionEvaluationContext.h:46

EnterExpressionEvaluationContext(Sema &Actions, Sema::ExpressionEvaluationContext NewContext, Sema::ReuseLambdaContextDecl_t, Sema::ExpressionEvaluationContextRecord::ExpressionKind ExprContext=Sema::ExpressionEvaluationContextRecord::EK_Other)

Definition EnterExpressionEvaluationContext.h:35

~EnterExpressionEvaluationContext()

Definition EnterExpressionEvaluationContext.h:61

EnterExpressionEvaluationContext(Sema &Actions, Sema::ExpressionEvaluationContext NewContext, Decl *LambdaContextDecl=nullptr, Sema::ExpressionEvaluationContextRecord::ExpressionKind ExprContext=Sema::ExpressionEvaluationContextRecord::EK_Other, bool ShouldEnter=true)

Definition EnterExpressionEvaluationContext.h:24

InitListTag

Definition EnterExpressionEvaluationContext.h:45

@ InitList

Definition EnterExpressionEvaluationContext.h:45

Represents a function declaration or definition.

Sema - This implements semantic analysis and AST building for C.

ExpressionEvaluationContext

Describes how the expressions currently being parsed are evaluated at run-time, if at all.

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

ExpressionKind

Describes whether we are in an expression constext which we have to handle differently.