C++: Add block assignment expression to the database schema

These can under some circumstances be generated by the frontend as part
of compiler generated copy constructors and assignment operators.
This commit is contained in:
Jeroen Ketema
2022-08-11 16:39:50 +02:00
parent e1b1657cdd
commit ebf8161f1b
4 changed files with 45 additions and 13 deletions

View File

@@ -1302,7 +1302,7 @@ funbind(
@assign_op_expr = @assign_arith_expr | @assign_bitwise_expr
@assign_expr = @assignexpr | @assign_op_expr
@assign_expr = @assignexpr | @assign_op_expr | @blockassignexpr
/*
case @allocator.form of
@@ -1660,6 +1660,7 @@ case @expr.kind of
| 332 = @hasuniqueobjectrepresentations
| 333 = @builtinbitcast
| 334 = @builtinshuffle
| 335 = @blockassignexpr
;
@var_args_expr = @vastartexpr

View File

@@ -13985,6 +13985,24 @@ ir.cpp:
#-----| Type = [RValueReferenceType] A &&
#-----| getEntryPoint(): [BlockStmt] { ... }
#-----| getStmt(0): [ExprStmt] ExprStmt
#-----| getExpr(): (no string representation)
#-----| Type = [VoidType] void
#-----| ValueCategory = prvalue
#-----| getLValue(): [PointerFieldAccess] e
#-----| Type = [ArrayType] enum <unnamed>[1]
#-----| ValueCategory = lvalue
#-----| getQualifier(): [ThisExpr] this
#-----| Type = [PointerType] A *
#-----| ValueCategory = prvalue(load)
#-----| getRValue(): [ReferenceFieldAccess] e
#-----| Type = [ArrayType] enum <unnamed>[1]
#-----| ValueCategory = lvalue
#-----| getQualifier(): [VariableAccess] (unnamed parameter 0)
#-----| Type = [RValueReferenceType] A &&
#-----| ValueCategory = prvalue(load)
#-----| getQualifier().getFullyConverted(): [ReferenceDereferenceExpr] (reference dereference)
#-----| Type = [Class] A
#-----| ValueCategory = lvalue
#-----| getStmt(1): [ReturnStmt] return ...
#-----| getExpr(): [PointerDereferenceExpr] * ...
#-----| Type = [Class] A

View File

@@ -7,6 +7,8 @@ duplicateChiOperand
sideEffectWithoutPrimary
instructionWithoutSuccessor
| ../../../include/memory.h:68:25:68:33 | CopyValue: (reference to) | Instruction 'CopyValue: (reference to)' has no successors in function '$@'. | ../../../include/memory.h:67:5:67:5 | void std::unique_ptr<int, std::default_delete<int>>::~unique_ptr() | void std::unique_ptr<int, std::default_delete<int>>::~unique_ptr() |
| file://:0:0:0:0 | FieldAddress: e | Instruction 'FieldAddress: e' has no successors in function '$@'. | ir.cpp:1834:11:1834:11 | block_assignment::A& block_assignment::A::operator=(block_assignment::A&&) | block_assignment::A& block_assignment::A::operator=(block_assignment::A&&) |
| file://:0:0:0:0 | FieldAddress: e | Instruction 'FieldAddress: e' has no successors in function '$@'. | ir.cpp:1834:11:1834:11 | block_assignment::A& block_assignment::A::operator=(block_assignment::A&&) | block_assignment::A& block_assignment::A::operator=(block_assignment::A&&) |
| file://:0:0:0:0 | InitializeIndirection: (unnamed parameter 0) | Instruction 'InitializeIndirection: (unnamed parameter 0)' has no successors in function '$@'. | ir.cpp:1834:11:1834:11 | block_assignment::A& block_assignment::A::operator=(block_assignment::A&&) | block_assignment::A& block_assignment::A::operator=(block_assignment::A&&) |
ambiguousSuccessors
unexplainedLoop

View File

@@ -9812,18 +9812,29 @@ ir.cpp:
#-----| mu0_4(unknown) = InitializeIndirection[(unnamed parameter 0)] : &:r0_3
#-----| Block 1
#-----| r0_5(glval<A &>) = VariableAddress[#return] :
#-----| r0_6(glval<unknown>) = VariableAddress[#this] :
#-----| r0_7(A *) = Load[#this] : &:r0_6, ~m?
#-----| r0_8(glval<A>) = CopyValue : r0_7
#-----| r0_9(A &) = CopyValue : r0_8
#-----| mu0_10(A &) = Store[#return] : &:r0_5, r0_9
# 1834| v1834_8(void) = ReturnIndirection[#this] : &:r1834_6, ~m?
#-----| v0_11(void) = ReturnIndirection[(unnamed parameter 0)] : &:r0_3, ~m?
# 1834| r1834_9(glval<A &>) = VariableAddress[#return] :
# 1834| v1834_10(void) = ReturnValue : &:r1834_9, ~m?
# 1834| v1834_11(void) = AliasedUse : ~m?
# 1834| v1834_12(void) = ExitFunction :
#-----| r0_5(glval<unknown>) = VariableAddress[#this] :
#-----| r0_6(A *) = Load[#this] : &:r0_5, ~m?
#-----| r0_7(glval<enum <unnamed>[1]>) = FieldAddress[e] : r0_6
#-----| Block 2
#-----| r0_8(glval<A &&>) = VariableAddress[(unnamed parameter 0)] :
#-----| r0_9(A &&) = Load[(unnamed parameter 0)] : &:r0_8, ~m?
#-----| r0_10(glval<A>) = CopyValue : r0_9
#-----| r0_11(glval<enum <unnamed>[1]>) = FieldAddress[e] : r0_10
#-----| Block 3
#-----| r0_12(glval<A &>) = VariableAddress[#return] :
#-----| r0_13(glval<unknown>) = VariableAddress[#this] :
#-----| r0_14(A *) = Load[#this] : &:r0_13, ~m?
#-----| r0_15(glval<A>) = CopyValue : r0_14
#-----| r0_16(A &) = CopyValue : r0_15
#-----| mu0_17(A &) = Store[#return] : &:r0_12, r0_16
# 1834| v1834_8(void) = ReturnIndirection[#this] : &:r1834_6, ~m?
#-----| v0_18(void) = ReturnIndirection[(unnamed parameter 0)] : &:r0_3, ~m?
# 1834| r1834_9(glval<A &>) = VariableAddress[#return] :
# 1834| v1834_10(void) = ReturnValue : &:r1834_9, ~m?
# 1834| v1834_11(void) = AliasedUse : ~m?
# 1834| v1834_12(void) = ExitFunction :
# 1839| block_assignment::B& block_assignment::B::operator=(block_assignment::B&&)
# 1839| Block 0