@@ -1893,104 +1893,6 @@ class TranslatedIsExpr extends TranslatedNonConstantExpr {
18931893 }
18941894}
18951895
1896- /**
1897- * The IR translation of a lambda expression. This initializes a temporary variable whose type is that of the lambda,
1898- * using the initializer list that represents the captures of the lambda.
1899- */
1900- class TranslatedLambdaExpr extends TranslatedNonConstantExpr , InitializationContext {
1901- override LambdaExpr expr ;
1902-
1903- final override Instruction getFirstInstruction ( ) {
1904- result = this .getInstruction ( InitializerVariableAddressTag ( ) )
1905- }
1906-
1907- final override TranslatedElement getChild ( int id ) { id = 0 and result = this .getInitialization ( ) }
1908-
1909- override Instruction getResult ( ) { result = this .getInstruction ( LoadTag ( ) ) }
1910-
1911- override Instruction getInstructionSuccessor ( InstructionTag tag , EdgeKind kind ) {
1912- tag = InitializerVariableAddressTag ( ) and
1913- kind instanceof GotoEdge and
1914- result = this .getInstruction ( InitializerStoreTag ( ) )
1915- or
1916- tag = InitializerStoreTag ( ) and
1917- kind instanceof GotoEdge and
1918- (
1919- result = this .getInitialization ( ) .getFirstInstruction ( )
1920- or
1921- not this .hasInitializer ( ) and result = this .getInstruction ( LoadTag ( ) )
1922- )
1923- or
1924- tag = LoadTag ( ) and
1925- kind instanceof GotoEdge and
1926- result = this .getParent ( ) .getChildSuccessor ( this )
1927- }
1928-
1929- override Instruction getChildSuccessor ( TranslatedElement child ) {
1930- child = getInitialization ( ) and
1931- result = this .getInstruction ( LoadTag ( ) )
1932- }
1933-
1934- override predicate hasInstruction (
1935- Opcode opcode , InstructionTag tag , Type resultType , boolean isLValue
1936- ) {
1937- tag = InitializerVariableAddressTag ( ) and
1938- opcode instanceof Opcode:: VariableAddress and
1939- resultType = this .getResultType ( ) and
1940- isLValue = true
1941- or
1942- tag = InitializerStoreTag ( ) and
1943- opcode instanceof Opcode:: Uninitialized and
1944- resultType = this .getResultType ( ) and
1945- isLValue = false
1946- or
1947- tag = LoadTag ( ) and
1948- opcode instanceof Opcode:: Load and
1949- resultType = this .getResultType ( ) and
1950- isLValue = false
1951- }
1952-
1953- override Instruction getInstructionOperand ( InstructionTag tag , OperandTag operandTag ) {
1954- tag = InitializerStoreTag ( ) and
1955- operandTag instanceof AddressOperandTag and
1956- result = this .getInstruction ( InitializerVariableAddressTag ( ) )
1957- or
1958- tag = LoadTag ( ) and
1959- (
1960- operandTag instanceof AddressOperandTag and
1961- result = this .getInstruction ( InitializerVariableAddressTag ( ) )
1962- or
1963- operandTag instanceof LoadOperandTag and
1964- result = this .getEnclosingFunction ( ) .getUnmodeledDefinitionInstruction ( )
1965- )
1966- }
1967-
1968- override IRVariable getInstructionVariable ( InstructionTag tag ) {
1969- (
1970- tag = InitializerVariableAddressTag ( ) or
1971- tag = InitializerStoreTag ( )
1972- ) and
1973- result = this .getTempVariable ( LambdaTempVar ( ) )
1974- }
1975-
1976- override predicate hasTempVariable ( TempVariableTag tag , Type type ) {
1977- tag = LambdaTempVar ( ) and
1978- type = this .getResultType ( )
1979- }
1980-
1981- final override Instruction getTargetAddress ( ) {
1982- result = this .getInstruction ( InitializerVariableAddressTag ( ) )
1983- }
1984-
1985- final override Type getTargetType ( ) { result = this .getResultType ( ) }
1986-
1987- private predicate hasInitializer ( ) { exists ( this .getInitialization ( ) ) }
1988-
1989- private TranslatedInitialization getInitialization ( ) {
1990- result = getTranslatedInitialization ( expr .getChild ( 0 ) )
1991- }
1992- }
1993-
19941896/**
19951897 * The translation of a `DelegateCall`. Since this type of call needs
19961898 * desugaring, we treat it as a special case. The AST node of the
0 commit comments