llvm-project/lldb/unittests
Pavel Labath 9a14adeae0 [lldb] Remove 'extern "C"' from the lldb-swig-python interface
The LLDBSWIGPython functions had (at least) two problems:
- There wasn't a single source of truth (a header file) for the
  prototypes of these functions. This meant that subtle differences
  in copies of function declarations could go by undetected. And
  not-so-subtle differences would result in strange runtime failures.
- All of the declarations had to have an extern "C" interface, because
  the function definitions were being placed inside and extert "C" block
  generated by swig.

This patch fixes both problems by moving the function definitions to the
%header block of the swig files. This block is not surrounded by extern
"C", and seems more appropriate anyway, as swig docs say it is meant for
"user-defined support code" (whereas the previous %wrapper code was for
automatically-generated wrappers).

It also puts the declarations into the SWIGPythonBridge header file
(which seems to have been created for this purpose), and ensures it is
included by all code wishing to define or use these functions. This
means that any differences in the declaration become a compiler error
instead of a runtime failure.

Differential Revision: https://reviews.llvm.org/D114369
2021-11-30 11:06:09 +01:00
..
API [lldb] Handle missing SBStructuredData copy assignment cases 2021-05-05 15:12:03 -07:00
Breakpoint [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Core [lldb] Add support for demangling D symbols 2021-11-11 11:11:21 +01:00
DataFormatter [nfc] [lldb] Prevent needless copies of DataExtractor 2021-08-04 20:35:53 +02:00
Disassembler [lldb/Plugins] Rename lldbPluginDisassemblerLLVM (NFC) 2020-02-17 19:14:01 -08:00
Editline [lldb][NFC] Inclusive language: replace master/slave names for ptys 2021-11-12 10:54:18 -06:00
Expression [LLDB] Provide target specific directories to libclang 2021-11-25 21:27:02 +03:00
Host [lldb] [Host/Socket] Make DecodeHostAndPort() return a dedicated struct 2021-10-28 09:57:50 +02:00
Instruction Fix UB in EmulateInstructionARM64.cpp 2020-06-01 18:11:50 -07:00
Interpreter Follow-on to fix a test from c5011aed9c. 2021-10-18 16:53:32 -07:00
Language [lldb] Return StringRef from PluginInterface::GetPluginName 2021-10-18 10:14:42 +02:00
ObjectFile [LLDB][Breakpad] Make lldb understand INLINE and INLINE_ORIGIN records in breakpad. 2021-11-10 11:20:32 -08:00
Platform Update unit test API usage (NFC) 2021-11-29 13:14:35 -08:00
Process [lldb/gdb-remote] Ignore spurious ACK packets 2021-11-25 12:34:08 +01:00
ScriptInterpreter [lldb] Remove 'extern "C"' from the lldb-swig-python interface 2021-11-30 11:06:09 +01:00
Signals [lldb][NFC] Fix all formatting errors in .cpp file headers 2020-01-24 08:52:55 +01:00
Symbol [lldb] Make TypeSystemClang::GetFullyUnqualifiedType work for constant arrays 2021-10-29 11:13:59 +02:00
SymbolFile Remove ConstString from Language, LanguageRuntime, SystemRuntime and SymbolFile plugin names 2021-10-27 08:25:44 +02:00
Target [lldb] Move GetSupportedArchitectureAtIndex to PlatformDarwin 2021-11-24 15:48:23 +01:00
TestingSupport [lldb] [llgs] Support owning and detaching extra processes 2021-04-24 11:08:33 +02:00
Thread [lldb] Return StringRef from PluginInterface::GetPluginName 2021-10-18 10:14:42 +02:00
UnwindAssembly Bug where insn-based unwind plans on arm64 could be wrong 2020-04-14 16:57:25 -07:00
Utility [lldb] [Utility/UriParser] Return results as 'struct URI' 2021-10-25 10:58:21 +02:00
debugserver [lldb] [unittests] Fix TcpListen() call in RNBSocketTest 2021-10-26 21:08:03 +02:00
tools Recommit: [lldb] Remove "dwarf dynamic register size expressions" from RegisterInfo 2021-10-07 11:15:00 +02:00
CMakeLists.txt Re-land "[lldb] Make the API, Shell and Unit tests independent lit test suites" 2021-03-22 14:36:43 -07:00
gtest_common.h [lldb] Update header guards to be consistent and compliant with LLVM (NFC) 2020-02-17 23:15:40 -08:00