diff options
| author | Todd Fiala <todd.fiala@gmail.com> | 2016-11-09 23:21:04 +0000 |
|---|---|---|
| committer | Todd Fiala <todd.fiala@gmail.com> | 2016-11-09 23:21:04 +0000 |
| commit | 2ef442c639dcf6211bb779402cf6bbe102e2fbaa (patch) | |
| tree | c67191b63decbbba8e9e7dbf3a1de2099ec1592d /lldb/www/SB-api-coding-rules.html | |
| parent | 8183718cb1a6e137efc61c93bd3f4b89678de008 (diff) | |
| download | bcm5719-llvm-2ef442c639dcf6211bb779402cf6bbe102e2fbaa.tar.gz bcm5719-llvm-2ef442c639dcf6211bb779402cf6bbe102e2fbaa.zip | |
Fix weak symbol linkage in SBStructuredData, update docs.
Summary:
This change fixes an issue where I was leaking a weakly-linked symbol in
the SBAPI. It also updates the docs to call out what I did wrong.
Fixes:
rdar://28882483
Reviewers: jingham
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D26470
llvm-svn: 286413
Diffstat (limited to 'lldb/www/SB-api-coding-rules.html')
| -rw-r--r-- | lldb/www/SB-api-coding-rules.html | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lldb/www/SB-api-coding-rules.html b/lldb/www/SB-api-coding-rules.html index 0f7ef0e1eb5..83783b3a86a 100644 --- a/lldb/www/SB-api-coding-rules.html +++ b/lldb/www/SB-api-coding-rules.html @@ -36,7 +36,7 @@ <p>You also need to choose the ivars for the class with care, since you can't add or remove ivars without breaking binary compatibility. In some cases, the SB class is a thin wrapper around - an interal lldb_private object. In that case, the class can have a single ivar, which is + an internal lldb_private object. In that case, the class can have a single ivar, which is either a pointer, shared_ptr or unique_ptr to the object in the lldb_private API. All the lldb_private classes that get used this way are declared as opaque classes in lldb_forward.h, which is included in SBDefines.h. So if you need an SB class to wrap an lldb_private class @@ -47,8 +47,9 @@ as a direct ivar in the SB Class. Instead, make an Impl class in the SB's .cpp file, and then make the SB object hold a shared or unique pointer to the Impl object. The theory behind this is that if you need more state in the SB object, those needs are likely to change over time, - and this way the impl class can pick up members without changing the size of the object. - An example of this is the SBValue class. + and this way the Impl class can pick up members without changing the size of the object. + An example of this is the SBValue class. Please note that you should not put this Impl class + in the lldb namespace. Failure to do so leads to leakage of weak-linked symbols in the SBAPI. <p>In order to fit into the Python API's, we need to be able to default construct all the SB objects. Since the ivars of the classes are all pointers of one sort or other, this can easily be done, but |

