[NFC][Coroutines] Use structured binding with llvm::enumerate in CoroSplit (#116879)
[llvm-project.git] / lldb / bindings / python / python-swigsafecast.swig
blob7a4f7e81f1cc3b3e90082768f8abe480bf878b79
1 namespace lldb_private {
2 namespace python {
4 PythonObject ToSWIGHelper(void *obj, swig_type_info *info) {
5   return {PyRefType::Owned, SWIG_NewPointerObj(obj, info, SWIG_POINTER_OWN)};
8 PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBValue> value_sb) {
9   return ToSWIGHelper(value_sb.release(), SWIGTYPE_p_lldb__SBValue);
12 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ValueObjectSP value_sp) {
13   return ToSWIGWrapper(std::unique_ptr<lldb::SBValue>(new lldb::SBValue(value_sp)));
16 PythonObject SWIGBridge::ToSWIGWrapper(lldb::TargetSP target_sp) {
17   return ToSWIGHelper(new lldb::SBTarget(std::move(target_sp)),
18                       SWIGTYPE_p_lldb__SBTarget);
21 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessSP process_sp) {
22   return ToSWIGHelper(new lldb::SBProcess(std::move(process_sp)),
23                       SWIGTYPE_p_lldb__SBProcess);
26 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ThreadPlanSP thread_plan_sp) {
27   return ToSWIGHelper(new lldb::SBThreadPlan(std::move(thread_plan_sp)),
28                       SWIGTYPE_p_lldb__SBThreadPlan);
31 PythonObject SWIGBridge::ToSWIGWrapper(lldb::BreakpointSP breakpoint_sp) {
32   return ToSWIGHelper(new lldb::SBBreakpoint(std::move(breakpoint_sp)),
33                       SWIGTYPE_p_lldb__SBBreakpoint);
36 PythonObject SWIGBridge::ToSWIGWrapper(Status&& status) {
37   return ToSWIGHelper(new lldb::SBError(std::move(status)), SWIGTYPE_p_lldb__SBError);
40 PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBStructuredData> data_sb) {
41   return ToSWIGHelper(data_sb.release(), SWIGTYPE_p_lldb__SBStructuredData);
44 PythonObject SWIGBridge::ToSWIGWrapper(const StructuredDataImpl &data_impl) {
45   return ToSWIGWrapper(std::unique_ptr<lldb::SBStructuredData>(new lldb::SBStructuredData(data_impl)));
48 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ThreadSP thread_sp) {
49   return ToSWIGHelper(new lldb::SBThread(std::move(thread_sp)),
50                       SWIGTYPE_p_lldb__SBThread);
53 PythonObject SWIGBridge::ToSWIGWrapper(lldb::StackFrameSP frame_sp) {
54   return ToSWIGHelper(new lldb::SBFrame(std::move(frame_sp)),
55                       SWIGTYPE_p_lldb__SBFrame);
58 PythonObject SWIGBridge::ToSWIGWrapper(lldb::DebuggerSP debugger_sp) {
59   return ToSWIGHelper(new lldb::SBDebugger(std::move(debugger_sp)),
60                       SWIGTYPE_p_lldb__SBDebugger);
63 PythonObject SWIGBridge::ToSWIGWrapper(lldb::WatchpointSP watchpoint_sp) {
64   return ToSWIGHelper(new lldb::SBWatchpoint(std::move(watchpoint_sp)),
65                       SWIGTYPE_p_lldb__SBWatchpoint);
68 PythonObject SWIGBridge::ToSWIGWrapper(lldb::BreakpointLocationSP bp_loc_sp) {
69   return ToSWIGHelper(new lldb::SBBreakpointLocation(std::move(bp_loc_sp)),
70                       SWIGTYPE_p_lldb__SBBreakpointLocation);
73 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ExecutionContextRefSP ctx_sp) {
74   return ToSWIGHelper(new lldb::SBExecutionContext(std::move(ctx_sp)),
75                       SWIGTYPE_p_lldb__SBExecutionContext);
78 PythonObject SWIGBridge::ToSWIGWrapper(lldb::TypeImplSP type_impl_sp) {
79   return ToSWIGHelper(new lldb::SBType(type_impl_sp), SWIGTYPE_p_lldb__SBType);
82 PythonObject SWIGBridge::ToSWIGWrapper(const TypeSummaryOptions &summary_options) {
83   return ToSWIGHelper(new lldb::SBTypeSummaryOptions(summary_options),
84                       SWIGTYPE_p_lldb__SBTypeSummaryOptions);
87 PythonObject SWIGBridge::ToSWIGWrapper(const SymbolContext &sym_ctx) {
88   return ToSWIGHelper(new lldb::SBSymbolContext(sym_ctx),
89                       SWIGTYPE_p_lldb__SBSymbolContext);
92 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessLaunchInfoSP launch_info_sp) {
93    return ToSWIGHelper(new lldb::ProcessLaunchInfoSP(std::move(launch_info_sp)),
94                        SWIGTYPE_p_lldb__SBLaunchInfo);
95  }
97  PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessAttachInfoSP attach_info_sp) {
98    return ToSWIGHelper(new lldb::ProcessAttachInfoSP(std::move(attach_info_sp)),
99                        SWIGTYPE_p_lldb__SBAttachInfo);
102 PythonObject SWIGBridge::ToSWIGWrapper(lldb::DataExtractorSP data_sp) {
103   return ToSWIGHelper(new lldb::DataExtractorSP(std::move(data_sp)),
104                       SWIGTYPE_p_lldb__SBData);
107 ScopedPythonObject<lldb::SBCommandReturnObject>
108 SWIGBridge::ToSWIGWrapper(CommandReturnObject &cmd_retobj) {
109   return ScopedPythonObject<lldb::SBCommandReturnObject>(
110       new lldb::SBCommandReturnObject(cmd_retobj),
111       SWIGTYPE_p_lldb__SBCommandReturnObject);
114 PythonObject SWIGBridge::ToSWIGWrapper(const Stream *s) {
115   return ToSWIGHelper(new lldb::SBStream(), SWIGTYPE_p_lldb__SBStream);
118 PythonObject SWIGBridge::ToSWIGWrapper(std::shared_ptr<lldb::SBStream> stream_sb) {
119   return ToSWIGHelper(stream_sb.get(), SWIGTYPE_p_lldb__SBStream);
122 PythonObject SWIGBridge::ToSWIGWrapper(Event *event) {
123   return ToSWIGHelper(new lldb::SBEvent(event), SWIGTYPE_p_lldb__SBEvent);
126 PythonObject SWIGBridge::ToSWIGWrapper(
127     std::unique_ptr<lldb::SBFileSpec> file_spec_sb) {
128   return ToSWIGHelper(file_spec_sb.release(), SWIGTYPE_p_lldb__SBFileSpec);
131 PythonObject SWIGBridge::ToSWIGWrapper(
132     std::unique_ptr<lldb::SBModuleSpec> module_spec_sb) {
133   return ToSWIGHelper(module_spec_sb.release(), SWIGTYPE_p_lldb__SBModuleSpec);
136 } // namespace python
137 } // namespace lldb_private