Lines Matching refs:make_shared
52 auto v = std::make_shared<Variable>(JavaSignatureOf(type, typenames), in Get()
120 auto ctor = std::make_shared<Method>(); in StubClass()
126 ctor->statements = std::make_shared<StatementBlock>(); in StubClass()
128 auto stability = std::make_shared<LiteralStatement>("this.markVintfStability();\n"); in StubClass()
131 auto attach = std::make_shared<MethodCall>( in StubClass()
134 std::make_shared<LiteralExpression>("DESCRIPTOR")}); in StubClass()
142 auto asBinder = std::make_shared<Method>(); in StubClass()
146 asBinder->statements = std::make_shared<StatementBlock>(); in StubClass()
147 asBinder->statements->Add(std::make_shared<ReturnStatement>(THIS_VALUE)); in StubClass()
152 auto getDefaultTransactionName = std::make_shared<Method>(); in StubClass()
157 auto code = std::make_shared<Variable>("int", "transactionCode"); in StubClass()
159 getDefaultTransactionName->statements = std::make_shared<StatementBlock>(); in StubClass()
160 this->code_to_method_name_switch = std::make_shared<SwitchStatement>(code); in StubClass()
165 auto getTransactionName = std::make_shared<Method>(); in StubClass()
170 auto code2 = std::make_shared<Variable>("int", "transactionCode"); in StubClass()
172 getTransactionName->statements = std::make_shared<StatementBlock>(); in StubClass()
173 getTransactionName->statements->Add(std::make_shared<ReturnStatement>( in StubClass()
174 std::make_shared<MethodCall>(THIS_VALUE, "getDefaultTransactionName", in StubClass()
180 this->transact_code = std::make_shared<Variable>("int", "code"); in StubClass()
181 this->transact_data = std::make_shared<Variable>("android.os.Parcel", "data"); in StubClass()
182 this->transact_reply = std::make_shared<Variable>("android.os.Parcel", "reply"); in StubClass()
183 this->transact_flags = std::make_shared<Variable>("int", "flags"); in StubClass()
184 auto onTransact = std::make_shared<Method>(); in StubClass()
192 onTransact->statements = std::make_shared<StatementBlock>(); in StubClass()
196 this->transact_switch = std::make_shared<SwitchStatement>(this->transact_code); in StubClass()
200 auto default_case = std::make_shared<Case>(); in finish()
202 auto superCall = std::make_shared<MethodCall>( in finish()
206 default_case->statements->Add(std::make_shared<ReturnStatement>(superCall)); in finish()
216 auto code_switch_default_case = std::make_shared<Case>(); in finish()
217 code_switch_default_case->statements->Add(std::make_shared<ReturnStatement>(NULL_VALUE)); in finish()
230 return std::make_shared<LiteralExpression>("DESCRIPTOR"); in get_transact_descriptor()
236 return std::make_shared<LiteralExpression>("DESCRIPTOR"); in get_transact_descriptor()
244 transact_descriptor = std::make_shared<Variable>("java.lang.String", "descriptor"); in get_transact_descriptor()
245 transact_statements->Add(std::make_shared<VariableDeclaration>( in get_transact_descriptor()
246 transact_descriptor, std::make_shared<LiteralExpression>("DESCRIPTOR"))); in get_transact_descriptor()
252 auto obj = std::make_shared<Variable>("android.os.IBinder", "obj"); in make_as_interface()
254 auto m = std::make_shared<Method>(); in make_as_interface()
263 m->statements = std::make_shared<StatementBlock>(); in make_as_interface()
265 auto ifstatement = std::make_shared<IfStatement>(); in make_as_interface()
266 ifstatement->expression = std::make_shared<Comparison>(obj, "==", NULL_VALUE); in make_as_interface()
267 ifstatement->statements = std::make_shared<StatementBlock>(); in make_as_interface()
268 ifstatement->statements->Add(std::make_shared<ReturnStatement>(NULL_VALUE)); in make_as_interface()
272 auto queryLocalInterface = std::make_shared<MethodCall>(obj, "queryLocalInterface"); in make_as_interface()
273 queryLocalInterface->arguments.push_back(std::make_shared<LiteralExpression>("DESCRIPTOR")); in make_as_interface()
274 auto iin = std::make_shared<Variable>("android.os.IInterface", "iin"); in make_as_interface()
275 auto iinVd = std::make_shared<VariableDeclaration>(iin, queryLocalInterface); in make_as_interface()
284 auto iinNotNull = std::make_shared<Comparison>(iin, "!=", NULL_VALUE); in make_as_interface()
285 auto instOfCheck = std::make_shared<Comparison>( in make_as_interface()
286 iin, " instanceof ", std::make_shared<LiteralExpression>(interfaceType->GetCanonicalName())); in make_as_interface()
287 auto instOfStatement = std::make_shared<IfStatement>(); in make_as_interface()
288 instOfStatement->expression = std::make_shared<Comparison>(iinNotNull, "&&", instOfCheck); in make_as_interface()
289 instOfStatement->statements = std::make_shared<StatementBlock>(); in make_as_interface()
290 instOfStatement->statements->Add(std::make_shared<ReturnStatement>( in make_as_interface()
291 std::make_shared<Cast>(interfaceType->GetCanonicalName(), iin))); in make_as_interface()
294 auto ne = std::make_shared<NewExpression>(interfaceType->GetCanonicalName() + ".Stub.Proxy"); in make_as_interface()
296 m->statements->Add(std::make_shared<ReturnStatement>(ne)); in make_as_interface()
317 mRemote = std::make_shared<Variable>("android.os.IBinder", "mRemote"); in ProxyClass()
318 this->elements.push_back(std::make_shared<Field>(PRIVATE, mRemote)); in ProxyClass()
321 auto remote = std::make_shared<Variable>("android.os.IBinder", "remote"); in ProxyClass()
322 auto ctor = std::make_shared<Method>(); in ProxyClass()
324 ctor->statements = std::make_shared<StatementBlock>(); in ProxyClass()
326 ctor->statements->Add(std::make_shared<Assignment>(mRemote, remote)); in ProxyClass()
332 this->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str())); in ProxyClass()
337 this->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str())); in ProxyClass()
341 auto asBinder = std::make_shared<Method>(); in ProxyClass()
345 asBinder->statements = std::make_shared<StatementBlock>(); in ProxyClass()
346 asBinder->statements->Add(std::make_shared<ReturnStatement>(mRemote)); in ProxyClass()
356 auto len = std::make_shared<Variable>("int", v->name + "_length"); in generate_new_array()
358 std::make_shared<VariableDeclaration>(len, std::make_shared<MethodCall>(parcel, "readInt"))); in generate_new_array()
359 auto lencheck = std::make_shared<IfStatement>(); in generate_new_array()
361 std::make_shared<Comparison>(len, "<", std::make_shared<LiteralExpression>("0")); in generate_new_array()
362 lencheck->statements->Add(std::make_shared<Assignment>(v, NULL_VALUE)); in generate_new_array()
363 lencheck->elseif = std::make_shared<IfStatement>(); in generate_new_array()
364 lencheck->elseif->statements->Add(std::make_shared<Assignment>( in generate_new_array()
365 v, std::make_shared<NewArrayExpression>(InstantiableJavaSignatureOf(type, typenames), len))); in generate_new_array()
385 addTo->Add(std::make_shared<LiteralStatement>(code)); in generate_write_to_parcel()
391 interface->elements.push_back(std::make_shared<LiteralClassElement>(code)); in generate_int_constant()
397 interface->elements.push_back(std::make_shared<LiteralClassElement>(code)); in generate_string_constant()
402 auto decl = std::make_shared<Method>(); in generate_interface_method()
410 … auto var = std::make_shared<Variable>(JavaSignatureOf(arg->GetType(), typenames), arg->GetName()); in generate_interface_method()
427 auto tryStatement = std::make_shared<TryStatement>(); in generate_stub_code()
428 auto finallyStatement = std::make_shared<FinallyStatement>(); in generate_stub_code()
435 tryStatement->statements->Add(std::make_shared<MethodCall>( in generate_stub_code()
436 std::make_shared<LiteralExpression>("android.os.Trace"), "traceBegin", in generate_stub_code()
438 std::make_shared<LiteralExpression>("android.os.Trace.TRACE_TAG_AIDL"), in generate_stub_code()
439 std::make_shared<StringLiteralExpression>("AIDL::java::" + iface.GetName() + in generate_stub_code()
441 finallyStatement->statements->Add(std::make_shared<MethodCall>( in generate_stub_code()
442 std::make_shared<LiteralExpression>("android.os.Trace"), "traceEnd", in generate_stub_code()
444 std::make_shared<LiteralExpression>("android.os.Trace.TRACE_TAG_AIDL")})); in generate_stub_code()
447 auto realCall = std::make_shared<MethodCall>(THIS_VALUE, method.GetName()); in generate_stub_code()
450 statements->Add(std::make_shared<MethodCall>( in generate_stub_code()
463 statements->Add(std::make_shared<VariableDeclaration>(v)); in generate_stub_code()
476 statements->Add(std::make_shared<LiteralStatement>(code)); in generate_stub_code()
479 statements->Add(std::make_shared<Assignment>( in generate_stub_code()
480 v, std::make_shared<NewExpression>( in generate_stub_code()
497 auto ex = std::make_shared<MethodCall>(transact_reply, "writeNoException"); in generate_stub_code()
502 std::make_shared<Variable>(JavaSignatureOf(method.GetType(), typenames), "_result"); in generate_stub_code()
503 statements->Add(std::make_shared<VariableDeclaration>(_result, realCall)); in generate_stub_code()
507 auto ex = std::make_shared<MethodCall>(transact_reply, "writeNoException"); in generate_stub_code()
527 statements->Add(std::make_shared<ReturnStatement>(TRUE_VALUE)); in generate_stub_code()
534 auto c = std::make_shared<Case>(transactCodeName); in generate_stub_case()
549 auto transact_data = std::make_shared<Variable>("android.os.Parcel", "data"); in generate_stub_case_outline()
550 auto transact_reply = std::make_shared<Variable>("android.os.Parcel", "reply"); in generate_stub_case_outline()
551 auto onTransact_case = std::make_shared<Method>(); in generate_stub_case_outline()
557 onTransact_case->statements = std::make_shared<StatementBlock>(); in generate_stub_case_outline()
567 auto c = std::make_shared<Case>(transactCodeName); in generate_stub_case_outline()
570 std::make_shared<MethodCall>(THIS_VALUE, outline_name, in generate_stub_case_outline()
573 c->statements->Add(std::make_shared<ReturnStatement>(helper_call)); in generate_stub_case_outline()
583 auto proxy = std::make_shared<Method>(); in generate_proxy_method()
588 proxy->statements = std::make_shared<StatementBlock>(); in generate_proxy_method()
591 std::make_shared<Variable>(JavaSignatureOf(arg->GetType(), typenames), arg->GetName())); in generate_proxy_method()
596 auto _data = std::make_shared<Variable>("android.os.Parcel", "_data"); in generate_proxy_method()
597 proxy->statements->Add(std::make_shared<VariableDeclaration>( in generate_proxy_method()
598 _data, std::make_shared<MethodCall>("android.os.Parcel", "obtain"))); in generate_proxy_method()
601 _reply = std::make_shared<Variable>("android.os.Parcel", "_reply"); in generate_proxy_method()
602 proxy->statements->Add(std::make_shared<VariableDeclaration>( in generate_proxy_method()
603 _reply, std::make_shared<MethodCall>("android.os.Parcel", "obtain"))); in generate_proxy_method()
609 _result = std::make_shared<Variable>(*proxy->returnType, "_result"); in generate_proxy_method()
610 proxy->statements->Add(std::make_shared<VariableDeclaration>(_result)); in generate_proxy_method()
614 auto tryStatement = std::make_shared<TryStatement>(); in generate_proxy_method()
616 auto finallyStatement = std::make_shared<FinallyStatement>(); in generate_proxy_method()
620 tryStatement->statements->Add(std::make_shared<MethodCall>( in generate_proxy_method()
621 std::make_shared<LiteralExpression>("android.os.Trace"), "traceBegin", in generate_proxy_method()
623 std::make_shared<LiteralExpression>("android.os.Trace.TRACE_TAG_AIDL"), in generate_proxy_method()
624 std::make_shared<StringLiteralExpression>("AIDL::java::" + iface.GetName() + in generate_proxy_method()
630 tryStatement->statements->Add(std::make_shared<MethodCall>( in generate_proxy_method()
632 std::vector<std::shared_ptr<Expression>>{std::make_shared<LiteralExpression>("DESCRIPTOR")})); in generate_proxy_method()
636 auto v = std::make_shared<Variable>(JavaSignatureOf(arg->GetType(), typenames), arg->GetName()); in generate_proxy_method()
639 auto checklen = std::make_shared<IfStatement>(); in generate_proxy_method()
640 checklen->expression = std::make_shared<Comparison>(v, "==", NULL_VALUE); in generate_proxy_method()
641 checklen->statements->Add(std::make_shared<MethodCall>( in generate_proxy_method()
643 std::vector<std::shared_ptr<Expression>>{std::make_shared<LiteralExpression>("-1")})); in generate_proxy_method()
644 checklen->elseif = std::make_shared<IfStatement>(); in generate_proxy_method()
645 checklen->elseif->statements->Add(std::make_shared<MethodCall>( in generate_proxy_method()
647 std::vector<std::shared_ptr<Expression>>{std::make_shared<FieldVariable>(v, "length")})); in generate_proxy_method()
656 auto call = std::make_shared<MethodCall>( in generate_proxy_method()
659 std::make_shared<LiteralExpression>("Stub." + transactCodeName), _data, in generate_proxy_method()
661 std::make_shared<LiteralExpression>(oneway ? "android.os.IBinder.FLAG_ONEWAY" : "0")}); in generate_proxy_method()
662 auto _status = std::make_shared<Variable>("boolean", "_status"); in generate_proxy_method()
663 tryStatement->statements->Add(std::make_shared<VariableDeclaration>(_status, call)); in generate_proxy_method()
672 tryStatement->statements->Add(std::make_shared<LiteralStatement>( in generate_proxy_method()
684 auto ex = std::make_shared<MethodCall>(_reply, "readException"); in generate_proxy_method()
704 tryStatement->statements->Add(std::make_shared<LiteralStatement>(code)); in generate_proxy_method()
720 tryStatement->statements->Add(std::make_shared<LiteralStatement>(code)); in generate_proxy_method()
724 finallyStatement->statements->Add(std::make_shared<MethodCall>(_reply, "recycle")); in generate_proxy_method()
726 finallyStatement->statements->Add(std::make_shared<MethodCall>(_data, "recycle")); in generate_proxy_method()
729 finallyStatement->statements->Add(std::make_shared<MethodCall>( in generate_proxy_method()
730 std::make_shared<LiteralExpression>("android.os.Trace"), "traceEnd", in generate_proxy_method()
732 std::make_shared<LiteralExpression>("android.os.Trace.TRACE_TAG_AIDL")})); in generate_proxy_method()
736 proxy->statements->Add(std::make_shared<ReturnStatement>(_result)); in generate_proxy_method()
753 std::make_shared<Field>(STATIC | FINAL, std::make_shared<Variable>("int", transactCodeName)); in generate_methods()
760 auto c = std::make_shared<Case>(transactCodeName); in generate_methods()
761 c->statements->Add(std::make_shared<ReturnStatement>( in generate_methods()
762 std::make_shared<StringLiteralExpression>(method.GetName()))); in generate_methods()
775 decl = std::make_shared<LiteralClassElement>(code.str()); in generate_methods()
781 decl = std::make_shared<LiteralClassElement>(code.str()); in generate_methods()
798 auto c = std::make_shared<Case>(transactCodeName); in generate_methods()
804 c->statements->Add(std::make_shared<LiteralStatement>(code.str())); in generate_methods()
808 auto c = std::make_shared<Case>(transactCodeName); in generate_methods()
814 c->statements->Add(std::make_shared<LiteralStatement>(code.str())); in generate_methods()
853 proxy = std::make_shared<LiteralClassElement>(code.str()); in generate_methods()
882 proxy = std::make_shared<LiteralClassElement>(code.str()); in generate_methods()
894 auto c = std::make_shared<Case>("INTERFACE_TRANSACTION"); in generate_interface_descriptors()
895 c->statements->Add(std::make_shared<MethodCall>( in generate_interface_descriptors()
898 c->statements->Add(std::make_shared<ReturnStatement>(TRUE_VALUE)); in generate_interface_descriptors()
902 auto getDesc = std::make_shared<Method>(); in generate_interface_descriptors()
906 getDesc->statements = std::make_shared<StatementBlock>(); in generate_interface_descriptors()
908 std::make_shared<ReturnStatement>(std::make_shared<LiteralExpression>("DESCRIPTOR"))); in generate_interface_descriptors()
921 auto descriptor = std::make_shared<Field>( in generate_interface_descriptors()
922 STATIC | FINAL | PUBLIC, std::make_shared<Variable>("java.lang.String", "DESCRIPTOR")); in generate_interface_descriptors()
974 auto default_method = std::make_shared<Method>(); in generate_default_impl_method()
979 default_method->statements = std::make_shared<StatementBlock>(); in generate_default_impl_method()
982 std::make_shared<Variable>(JavaSignatureOf(arg->GetType(), typenames), arg->GetName())); in generate_default_impl_method()
989 std::make_shared<LiteralStatement>(StringPrintf("return %s;\n", defaultValue.c_str()))); in generate_default_impl_method()
997 auto default_class = std::make_shared<Class>(); in generate_default_impl_class()
1020 default_class->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str())); in generate_default_impl_class()
1028 default_class->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str())); in generate_default_impl_class()
1034 std::make_shared<LiteralClassElement>("@Override\n" in generate_default_impl_class()
1063 interface->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str())); in generate_binder_interface_class()
1068 interface->elements.emplace_back(std::make_shared<LiteralClassElement>(code.str())); in generate_binder_interface_class()
1076 auto stub = std::make_shared<StubClass>(iface, options); in generate_binder_interface_class()
1085 auto proxy = std::make_shared<ProxyClass>(iface, options); in generate_binder_interface_class()
1097 interface->elements.push_back(std::make_shared<LiteralClassElement>(code)); in generate_binder_interface_class()
1132 stub->elements.emplace_back(std::make_shared<LiteralClassElement>( in generate_binder_interface_class()
1148 std::make_shared<LiteralClassElement>(StringPrintf("public static %s getDefaultImpl() {\n" in generate_binder_interface_class()
1155 proxy->elements.emplace_back(std::make_shared<LiteralClassElement>( in generate_binder_interface_class()