C++: IR construction for lambda expressions

The IR construction code wasn't handling lambda expressions, so I added `TranslatedLambdaExpression`. It's pretty straightforward: it creates a temporary variable, initializes it with an `Uninitialized` instruction, then initializes the individual captured fields with the initializer list supplied in the AST.

When testing the case of a lambda with no captures, I noticed that we weren't handling initialization of empty structs with an initializer list correctly, so I fixed that along the way.

I was getting confused by the bad indentation for wrapped lines in
TranslatedInitialization.qll, so I fixed that up in a separate commit.
This commit is contained in:
Dave Bartolomeo
2019-03-14 09:49:57 -07:00
parent f0bd1ab7ab
commit d20e5bc69c
9 changed files with 1002 additions and 4 deletions

View File

@@ -3,6 +3,6 @@ private import semmle.code.cpp.ir.internal.TempVariableTag
class TempVariableTag extends TTempVariableTag {
string toString() {
result = "Tag"
result = getTempVariableTagId(this)
}
}

View File

@@ -99,6 +99,7 @@ class InstructionTag extends TInstructionTag {
string getInstructionTagId(TInstructionTag tag) {
tag = OnlyInstructionTag() and result = "Only" or // Single instruction (not including implicit Load)
tag = InitializerVariableAddressTag() and result = "InitVarAddr" or
tag = InitializerLoadStringTag() and result = "InitLoadStr" or
tag = InitializerStoreTag() and result = "InitStore" or
tag = InitializerUninitializedTag() and result = "InitUninit" or
tag = ZeroPadStringConstantTag() and result = "ZeroPadConst" or

View File

@@ -268,6 +268,9 @@ newtype TTranslatedElement =
) or
exists(ThrowExpr throw |
throw.getExpr().getFullyConverted() = expr
) or
exists(LambdaExpression lambda |
lambda.getChild(0).getFullyConverted() = expr
)
)
} or

View File

@@ -2608,3 +2608,122 @@ class TranslatedConditionDeclExpr extends TranslatedNonConstantExpr {
result = getTranslatedExpr(expr.getVariableAccess().getFullyConverted())
}
}
/**
* The IR translation of a lambda expression. This initializes a temporary variable whose type is that of the lambda,
* using the initializer list that represents the captures of the lambda.
*/
class TranslatedLambdaExpr extends TranslatedNonConstantExpr, InitializationContext {
override LambdaExpression expr;
override final Instruction getFirstInstruction() {
result = getInstruction(InitializerVariableAddressTag())
}
override final TranslatedElement getChild(int id) {
id = 0 and result = getInitialization()
}
override Instruction getResult() {
result = getInstruction(LoadTag())
}
override Instruction getInstructionSuccessor(InstructionTag tag, EdgeKind kind) {
(
tag = InitializerVariableAddressTag() and
kind instanceof GotoEdge and
result = getInstruction(InitializerStoreTag())
) or
(
tag = InitializerStoreTag() and
kind instanceof GotoEdge and
(
result = getInitialization().getFirstInstruction() or
not hasInitializer() and result = getInstruction(LoadTag())
)
) or
(
tag = LoadTag() and
kind instanceof GotoEdge and
result = getParent().getChildSuccessor(this)
)
}
override Instruction getChildSuccessor(TranslatedElement child) {
child = getInitialization() and
result = getInstruction(LoadTag())
}
override predicate hasInstruction(Opcode opcode, InstructionTag tag, Type resultType,
boolean isGLValue) {
(
tag = InitializerVariableAddressTag() and
opcode instanceof Opcode::VariableAddress and
resultType = getResultType() and
isGLValue = true
) or
(
tag = InitializerStoreTag() and
opcode instanceof Opcode::Uninitialized and
resultType = getResultType() and
isGLValue = false
) or
(
tag = LoadTag() and
opcode instanceof Opcode::Load and
resultType = getResultType() and
isGLValue = false
)
}
override Instruction getInstructionOperand(InstructionTag tag,
OperandTag operandTag) {
(
tag = InitializerStoreTag() and
operandTag instanceof AddressOperandTag and
result = getInstruction(InitializerVariableAddressTag())
) or
(
tag = LoadTag() and
(
(
operandTag instanceof AddressOperandTag and
result = getInstruction(InitializerVariableAddressTag())
) or
(
operandTag instanceof LoadOperandTag and
result = getEnclosingFunction().getUnmodeledDefinitionInstruction()
)
)
)
}
override IRVariable getInstructionVariable(InstructionTag tag) {
(
tag = InitializerVariableAddressTag() or
tag = InitializerStoreTag()
) and
result = getTempVariable(LambdaTempVar())
}
override predicate hasTempVariable(TempVariableTag tag, Type type) {
tag = LambdaTempVar() and
type = getResultType()
}
override final Instruction getTargetAddress() {
result = getInstruction(InitializerVariableAddressTag())
}
override final Type getTargetType() {
result = getResultType()
}
private predicate hasInitializer() {
exists(getInitialization())
}
private TranslatedInitialization getInitialization() {
result = getTranslatedInitialization(expr.getChild(0).getFullyConverted())
}
}

View File

@@ -79,7 +79,8 @@ abstract class TranslatedInitialization extends TranslatedElement, TTranslatedIn
*/
abstract class TranslatedListInitialization extends TranslatedInitialization, InitializationContext {
override Instruction getFirstInstruction() {
result = getChild(0).getFirstInstruction()
result = getChild(0).getFirstInstruction() or
not exists(getChild(0)) and result = getParent().getChildSuccessor(this)
}
override Instruction getChildSuccessor(TranslatedElement child) {

View File

@@ -3,10 +3,12 @@ import cpp
newtype TTempVariableTag =
ConditionValueTempVar() or
ReturnValueTempVar() or
ThrowTempVar()
ThrowTempVar() or
LambdaTempVar()
string getTempVariableTagId(TTempVariableTag tag) {
tag = ConditionValueTempVar() and result = "CondVal" or
tag = ReturnValueTempVar() and result = "Ret" or
tag = ThrowTempVar() and result = "Throw"
tag = ThrowTempVar() and result = "Throw" or
tag = LambdaTempVar() and result = "Lambda"
}

View File

@@ -6627,3 +6627,524 @@ ir.cpp:
# 988| Type = double
# 988| Value = 1.0
# 988| ValueCategory = prvalue
# 1009| EmptyStruct& EmptyStruct::operator=(EmptyStruct const&)
# 1009| params:
#-----| 0: p#0
#-----| Type = const EmptyStruct &
# 1009| EmptyStruct& EmptyStruct::operator=(EmptyStruct&&)
# 1009| params:
#-----| 0: p#0
#-----| Type = EmptyStruct &&
# 1011| void EmptyStructInit()
# 1011| params:
# 1011| body: { ... }
# 1012| 0: declaration
# 1012| 0: definition of s
# 1012| Type = EmptyStruct
# 1012| init: initializer for s
# 1012| expr: {...}
# 1012| Type = EmptyStruct
# 1012| ValueCategory = prvalue
# 1013| 1: return ...
# 1015| (lambda [] type at line 1015, col. 12)& (lambda [] type at line 1015, col. 12)::operator=((lambda [] type at line 1015, col. 12) const&)
# 1015| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1015, col. 12 &
# 1015| void (lambda [] type at line 1015, col. 12)::(constructor)((lambda [] type at line 1015, col. 12) const&)
# 1015| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1015, col. 12 &
# 1015| void (lambda [] type at line 1015, col. 12)::(constructor)((lambda [] type at line 1015, col. 12)&&)
# 1015| params:
#-----| 0: p#0
#-----| Type = lambda [] type at line 1015, col. 12 &&
# 1015| initializations:
# 1015| body: { ... }
# 1015| 0: return ...
# 1015| void (lambda [] type at line 1015, col. 12)::(constructor)()
# 1015| params:
# 1015| void (lambda [] type at line 1015, col. 12)::_FUN()
# 1015| params:
# 1015| void (lambda [] type at line 1015, col. 12)::operator()() const
# 1015| params:
# 1015| body: { ... }
# 1015| 0: return ...
# 1015| void(* (lambda [] type at line 1015, col. 12)::operator void (*)()() const)()
# 1015| params:
#-----| body: { ... }
# 1015| 0: return ...
# 1015| 0: _FUN
# 1015| Type = ..(*)(..)
# 1015| ValueCategory = prvalue(load)
# 1017| void Lambda(int, String const&)
# 1017| params:
# 1017| 0: x
# 1017| Type = int
# 1017| 1: s
# 1017| Type = const String &
# 1017| body: { ... }
# 1018| 0: declaration
# 1018| 0: definition of lambda_empty
# 1018| Type = decltype([...](...){...})
# 1018| init: initializer for lambda_empty
# 1018| expr: [...](...){...}
# 1018| Type = decltype([...](...){...})
# 1018| ValueCategory = prvalue
# 1019| 1: ExprStmt
# 1019| 0: call to operator()
# 1019| Type = char
# 1019| Value = 65
# 1019| ValueCategory = prvalue
# 1019| -1: (const lambda [] type at line 1018, col. 23)...
# 1019| Conversion = glvalue conversion
# 1019| Type = const lambda [] type at line 1018, col. 23
# 1019| ValueCategory = lvalue
# 1019| expr: lambda_empty
# 1019| Type = decltype([...](...){...})
# 1019| ValueCategory = lvalue
# 1019| 0: (float)...
# 1019| Conversion = integral to floating point conversion
# 1019| Type = float
# 1019| Value = 0.0
# 1019| ValueCategory = prvalue
# 1019| expr: 0
# 1019| Type = int
# 1019| Value = 0
# 1019| ValueCategory = prvalue
# 1020| 2: declaration
# 1020| 0: definition of lambda_ref
# 1020| Type = decltype([...](...){...})
# 1020| init: initializer for lambda_ref
# 1020| expr: [...](...){...}
# 1020| Type = decltype([...](...){...})
# 1020| ValueCategory = prvalue
# 1020| 0: {...}
# 1020| Type = decltype([...](...){...})
# 1020| ValueCategory = prvalue
# 1020| .s: (reference to)
# 1020| Type = const String &
# 1020| ValueCategory = prvalue
# 1020| expr: (reference dereference)
# 1020| Type = const String
# 1020| ValueCategory = lvalue
#-----| expr: s
#-----| Type = const String &
#-----| ValueCategory = prvalue(load)
#-----| .x: (reference to)
#-----| Type = int &
#-----| ValueCategory = prvalue
#-----| expr: x
#-----| Type = int
#-----| ValueCategory = lvalue
# 1021| 3: ExprStmt
# 1021| 0: call to operator()
# 1021| Type = char
# 1021| ValueCategory = prvalue
# 1021| -1: (const lambda [] type at line 1020, col. 21)...
# 1021| Conversion = glvalue conversion
# 1021| Type = const lambda [] type at line 1020, col. 21
# 1021| ValueCategory = lvalue
# 1021| expr: lambda_ref
# 1021| Type = decltype([...](...){...})
# 1021| ValueCategory = lvalue
# 1021| 0: (float)...
# 1021| Conversion = integral to floating point conversion
# 1021| Type = float
# 1021| Value = 1.0
# 1021| ValueCategory = prvalue
# 1021| expr: 1
# 1021| Type = int
# 1021| Value = 1
# 1021| ValueCategory = prvalue
# 1022| 4: declaration
# 1022| 0: definition of lambda_val
# 1022| Type = decltype([...](...){...})
# 1022| init: initializer for lambda_val
# 1022| expr: call to (constructor)
# 1022| Type = void
# 1022| ValueCategory = prvalue
# 1022| 0: (reference to)
# 1022| Type = lambda [] type at line 1022, col. 21 &
# 1022| ValueCategory = prvalue
# 1022| expr: [...](...){...}
# 1022| Type = decltype([...](...){...})
# 1022| ValueCategory = prvalue
# 1022| 0: {...}
# 1022| Type = decltype([...](...){...})
# 1022| ValueCategory = prvalue
#-----| .s: call to String
#-----| Type = void
#-----| ValueCategory = prvalue
#-----| .x: x
#-----| Type = int
#-----| ValueCategory = prvalue(load)
# 1023| 5: ExprStmt
# 1023| 0: call to operator()
# 1023| Type = char
# 1023| ValueCategory = prvalue
# 1023| -1: (const lambda [] type at line 1022, col. 21)...
# 1023| Conversion = glvalue conversion
# 1023| Type = const lambda [] type at line 1022, col. 21
# 1023| ValueCategory = lvalue
# 1023| expr: lambda_val
# 1023| Type = decltype([...](...){...})
# 1023| ValueCategory = lvalue
# 1023| 0: (float)...
# 1023| Conversion = integral to floating point conversion
# 1023| Type = float
# 1023| Value = 2.0
# 1023| ValueCategory = prvalue
# 1023| expr: 2
# 1023| Type = int
# 1023| Value = 2
# 1023| ValueCategory = prvalue
# 1024| 6: declaration
# 1024| 0: definition of lambda_ref_explicit
# 1024| Type = decltype([...](...){...})
# 1024| init: initializer for lambda_ref_explicit
# 1024| expr: [...](...){...}
# 1024| Type = decltype([...](...){...})
# 1024| ValueCategory = prvalue
# 1024| 0: {...}
# 1024| Type = decltype([...](...){...})
# 1024| ValueCategory = prvalue
# 1024| .s: (reference to)
# 1024| Type = const String &
# 1024| ValueCategory = prvalue
# 1024| expr: (reference dereference)
# 1024| Type = const String
# 1024| ValueCategory = lvalue
# 1024| expr: s
# 1024| Type = const String &
# 1024| ValueCategory = prvalue(load)
# 1025| 7: ExprStmt
# 1025| 0: call to operator()
# 1025| Type = char
# 1025| ValueCategory = prvalue
# 1025| -1: (const lambda [] type at line 1024, col. 30)...
# 1025| Conversion = glvalue conversion
# 1025| Type = const lambda [] type at line 1024, col. 30
# 1025| ValueCategory = lvalue
# 1025| expr: lambda_ref_explicit
# 1025| Type = decltype([...](...){...})
# 1025| ValueCategory = lvalue
# 1025| 0: (float)...
# 1025| Conversion = integral to floating point conversion
# 1025| Type = float
# 1025| Value = 3.0
# 1025| ValueCategory = prvalue
# 1025| expr: 3
# 1025| Type = int
# 1025| Value = 3
# 1025| ValueCategory = prvalue
# 1026| 8: declaration
# 1026| 0: definition of lambda_val_explicit
# 1026| Type = decltype([...](...){...})
# 1026| init: initializer for lambda_val_explicit
# 1026| expr: call to (constructor)
# 1026| Type = void
# 1026| ValueCategory = prvalue
# 1026| 0: (reference to)
# 1026| Type = lambda [] type at line 1026, col. 30 &
# 1026| ValueCategory = prvalue
# 1026| expr: [...](...){...}
# 1026| Type = decltype([...](...){...})
# 1026| ValueCategory = prvalue
# 1026| 0: {...}
# 1026| Type = decltype([...](...){...})
# 1026| ValueCategory = prvalue
#-----| .s: call to String
#-----| Type = void
#-----| ValueCategory = prvalue
# 1027| 9: ExprStmt
# 1027| 0: call to operator()
# 1027| Type = char
# 1027| ValueCategory = prvalue
# 1027| -1: (const lambda [] type at line 1026, col. 30)...
# 1027| Conversion = glvalue conversion
# 1027| Type = const lambda [] type at line 1026, col. 30
# 1027| ValueCategory = lvalue
# 1027| expr: lambda_val_explicit
# 1027| Type = decltype([...](...){...})
# 1027| ValueCategory = lvalue
# 1027| 0: (float)...
# 1027| Conversion = integral to floating point conversion
# 1027| Type = float
# 1027| Value = 4.0
# 1027| ValueCategory = prvalue
# 1027| expr: 4
# 1027| Type = int
# 1027| Value = 4
# 1027| ValueCategory = prvalue
# 1028| 10: return ...
# 1018| (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)& (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23) const&)
# 1018| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1018, col. 23 &
# 1018| void (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23) const&)
# 1018| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1018, col. 23 &
# 1018| void (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)&&)
# 1018| params:
#-----| 0: p#0
#-----| Type = lambda [] type at line 1018, col. 23 &&
# 1018| initializations:
# 1018| body: { ... }
# 1018| 0: return ...
# 1018| void (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::(constructor)()
# 1018| params:
# 1018| char (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::_FUN(float)
# 1018| params:
# 1018| 0: f
# 1018| Type = float
# 1018| char (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator()(float) const
# 1018| params:
# 1018| 0: f
# 1018| Type = float
# 1018| body: { ... }
# 1018| 0: return ...
# 1018| 0: 65
# 1018| Type = char
# 1018| Value = 65
# 1018| ValueCategory = prvalue
# 1018| char(* (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator char (*)(float)() const)(float)
# 1018| params:
#-----| body: { ... }
# 1018| 0: return ...
# 1018| 0: _FUN
# 1018| Type = ..(*)(..)
# 1018| ValueCategory = prvalue(load)
# 1020| (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)& (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21) const&)
# 1020| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1020, col. 21 &
# 1020| void (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21) const&)
# 1020| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1020, col. 21 &
# 1020| void (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)&&)
# 1020| params:
#-----| 0: p#0
#-----| Type = lambda [] type at line 1020, col. 21 &&
# 1020| initializations:
# 1020| 0: constructor init of field s
# 1020| Type = const String &
# 1020| ValueCategory = prvalue
# 1020| 0: Unknown literal
# 1020| Type = const String &
# 1020| ValueCategory = prvalue
# 1020| 1: constructor init of field x
# 1020| Type = int &
# 1020| ValueCategory = prvalue
# 1020| 0: Unknown literal
# 1020| Type = int &
# 1020| ValueCategory = prvalue
# 1020| body: { ... }
# 1020| 0: return ...
# 1020| void (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::(constructor)()
# 1020| params:
# 1020| char (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::operator()(float) const
# 1020| params:
# 1020| 0: f
# 1020| Type = float
# 1020| body: { ... }
# 1020| 0: return ...
# 1020| 0: access to array
# 1020| Type = char
# 1020| ValueCategory = prvalue(load)
# 1020| 0: call to c_str
# 1020| Type = const char *
# 1020| ValueCategory = prvalue
# 1020| -1: (reference dereference)
# 1020| Type = const String
# 1020| ValueCategory = lvalue
#-----| expr: s
#-----| Type = const String &
#-----| ValueCategory = prvalue(load)
#-----| -1: this
#-----| Type = const lambda [] type at line 1020, col. 21 *
#-----| ValueCategory = prvalue(load)
# 1020| 1: (reference dereference)
# 1020| Type = int
# 1020| ValueCategory = prvalue(load)
#-----| expr: x
#-----| Type = int &
#-----| ValueCategory = prvalue(load)
#-----| -1: this
#-----| Type = const lambda [] type at line 1020, col. 21 *
#-----| ValueCategory = prvalue(load)
# 1022| (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)& (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21) const&)
# 1022| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1022, col. 21 &
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21) const&)
# 1022| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1022, col. 21 &
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)&&)
# 1022| params:
#-----| 0: p#0
#-----| Type = lambda [] type at line 1022, col. 21 &&
# 1022| initializations:
# 1022| 0: constructor init of field s
# 1022| Type = const String
# 1022| ValueCategory = prvalue
# 1022| 0: call to String
# 1022| Type = void
# 1022| ValueCategory = prvalue
# 1022| 1: constructor init of field x
# 1022| Type = int
# 1022| ValueCategory = prvalue
# 1022| 0: Unknown literal
# 1022| Type = int
# 1022| ValueCategory = prvalue
# 1022| body: { ... }
# 1022| 0: return ...
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::(constructor)()
# 1022| params:
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::~<unnamed>()
# 1022| params:
#-----| body: { ... }
#-----| 0: return ...
# 1022| destructions:
# 1022| 0: destructor field destruction of s
# 1022| Type = const String
# 1022| ValueCategory = prvalue
# 1022| 0: call to ~String
# 1022| Type = void
# 1022| ValueCategory = prvalue
# 1022| -1: s
# 1022| Type = const String
# 1022| ValueCategory = lvalue
# 1022| char (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::operator()(float) const
# 1022| params:
# 1022| 0: f
# 1022| Type = float
# 1022| body: { ... }
# 1022| 0: return ...
# 1022| 0: access to array
# 1022| Type = char
# 1022| ValueCategory = prvalue(load)
# 1022| 0: call to c_str
# 1022| Type = const char *
# 1022| ValueCategory = prvalue
#-----| -1: s
#-----| Type = const String
#-----| ValueCategory = lvalue
#-----| -1: this
#-----| Type = const lambda [] type at line 1022, col. 21 *
#-----| ValueCategory = prvalue(load)
#-----| 1: x
#-----| Type = int
#-----| ValueCategory = prvalue(load)
#-----| -1: this
#-----| Type = const lambda [] type at line 1022, col. 21 *
#-----| ValueCategory = prvalue(load)
# 1024| (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)& (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30) const&)
# 1024| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1024, col. 30 &
# 1024| void (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30) const&)
# 1024| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1024, col. 30 &
# 1024| void (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)&&)
# 1024| params:
#-----| 0: p#0
#-----| Type = lambda [] type at line 1024, col. 30 &&
# 1024| initializations:
# 1024| 0: constructor init of field s
# 1024| Type = const String &
# 1024| ValueCategory = prvalue
# 1024| 0: Unknown literal
# 1024| Type = const String &
# 1024| ValueCategory = prvalue
# 1024| body: { ... }
# 1024| 0: return ...
# 1024| void (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::(constructor)()
# 1024| params:
# 1024| char (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::operator()(float) const
# 1024| params:
# 1024| 0: f
# 1024| Type = float
# 1024| body: { ... }
# 1024| 0: return ...
# 1024| 0: access to array
# 1024| Type = char
# 1024| ValueCategory = prvalue(load)
# 1024| 0: call to c_str
# 1024| Type = const char *
# 1024| ValueCategory = prvalue
# 1024| -1: (reference dereference)
# 1024| Type = const String
# 1024| ValueCategory = lvalue
#-----| expr: s
#-----| Type = const String &
#-----| ValueCategory = prvalue(load)
#-----| -1: this
#-----| Type = const lambda [] type at line 1024, col. 30 *
#-----| ValueCategory = prvalue(load)
# 1024| 1: 0
# 1024| Type = int
# 1024| Value = 0
# 1024| ValueCategory = prvalue
# 1026| (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)& (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::operator=((void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30) const&)
# 1026| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1026, col. 30 &
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30) const&)
# 1026| params:
#-----| 0: p#0
#-----| Type = const lambda [] type at line 1026, col. 30 &
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)&&)
# 1026| params:
#-----| 0: p#0
#-----| Type = lambda [] type at line 1026, col. 30 &&
# 1026| initializations:
# 1026| 0: constructor init of field s
# 1026| Type = const String
# 1026| ValueCategory = prvalue
# 1026| 0: call to String
# 1026| Type = void
# 1026| ValueCategory = prvalue
# 1026| body: { ... }
# 1026| 0: return ...
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::(constructor)()
# 1026| params:
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::~<unnamed>()
# 1026| params:
#-----| body: { ... }
#-----| 0: return ...
# 1026| destructions:
# 1026| 0: destructor field destruction of s
# 1026| Type = const String
# 1026| ValueCategory = prvalue
# 1026| 0: call to ~String
# 1026| Type = void
# 1026| ValueCategory = prvalue
# 1026| -1: s
# 1026| Type = const String
# 1026| ValueCategory = lvalue
# 1026| char (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::operator()(float) const
# 1026| params:
# 1026| 0: f
# 1026| Type = float
# 1026| body: { ... }
# 1026| 0: return ...
# 1026| 0: access to array
# 1026| Type = char
# 1026| ValueCategory = prvalue(load)
# 1026| 0: call to c_str
# 1026| Type = const char *
# 1026| ValueCategory = prvalue
#-----| -1: s
#-----| Type = const String
#-----| ValueCategory = lvalue
#-----| -1: this
#-----| Type = const lambda [] type at line 1026, col. 30 *
#-----| ValueCategory = prvalue(load)
# 1026| 1: 0
# 1026| Type = int
# 1026| Value = 0
# 1026| ValueCategory = prvalue

View File

@@ -1006,4 +1006,25 @@ void OperatorDeleteArray() {
}
#endif
struct EmptyStruct {};
void EmptyStructInit() {
EmptyStruct s = {};
}
auto lam = []() {};
void Lambda(int x, const String& s) {
auto lambda_empty = [](float f) { return 'A'; };
lambda_empty(0);
auto lambda_ref = [&](float f) { return s.c_str()[x]; };
lambda_ref(1);
auto lambda_val = [=](float f) { return s.c_str()[x]; };
lambda_val(2);
auto lambda_ref_explicit = [&s](float f) { return s.c_str()[0]; };
lambda_ref_explicit(3);
auto lambda_val_explicit = [s](float f) { return s.c_str()[0]; };
lambda_val_explicit(4);
}
// semmle-extractor-options: -std=c++17

View File

@@ -4366,3 +4366,333 @@ ir.cpp:
# 987| v0_21(void) = ReturnValue : r0_20, mu0_2
# 987| v0_22(void) = UnmodeledUse : mu*
# 987| v0_23(void) = ExitFunction :
# 1011| void EmptyStructInit()
# 1011| Block 0
# 1011| v0_0(void) = EnterFunction :
# 1011| mu0_1(unknown) = AliasedDefinition :
# 1011| mu0_2(unknown) = UnmodeledDefinition :
# 1012| r0_3(glval<EmptyStruct>) = VariableAddress[s] :
# 1012| mu0_4(EmptyStruct) = Uninitialized[s] : r0_3
# 1013| v0_5(void) = NoOp :
# 1011| v0_6(void) = ReturnVoid :
# 1011| v0_7(void) = UnmodeledUse : mu*
# 1011| v0_8(void) = ExitFunction :
# 1015| void (lambda [] type at line 1015, col. 12)::(constructor)((lambda [] type at line 1015, col. 12)&&)
# 1015| Block 0
# 1015| v0_0(void) = EnterFunction :
# 1015| mu0_1(unknown) = AliasedDefinition :
# 1015| mu0_2(unknown) = UnmodeledDefinition :
# 1015| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
#-----| r0_4(glval<lambda [] type at line 1015, col. 12 &&>) = VariableAddress[p#0] :
#-----| mu0_5(lambda [] type at line 1015, col. 12 &&) = InitializeParameter[p#0] : r0_4
# 1015| v0_6(void) = NoOp :
# 1015| v0_7(void) = ReturnVoid :
# 1015| v0_8(void) = UnmodeledUse : mu*
# 1015| v0_9(void) = ExitFunction :
# 1015| void (lambda [] type at line 1015, col. 12)::operator()() const
# 1015| Block 0
# 1015| v0_0(void) = EnterFunction :
# 1015| mu0_1(unknown) = AliasedDefinition :
# 1015| mu0_2(unknown) = UnmodeledDefinition :
# 1015| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
# 1015| v0_4(void) = NoOp :
# 1015| v0_5(void) = ReturnVoid :
# 1015| v0_6(void) = UnmodeledUse : mu*
# 1015| v0_7(void) = ExitFunction :
# 1015| void(* (lambda [] type at line 1015, col. 12)::operator void (*)()() const)()
# 1015| Block 0
# 1015| v0_0(void) = EnterFunction :
# 1015| mu0_1(unknown) = AliasedDefinition :
# 1015| mu0_2(unknown) = UnmodeledDefinition :
# 1015| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
# 1015| r0_4(glval<..(*)(..)>) = VariableAddress[#return] :
# 1015| r0_5(glval<..(*)(..)>) = FunctionAddress[_FUN] :
# 1015| mu0_6(..(*)(..)) = Store : r0_4, r0_5
# 1015| r0_7(glval<..(*)(..)>) = VariableAddress[#return] :
# 1015| v0_8(void) = ReturnValue : r0_7, mu0_2
# 1015| v0_9(void) = UnmodeledUse : mu*
# 1015| v0_10(void) = ExitFunction :
# 1017| void Lambda(int, String const&)
# 1017| Block 0
# 1017| v0_0(void) = EnterFunction :
# 1017| mu0_1(unknown) = AliasedDefinition :
# 1017| mu0_2(unknown) = UnmodeledDefinition :
# 1017| r0_3(glval<int>) = VariableAddress[x] :
# 1017| mu0_4(int) = InitializeParameter[x] : r0_3
# 1017| r0_5(glval<String &>) = VariableAddress[s] :
# 1017| mu0_6(String &) = InitializeParameter[s] : r0_5
# 1018| r0_7(glval<decltype([...](...){...})>) = VariableAddress[lambda_empty] :
# 1018| r0_8(glval<decltype([...](...){...})>) = VariableAddress[#temp1018:23] :
# 1018| mu0_9(decltype([...](...){...})) = Uninitialized[#temp1018:23] : r0_8
# 1018| r0_10(decltype([...](...){...})) = Load : r0_8, mu0_2
# 1018| mu0_11(decltype([...](...){...})) = Store : r0_7, r0_10
# 1019| r0_12(char) = Constant[65] :
# 1020| r0_13(glval<decltype([...](...){...})>) = VariableAddress[lambda_ref] :
# 1020| r0_14(glval<decltype([...](...){...})>) = VariableAddress[#temp1020:21] :
# 1020| mu0_15(decltype([...](...){...})) = Uninitialized[#temp1020:21] : r0_14
# 1020| r0_16(glval<String &>) = FieldAddress[s] : r0_14
#-----| r0_17(glval<String &>) = VariableAddress[s] :
#-----| r0_18(String &) = Load : r0_17, mu0_2
# 1020| mu0_19(String &) = Store : r0_16, r0_18
# 1020| r0_20(glval<int &>) = FieldAddress[x] : r0_14
#-----| r0_21(glval<int>) = VariableAddress[x] :
#-----| mu0_22(int &) = Store : r0_20, r0_21
# 1020| r0_23(decltype([...](...){...})) = Load : r0_14, mu0_2
# 1020| mu0_24(decltype([...](...){...})) = Store : r0_13, r0_23
# 1021| r0_25(glval<decltype([...](...){...})>) = VariableAddress[lambda_ref] :
# 1021| r0_26(glval<decltype([...](...){...})>) = Convert : r0_25
# 1021| r0_27(glval<unknown>) = FunctionAddress[operator()] :
# 1021| r0_28(float) = Constant[1.0] :
# 1021| r0_29(char) = Call : r0_27, this:r0_26, r0_28
# 1021| mu0_30(unknown) = ^CallSideEffect : mu0_2
# 1022| r0_31(glval<decltype([...](...){...})>) = VariableAddress[lambda_val] :
# 1022| r0_32(glval<unknown>) = FunctionAddress[(constructor)] :
# 1022| r0_33(glval<decltype([...](...){...})>) = VariableAddress[#temp1022:21] :
# 1022| mu0_34(decltype([...](...){...})) = Uninitialized[#temp1022:21] : r0_33
# 1022| r0_35(glval<String>) = FieldAddress[s] : r0_33
#-----| r0_36(glval<unknown>) = FunctionAddress[String] :
#-----| v0_37(void) = Call : r0_36, this:r0_35
#-----| mu0_38(unknown) = ^CallSideEffect : mu0_2
# 1022| r0_39(glval<int>) = FieldAddress[x] : r0_33
#-----| r0_40(glval<int>) = VariableAddress[x] :
#-----| r0_41(int) = Load : r0_40, mu0_2
#-----| mu0_42(int) = Store : r0_39, r0_41
# 1022| r0_43(decltype([...](...){...})) = Load : r0_33, mu0_2
# 1022| v0_44(void) = Call : r0_32, this:r0_31, r0_43
# 1022| mu0_45(unknown) = ^CallSideEffect : mu0_2
# 1023| r0_46(glval<decltype([...](...){...})>) = VariableAddress[lambda_val] :
# 1023| r0_47(glval<decltype([...](...){...})>) = Convert : r0_46
# 1023| r0_48(glval<unknown>) = FunctionAddress[operator()] :
# 1023| r0_49(float) = Constant[2.0] :
# 1023| r0_50(char) = Call : r0_48, this:r0_47, r0_49
# 1023| mu0_51(unknown) = ^CallSideEffect : mu0_2
# 1024| r0_52(glval<decltype([...](...){...})>) = VariableAddress[lambda_ref_explicit] :
# 1024| r0_53(glval<decltype([...](...){...})>) = VariableAddress[#temp1024:30] :
# 1024| mu0_54(decltype([...](...){...})) = Uninitialized[#temp1024:30] : r0_53
# 1024| r0_55(glval<String &>) = FieldAddress[s] : r0_53
# 1024| r0_56(glval<String &>) = VariableAddress[s] :
# 1024| r0_57(String &) = Load : r0_56, mu0_2
# 1024| mu0_58(String &) = Store : r0_55, r0_57
# 1024| r0_59(decltype([...](...){...})) = Load : r0_53, mu0_2
# 1024| mu0_60(decltype([...](...){...})) = Store : r0_52, r0_59
# 1025| r0_61(glval<decltype([...](...){...})>) = VariableAddress[lambda_ref_explicit] :
# 1025| r0_62(glval<decltype([...](...){...})>) = Convert : r0_61
# 1025| r0_63(glval<unknown>) = FunctionAddress[operator()] :
# 1025| r0_64(float) = Constant[3.0] :
# 1025| r0_65(char) = Call : r0_63, this:r0_62, r0_64
# 1025| mu0_66(unknown) = ^CallSideEffect : mu0_2
# 1026| r0_67(glval<decltype([...](...){...})>) = VariableAddress[lambda_val_explicit] :
# 1026| r0_68(glval<unknown>) = FunctionAddress[(constructor)] :
# 1026| r0_69(glval<decltype([...](...){...})>) = VariableAddress[#temp1026:30] :
# 1026| mu0_70(decltype([...](...){...})) = Uninitialized[#temp1026:30] : r0_69
# 1026| r0_71(glval<String>) = FieldAddress[s] : r0_69
#-----| r0_72(glval<unknown>) = FunctionAddress[String] :
#-----| v0_73(void) = Call : r0_72, this:r0_71
#-----| mu0_74(unknown) = ^CallSideEffect : mu0_2
# 1026| r0_75(decltype([...](...){...})) = Load : r0_69, mu0_2
# 1026| v0_76(void) = Call : r0_68, this:r0_67, r0_75
# 1026| mu0_77(unknown) = ^CallSideEffect : mu0_2
# 1027| r0_78(glval<decltype([...](...){...})>) = VariableAddress[lambda_val_explicit] :
# 1027| r0_79(glval<decltype([...](...){...})>) = Convert : r0_78
# 1027| r0_80(glval<unknown>) = FunctionAddress[operator()] :
# 1027| r0_81(float) = Constant[4.0] :
# 1027| r0_82(char) = Call : r0_80, this:r0_79, r0_81
# 1027| mu0_83(unknown) = ^CallSideEffect : mu0_2
# 1028| v0_84(void) = NoOp :
# 1017| v0_85(void) = ReturnVoid :
# 1017| v0_86(void) = UnmodeledUse : mu*
# 1017| v0_87(void) = ExitFunction :
# 1018| void (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)&&)
# 1018| Block 0
# 1018| v0_0(void) = EnterFunction :
# 1018| mu0_1(unknown) = AliasedDefinition :
# 1018| mu0_2(unknown) = UnmodeledDefinition :
# 1018| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
#-----| r0_4(glval<lambda [] type at line 1018, col. 23 &&>) = VariableAddress[p#0] :
#-----| mu0_5(lambda [] type at line 1018, col. 23 &&) = InitializeParameter[p#0] : r0_4
# 1018| v0_6(void) = NoOp :
# 1018| v0_7(void) = ReturnVoid :
# 1018| v0_8(void) = UnmodeledUse : mu*
# 1018| v0_9(void) = ExitFunction :
# 1018| char (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator()(float) const
# 1018| Block 0
# 1018| v0_0(void) = EnterFunction :
# 1018| mu0_1(unknown) = AliasedDefinition :
# 1018| mu0_2(unknown) = UnmodeledDefinition :
# 1018| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
# 1018| r0_4(glval<float>) = VariableAddress[f] :
# 1018| mu0_5(float) = InitializeParameter[f] : r0_4
# 1018| r0_6(glval<char>) = VariableAddress[#return] :
# 1018| r0_7(char) = Constant[65] :
# 1018| mu0_8(char) = Store : r0_6, r0_7
# 1018| r0_9(glval<char>) = VariableAddress[#return] :
# 1018| v0_10(void) = ReturnValue : r0_9, mu0_2
# 1018| v0_11(void) = UnmodeledUse : mu*
# 1018| v0_12(void) = ExitFunction :
# 1018| char(* (void Lambda(int, String const&))::(lambda [] type at line 1018, col. 23)::operator char (*)(float)() const)(float)
# 1018| Block 0
# 1018| v0_0(void) = EnterFunction :
# 1018| mu0_1(unknown) = AliasedDefinition :
# 1018| mu0_2(unknown) = UnmodeledDefinition :
# 1018| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
# 1018| r0_4(glval<..(*)(..)>) = VariableAddress[#return] :
# 1018| r0_5(glval<..(*)(..)>) = FunctionAddress[_FUN] :
# 1018| mu0_6(..(*)(..)) = Store : r0_4, r0_5
# 1018| r0_7(glval<..(*)(..)>) = VariableAddress[#return] :
# 1018| v0_8(void) = ReturnValue : r0_7, mu0_2
# 1018| v0_9(void) = UnmodeledUse : mu*
# 1018| v0_10(void) = ExitFunction :
# 1020| char (void Lambda(int, String const&))::(lambda [] type at line 1020, col. 21)::operator()(float) const
# 1020| Block 0
# 1020| v0_0(void) = EnterFunction :
# 1020| mu0_1(unknown) = AliasedDefinition :
# 1020| mu0_2(unknown) = UnmodeledDefinition :
# 1020| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
# 1020| r0_4(glval<float>) = VariableAddress[f] :
# 1020| mu0_5(float) = InitializeParameter[f] : r0_4
# 1020| r0_6(glval<char>) = VariableAddress[#return] :
#-----| r0_7(lambda [] type at line 1020, col. 21 *) = CopyValue : r0_3
#-----| r0_8(glval<String &>) = FieldAddress[s] : r0_7
#-----| r0_9(String &) = Load : r0_8, mu0_2
# 1020| r0_10(glval<unknown>) = FunctionAddress[c_str] :
# 1020| r0_11(char *) = Call : r0_10, this:r0_9
# 1020| mu0_12(unknown) = ^CallSideEffect : mu0_2
#-----| r0_13(lambda [] type at line 1020, col. 21 *) = CopyValue : r0_3
#-----| r0_14(glval<int &>) = FieldAddress[x] : r0_13
#-----| r0_15(int &) = Load : r0_14, mu0_2
# 1020| r0_16(int) = Load : r0_15, mu0_2
# 1020| r0_17(char *) = PointerAdd[1] : r0_11, r0_16
# 1020| r0_18(char) = Load : r0_17, mu0_2
# 1020| mu0_19(char) = Store : r0_6, r0_18
# 1020| r0_20(glval<char>) = VariableAddress[#return] :
# 1020| v0_21(void) = ReturnValue : r0_20, mu0_2
# 1020| v0_22(void) = UnmodeledUse : mu*
# 1020| v0_23(void) = ExitFunction :
# 1022| void (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::~<unnamed>()
# 1022| Block 0
# 1022| v0_0(void) = EnterFunction :
# 1022| mu0_1(unknown) = AliasedDefinition :
# 1022| mu0_2(unknown) = UnmodeledDefinition :
# 1022| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
#-----| v0_4(void) = NoOp :
# 1022| r0_5(glval<String>) = FieldAddress[s] : r0_3
# 1022| r0_6(glval<unknown>) = FunctionAddress[~String] :
# 1022| v0_7(void) = Call : r0_6, this:r0_5
# 1022| mu0_8(unknown) = ^CallSideEffect : mu0_2
# 1022| v0_9(void) = ReturnVoid :
# 1022| v0_10(void) = UnmodeledUse : mu*
# 1022| v0_11(void) = ExitFunction :
# 1022| char (void Lambda(int, String const&))::(lambda [] type at line 1022, col. 21)::operator()(float) const
# 1022| Block 0
# 1022| v0_0(void) = EnterFunction :
# 1022| mu0_1(unknown) = AliasedDefinition :
# 1022| mu0_2(unknown) = UnmodeledDefinition :
# 1022| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
# 1022| r0_4(glval<float>) = VariableAddress[f] :
# 1022| mu0_5(float) = InitializeParameter[f] : r0_4
# 1022| r0_6(glval<char>) = VariableAddress[#return] :
#-----| r0_7(lambda [] type at line 1022, col. 21 *) = CopyValue : r0_3
#-----| r0_8(glval<String>) = FieldAddress[s] : r0_7
# 1022| r0_9(glval<unknown>) = FunctionAddress[c_str] :
# 1022| r0_10(char *) = Call : r0_9, this:r0_8
# 1022| mu0_11(unknown) = ^CallSideEffect : mu0_2
#-----| r0_12(lambda [] type at line 1022, col. 21 *) = CopyValue : r0_3
#-----| r0_13(glval<int>) = FieldAddress[x] : r0_12
#-----| r0_14(int) = Load : r0_13, mu0_2
# 1022| r0_15(char *) = PointerAdd[1] : r0_10, r0_14
# 1022| r0_16(char) = Load : r0_15, mu0_2
# 1022| mu0_17(char) = Store : r0_6, r0_16
# 1022| r0_18(glval<char>) = VariableAddress[#return] :
# 1022| v0_19(void) = ReturnValue : r0_18, mu0_2
# 1022| v0_20(void) = UnmodeledUse : mu*
# 1022| v0_21(void) = ExitFunction :
# 1024| char (void Lambda(int, String const&))::(lambda [] type at line 1024, col. 30)::operator()(float) const
# 1024| Block 0
# 1024| v0_0(void) = EnterFunction :
# 1024| mu0_1(unknown) = AliasedDefinition :
# 1024| mu0_2(unknown) = UnmodeledDefinition :
# 1024| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
# 1024| r0_4(glval<float>) = VariableAddress[f] :
# 1024| mu0_5(float) = InitializeParameter[f] : r0_4
# 1024| r0_6(glval<char>) = VariableAddress[#return] :
#-----| r0_7(lambda [] type at line 1024, col. 30 *) = CopyValue : r0_3
#-----| r0_8(glval<String &>) = FieldAddress[s] : r0_7
#-----| r0_9(String &) = Load : r0_8, mu0_2
# 1024| r0_10(glval<unknown>) = FunctionAddress[c_str] :
# 1024| r0_11(char *) = Call : r0_10, this:r0_9
# 1024| mu0_12(unknown) = ^CallSideEffect : mu0_2
# 1024| r0_13(int) = Constant[0] :
# 1024| r0_14(char *) = PointerAdd[1] : r0_11, r0_13
# 1024| r0_15(char) = Load : r0_14, mu0_2
# 1024| mu0_16(char) = Store : r0_6, r0_15
# 1024| r0_17(glval<char>) = VariableAddress[#return] :
# 1024| v0_18(void) = ReturnValue : r0_17, mu0_2
# 1024| v0_19(void) = UnmodeledUse : mu*
# 1024| v0_20(void) = ExitFunction :
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::(constructor)((void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)&&)
# 1026| Block 0
# 1026| v0_0(void) = EnterFunction :
# 1026| mu0_1(unknown) = AliasedDefinition :
# 1026| mu0_2(unknown) = UnmodeledDefinition :
# 1026| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
#-----| r0_4(glval<lambda [] type at line 1026, col. 30 &&>) = VariableAddress[p#0] :
#-----| mu0_5(lambda [] type at line 1026, col. 30 &&) = InitializeParameter[p#0] : r0_4
# 1026| r0_6(glval<String>) = FieldAddress[s] : r0_3
# 1026| r0_7(glval<unknown>) = FunctionAddress[String] :
# 1026| v0_8(void) = Call : r0_7, this:r0_6
# 1026| mu0_9(unknown) = ^CallSideEffect : mu0_2
# 1026| v0_10(void) = NoOp :
# 1026| v0_11(void) = ReturnVoid :
# 1026| v0_12(void) = UnmodeledUse : mu*
# 1026| v0_13(void) = ExitFunction :
# 1026| void (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::~<unnamed>()
# 1026| Block 0
# 1026| v0_0(void) = EnterFunction :
# 1026| mu0_1(unknown) = AliasedDefinition :
# 1026| mu0_2(unknown) = UnmodeledDefinition :
# 1026| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
#-----| v0_4(void) = NoOp :
# 1026| r0_5(glval<String>) = FieldAddress[s] : r0_3
# 1026| r0_6(glval<unknown>) = FunctionAddress[~String] :
# 1026| v0_7(void) = Call : r0_6, this:r0_5
# 1026| mu0_8(unknown) = ^CallSideEffect : mu0_2
# 1026| v0_9(void) = ReturnVoid :
# 1026| v0_10(void) = UnmodeledUse : mu*
# 1026| v0_11(void) = ExitFunction :
# 1026| char (void Lambda(int, String const&))::(lambda [] type at line 1026, col. 30)::operator()(float) const
# 1026| Block 0
# 1026| v0_0(void) = EnterFunction :
# 1026| mu0_1(unknown) = AliasedDefinition :
# 1026| mu0_2(unknown) = UnmodeledDefinition :
# 1026| r0_3(glval<decltype([...](...){...})>) = InitializeThis :
# 1026| r0_4(glval<float>) = VariableAddress[f] :
# 1026| mu0_5(float) = InitializeParameter[f] : r0_4
# 1026| r0_6(glval<char>) = VariableAddress[#return] :
#-----| r0_7(lambda [] type at line 1026, col. 30 *) = CopyValue : r0_3
#-----| r0_8(glval<String>) = FieldAddress[s] : r0_7
# 1026| r0_9(glval<unknown>) = FunctionAddress[c_str] :
# 1026| r0_10(char *) = Call : r0_9, this:r0_8
# 1026| mu0_11(unknown) = ^CallSideEffect : mu0_2
# 1026| r0_12(int) = Constant[0] :
# 1026| r0_13(char *) = PointerAdd[1] : r0_10, r0_12
# 1026| r0_14(char) = Load : r0_13, mu0_2
# 1026| mu0_15(char) = Store : r0_6, r0_14
# 1026| r0_16(glval<char>) = VariableAddress[#return] :
# 1026| v0_17(void) = ReturnValue : r0_16, mu0_2
# 1026| v0_18(void) = UnmodeledUse : mu*
# 1026| v0_19(void) = ExitFunction :