Lines Matching refs:unique_ptr
154 std::unique_ptr<Extension> IRGenerator::convertExtension(const ASTExtension& extension) { in convertExtension()
155 return std::unique_ptr<Extension>(new Extension(extension.fPosition, extension.fName)); in convertExtension()
158 std::unique_ptr<Statement> IRGenerator::convertStatement(const ASTStatement& statement) { in convertStatement()
189 std::unique_ptr<Block> IRGenerator::convertBlock(const ASTBlock& block) { in convertBlock()
191 std::vector<std::unique_ptr<Statement>> statements; in convertBlock()
193 std::unique_ptr<Statement> statement = this->convertStatement(*block.fStatements[i]); in convertBlock()
199 return std::unique_ptr<Block>(new Block(block.fPosition, std::move(statements), fSymbolTable)); in convertBlock()
202 std::unique_ptr<Statement> IRGenerator::convertVarDeclarationStatement( in convertVarDeclarationStatement()
208 return std::unique_ptr<Statement>(new VarDeclarationsStatement(std::move(decl))); in convertVarDeclarationStatement()
211 std::unique_ptr<VarDeclarations> IRGenerator::convertVarDeclarations(const ASTVarDeclarations& decl, in convertVarDeclarations()
220 std::vector<std::unique_ptr<Expression>> sizes; in convertVarDeclarations()
248 auto var = std::unique_ptr<Variable>(new Variable(decl.fPosition, decl.fModifiers, in convertVarDeclarations()
250 std::unique_ptr<Expression> value; in convertVarDeclarations()
272 return std::unique_ptr<VarDeclarations>(new VarDeclarations(decl.fPosition, in convertVarDeclarations()
277 std::unique_ptr<ModifiersDeclaration> IRGenerator::convertModifiersDeclaration( in convertModifiersDeclaration()
279 return std::unique_ptr<ModifiersDeclaration>(new ModifiersDeclaration(m.fModifiers)); in convertModifiersDeclaration()
282 std::unique_ptr<Statement> IRGenerator::convertIf(const ASTIfStatement& s) { in convertIf()
283 std::unique_ptr<Expression> test = this->coerce(this->convertExpression(*s.fTest), in convertIf()
288 std::unique_ptr<Statement> ifTrue = this->convertStatement(*s.fIfTrue); in convertIf()
292 std::unique_ptr<Statement> ifFalse; in convertIf()
307 std::vector<std::unique_ptr<Statement>> empty; in convertIf()
308 return std::unique_ptr<Statement>(new Block(s.fPosition, std::move(empty), in convertIf()
312 return std::unique_ptr<Statement>(new IfStatement(s.fPosition, std::move(test), in convertIf()
316 std::unique_ptr<Statement> IRGenerator::convertFor(const ASTForStatement& f) { in convertFor()
319 std::unique_ptr<Statement> initializer; in convertFor()
326 std::unique_ptr<Expression> test; in convertFor()
333 std::unique_ptr<Expression> next; in convertFor()
341 std::unique_ptr<Statement> statement = this->convertStatement(*f.fStatement); in convertFor()
345 return std::unique_ptr<Statement>(new ForStatement(f.fPosition, std::move(initializer), in convertFor()
350 std::unique_ptr<Statement> IRGenerator::convertWhile(const ASTWhileStatement& w) { in convertWhile()
352 std::unique_ptr<Expression> test = this->coerce(this->convertExpression(*w.fTest), in convertWhile()
357 std::unique_ptr<Statement> statement = this->convertStatement(*w.fStatement); in convertWhile()
361 return std::unique_ptr<Statement>(new WhileStatement(w.fPosition, std::move(test), in convertWhile()
365 std::unique_ptr<Statement> IRGenerator::convertDo(const ASTDoStatement& d) { in convertDo()
367 std::unique_ptr<Expression> test = this->coerce(this->convertExpression(*d.fTest), in convertDo()
372 std::unique_ptr<Statement> statement = this->convertStatement(*d.fStatement); in convertDo()
376 return std::unique_ptr<Statement>(new DoStatement(d.fPosition, std::move(statement), in convertDo()
380 std::unique_ptr<Statement> IRGenerator::convertSwitch(const ASTSwitchStatement& s) { in convertSwitch()
382 std::unique_ptr<Expression> value = this->convertExpression(*s.fValue); in convertSwitch()
394 std::vector<std::unique_ptr<SwitchCase>> cases; in convertSwitch()
396 std::unique_ptr<Expression> caseValue; in convertSwitch()
419 std::vector<std::unique_ptr<Statement>> statements; in convertSwitch()
421 std::unique_ptr<Statement> converted = this->convertStatement(*s); in convertSwitch()
430 return std::unique_ptr<Statement>(new SwitchStatement(s.fPosition, std::move(value), in convertSwitch()
434 std::unique_ptr<Statement> IRGenerator::convertExpressionStatement( in convertExpressionStatement()
436 std::unique_ptr<Expression> e = this->convertExpression(*s.fExpression); in convertExpressionStatement()
441 return std::unique_ptr<Statement>(new ExpressionStatement(std::move(e))); in convertExpressionStatement()
444 std::unique_ptr<Statement> IRGenerator::convertReturn(const ASTReturnStatement& r) { in convertReturn()
447 std::unique_ptr<Expression> result = this->convertExpression(*r.fExpression); in convertReturn()
459 return std::unique_ptr<Statement>(new ReturnStatement(std::move(result))); in convertReturn()
465 return std::unique_ptr<Statement>(new ReturnStatement(r.fPosition)); in convertReturn()
469 std::unique_ptr<Statement> IRGenerator::convertBreak(const ASTBreakStatement& b) { in convertBreak()
471 return std::unique_ptr<Statement>(new BreakStatement(b.fPosition)); in convertBreak()
478 std::unique_ptr<Statement> IRGenerator::convertContinue(const ASTContinueStatement& c) { in convertContinue()
480 return std::unique_ptr<Statement>(new ContinueStatement(c.fPosition)); in convertContinue()
487 std::unique_ptr<Statement> IRGenerator::convertDiscard(const ASTDiscardStatement& d) { in convertDiscard()
488 return std::unique_ptr<Statement>(new DiscardStatement(d.fPosition)); in convertDiscard()
491 std::unique_ptr<FunctionDefinition> IRGenerator::convertFunction(const ASTFunction& f) { in convertFunction()
572 auto newDecl = std::unique_ptr<FunctionDeclaration>(new FunctionDeclaration(f.fPosition, in convertFunction()
588 std::unique_ptr<Block> body = this->convertBlock(*f.fBody); in convertFunction()
593 return std::unique_ptr<FunctionDefinition>(new FunctionDefinition(f.fPosition, *decl, in convertFunction()
599 std::unique_ptr<InterfaceBlock> IRGenerator::convertInterfaceBlock(const ASTInterfaceBlock& intf) { in convertInterfaceBlock()
604 std::unique_ptr<VarDeclarations> decl = this->convertVarDeclarations( in convertInterfaceBlock()
628 std::vector<std::unique_ptr<Expression>> sizes; in convertInterfaceBlock()
631 std::unique_ptr<Expression> converted = this->convertExpression(*size); in convertInterfaceBlock()
664 old->add(fields[i].fName, std::unique_ptr<Field>(new Field(intf.fPosition, *var, in convertInterfaceBlock()
668 return std::unique_ptr<InterfaceBlock>(new InterfaceBlock(intf.fPosition, *var, in convertInterfaceBlock()
693 std::unique_ptr<Expression> IRGenerator::convertExpression(const ASTExpression& expr) { in convertExpression()
698 return std::unique_ptr<Expression>(new BoolLiteral(fContext, expr.fPosition, in convertExpression()
701 return std::unique_ptr<Expression>(new IntLiteral(fContext, expr.fPosition, in convertExpression()
704 return std::unique_ptr<Expression>(new FloatLiteral(fContext, expr.fPosition, in convertExpression()
719 std::unique_ptr<Expression> IRGenerator::convertIdentifier(const ASTIdentifier& identifier) { in convertIdentifier()
730 return std::unique_ptr<FunctionReference>(new FunctionReference(fContext, in convertIdentifier()
736 return std::unique_ptr<FunctionReference>(new FunctionReference(fContext, in convertIdentifier()
751 return std::unique_ptr<VariableReference>(new VariableReference( in convertIdentifier()
760 return std::unique_ptr<Expression>(new FieldAccess( in convertIdentifier()
761 std::unique_ptr<Expression>(base), in convertIdentifier()
767 return std::unique_ptr<TypeReference>(new TypeReference(fContext, identifier.fPosition, in convertIdentifier()
776 std::unique_ptr<Expression> IRGenerator::coerce(std::unique_ptr<Expression> expr, in coerce()
794 std::vector<std::unique_ptr<Expression>> args; in coerce()
797 std::unique_ptr<Expression> ctor = this->convertIdentifier(id); in coerce()
801 std::vector<std::unique_ptr<Expression>> args; in coerce()
803 return std::unique_ptr<Expression>(new Constructor(Position(), type, std::move(args))); in coerce()
943 std::unique_ptr<Expression> IRGenerator::constantFold(const Expression& left, in constantFold()
961 return std::unique_ptr<Expression>(new BoolLiteral(fContext, left.fPosition, result)); in constantFold()
963 #define RESULT(t, op) std::unique_ptr<Expression>(new t ## Literal(fContext, left.fPosition, \ in constantFold()
1025 std::unique_ptr<Expression> IRGenerator::convertBinaryExpression( in convertBinaryExpression()
1027 std::unique_ptr<Expression> left = this->convertExpression(*expression.fLeft); in convertBinaryExpression()
1031 std::unique_ptr<Expression> right = this->convertExpression(*expression.fRight); in convertBinaryExpression()
1055 std::unique_ptr<Expression> result = this->constantFold(*left.get(), expression.fOperator, in convertBinaryExpression()
1058 result = std::unique_ptr<Expression>(new BinaryExpression(expression.fPosition, in convertBinaryExpression()
1067 std::unique_ptr<Expression> IRGenerator::convertTernaryExpression( in convertTernaryExpression()
1069 std::unique_ptr<Expression> test = this->coerce(this->convertExpression(*expression.fTest), in convertTernaryExpression()
1074 std::unique_ptr<Expression> ifTrue = this->convertExpression(*expression.fIfTrue); in convertTernaryExpression()
1078 std::unique_ptr<Expression> ifFalse = this->convertExpression(*expression.fIfFalse); in convertTernaryExpression()
1108 return std::unique_ptr<Expression>(new TernaryExpression(expression.fPosition, in convertTernaryExpression()
1114 std::unique_ptr<Expression> IRGenerator::call(Position position, in call()
1116 std::vector<std::unique_ptr<Expression>> arguments) { in call()
1151 return std::unique_ptr<FunctionCall>(new FunctionCall(position, *returnType, function, in call()
1161 const std::vector<std::unique_ptr<Expression>>& arguments, in determineCallCost()
1184 std::unique_ptr<Expression> IRGenerator::call(Position position, in call()
1185 std::unique_ptr<Expression> functionValue, in call()
1186 std::vector<std::unique_ptr<Expression>> arguments) { in call()
1224 std::unique_ptr<Expression> IRGenerator::convertNumberConstructor( in convertNumberConstructor()
1227 std::vector<std::unique_ptr<Expression>> args) { in convertNumberConstructor()
1238 return std::unique_ptr<Expression>(new FloatLiteral(fContext, position, (double) value)); in convertNumberConstructor()
1242 return std::unique_ptr<Expression>(new IntLiteral(fContext, in convertNumberConstructor()
1248 std::unique_ptr<IntLiteral> zero(new IntLiteral(fContext, position, 0)); in convertNumberConstructor()
1249 std::unique_ptr<IntLiteral> one(new IntLiteral(fContext, position, 1)); in convertNumberConstructor()
1250 return std::unique_ptr<Expression>( in convertNumberConstructor()
1262 return std::unique_ptr<Expression>(new Constructor(position, std::move(type), std::move(args))); in convertNumberConstructor()
1276 std::unique_ptr<Expression> IRGenerator::convertCompoundConstructor( in convertCompoundConstructor()
1279 std::vector<std::unique_ptr<Expression>> args) { in convertCompoundConstructor()
1284 return std::unique_ptr<Expression>(new Constructor(position, std::move(type), in convertCompoundConstructor()
1322 return std::unique_ptr<Expression>(new Constructor(position, std::move(type), std::move(args))); in convertCompoundConstructor()
1325 std::unique_ptr<Expression> IRGenerator::convertConstructor( in convertConstructor()
1328 std::vector<std::unique_ptr<Expression>> args) { in convertConstructor()
1345 return std::unique_ptr<Expression>(new Constructor(position, std::move(type), in convertConstructor()
1355 std::unique_ptr<Expression> IRGenerator::convertPrefixExpression( in convertPrefixExpression()
1357 std::unique_ptr<Expression> base = this->convertExpression(*expression.fOperand); in convertPrefixExpression()
1376 return std::unique_ptr<Expression>(new IntLiteral(fContext, base->fPosition, in convertPrefixExpression()
1381 return std::unique_ptr<Expression>(new FloatLiteral(fContext, base->fPosition, in convertPrefixExpression()
1384 return std::unique_ptr<Expression>(new PrefixExpression(Token::MINUS, std::move(base))); in convertPrefixExpression()
1411 return std::unique_ptr<Expression>(new BoolLiteral(fContext, base->fPosition, in convertPrefixExpression()
1426 return std::unique_ptr<Expression>(new PrefixExpression(expression.fOperator, in convertPrefixExpression()
1430 std::unique_ptr<Expression> IRGenerator::convertIndex(std::unique_ptr<Expression> base, in convertIndex()
1439 return std::unique_ptr<Expression>(new TypeReference(fContext, base->fPosition, in convertIndex()
1453 std::unique_ptr<Expression> converted = this->convertExpression(index); in convertIndex()
1463 return std::unique_ptr<Expression>(new IndexExpression(fContext, std::move(base), in convertIndex()
1467 std::unique_ptr<Expression> IRGenerator::convertField(std::unique_ptr<Expression> base, in convertField()
1472 return std::unique_ptr<Expression>(new FieldAccess(std::move(base), (int) i)); in convertField()
1480 std::unique_ptr<Expression> IRGenerator::convertSwizzle(std::unique_ptr<Expression> base, in convertSwizzle()
1529 return std::unique_ptr<Expression>(new Swizzle(fContext, std::move(base), swizzleComponents)); in convertSwizzle()
1532 std::unique_ptr<Expression> IRGenerator::getCap(Position position, SkString name) { in getCap()
1540 return std::unique_ptr<Expression>(new BoolLiteral(fContext, position, in getCap()
1543 return std::unique_ptr<Expression>(new IntLiteral(fContext, position, in getCap()
1550 std::unique_ptr<Expression> IRGenerator::convertSuffixExpression( in convertSuffixExpression()
1552 std::unique_ptr<Expression> base = this->convertExpression(*expression.fBase); in convertSuffixExpression()
1566 return std::unique_ptr<Expression>(new TypeReference(fContext, base->fPosition, in convertSuffixExpression()
1575 std::vector<std::unique_ptr<Expression>> arguments; in convertSuffixExpression()
1577 std::unique_ptr<Expression> converted = in convertSuffixExpression()
1611 return std::unique_ptr<Expression>(new PostfixExpression(std::move(base), in convertSuffixExpression()
1620 return std::unique_ptr<Expression>(new PostfixExpression(std::move(base), in convertSuffixExpression()