Граф коммитов

168 Коммитов

Автор SHA1 Сообщение Дата
Tanner Gooding cfc66ade75 Enabling NRTs 2022-09-17 19:50:40 -07:00
Tanner Gooding 889b3c4e75 Update to support .NET 7 and other basic infrastructure updates 2022-09-14 20:26:19 -07:00
Tanner Gooding b81585260c Updating version information to llvmorg-15.0.0 2022-09-14 20:25:33 -07:00
Tanner Gooding dd60b2a551 Switch to using file-scoped namespaces 2022-09-14 20:00:53 -07:00
Tanner Gooding fd7347184f Updating the .editorconfig to have support newer rules 2022-09-14 20:00:52 -07:00
Tanner Gooding cb2e228e6c Updating the preview-codegen tests to account for UnscopedRef 2022-08-18 08:41:27 -07:00
Tanner Gooding dd4443858d Ensure that the preview-codegen tests are validating the right things 2022-08-18 07:29:29 -07:00
Tanner Gooding 032a7dc2c3 Adding tests covering `preview-codegen` 2022-08-18 07:14:34 -07:00
Tanner Gooding 202bcd5951 Fixing C Incomplete Array to be treated as a Constant Array of length 1 2022-08-13 13:01:49 -07:00
Tanner Gooding 1fbe370851 Ensure that multiple-inheritance scenarios generate unique field names 2022-08-13 11:20:37 -07:00
Tanner Gooding 26a6c34c85 Adding tests covering C incomplete arrays 2022-08-11 20:54:17 -07:00
Tanner Gooding d666ee58e3 Adding tests validating `const` and `static const` string literals over T* in addition to T[] 2022-08-11 20:10:49 -07:00
Tanner Gooding b47429b331 Ensure `static const` string literal tests pass 2022-08-11 20:10:49 -07:00
Tanner Gooding f2d02ab806 Adding tests covering `static const` string literals 2022-08-11 20:10:49 -07:00
Patrick Meinecke 28e444e1ee
Add tests for explicit-vbl + marker-interface 2022-07-27 15:07:23 -04:00
Tanner Gooding 08851fe819
Merge pull request #358 from kant2002/kant/fix-unwrap
Do not remove parethensis
2022-07-15 08:37:48 -07:00
Tanner Gooding ae60be4661
Merge pull request #344 from Berrysoft/dev/varargs
Add support for varargs.
2022-07-15 08:35:43 -07:00
Andrii Kurdiumov b5fb74d053 Do not remove parethensis
That's potentially risky move on real codebases, but that's not captured anywhere in tests, so I will move ahead with a change.

Would be good if somebody test that on some larger codebase and check how it works for them.

Most other changes is only in testing infra. I take liberty and do following change operating from following premises.
- there only 2 radically different output formats: CSharp and Xml
- Most codegeneration would be platform neutral.
- You will need to override tests based on platform needs (like it is right now)

I do trying not create sets of identical tests for each platform, since it's a bit boring and timeconsuming to validate. For example using existing approach not clear what's platform-independent behaviour and what is OS specific behavior of ClangSharp. After this change all platform independent tests may sit in Base folder, and additional tests and/or augmentations will be in same location as it is now.

Fixes #357
2022-07-11 11:11:06 +06:00
Tanner Gooding b6139e2127 Adding tests covering bool as a struct/union field 2022-06-17 07:30:12 -07:00
Yuyi Wang 329e6fc8d6 Remove the tailing space.
When the param name is empty.

Actually the only possible case is when
type is __arglist.
2022-06-08 14:30:00 +08:00
Berrysoft 2929f15acd Add support for varargs. 2022-04-30 10:57:48 +08:00
Tanner Gooding 64042a723f Fixing some tests to match the new libClang output for array types 2022-04-02 23:23:16 -07:00
Tanner Gooding 2ec55e77b9 Regenerating bindings for libClang v14.0.0 2022-04-02 21:59:50 -07:00
Tanner Gooding 0db5294ef4 Updating version information to v14.0.0 2022-04-02 12:34:01 -07:00
Tanner Gooding 74a80fe06c Fixing tests and ensuring existing support doesn't regress 2021-12-25 21:00:20 -08:00
Tanner Gooding fe0a5b3c2f Adding basic support for annotating manual imports 2021-12-18 16:44:58 -08:00
Tanner Gooding a43457f221 Make PInvokeGeneratorConfiguration more forward compatible 2021-12-18 14:49:55 -08:00
Tanner Gooding 467f4b700c Ensure that non-virtual C++ instance methods without a body have an inserted parameter for pThis 2021-12-02 17:21:25 -08:00
Tanner Gooding c667a53425 Updating the tests to use NUnit 2021-12-02 12:46:02 -08:00
Tanner Gooding ee470180ce Replacing microsoft/clangsharp with dotnet/clangsharp 2021-12-02 08:28:35 -08:00
Tanner Gooding 7cb48628ad Adding support for --with-suppressgctransition and extending several other options to do checks against qualified names 2021-11-28 13:20:23 -08:00
Tanner Gooding a063c444db Ensure attributes and using statements are output for all declaration kinds 2021-11-23 17:47:00 -08:00
Tanner Gooding 624948c741 Adding support for overriding the output class for constants and methods 2021-11-13 17:14:36 -08:00
Tanner Gooding 6d51dbf4f9 Adding support for explicitly including members to bind 2021-11-13 02:18:34 -08:00
Tanner Gooding 23c94b4d90 Updating the license to MIT 2021-11-11 14:25:37 -08:00
Tanner Gooding 2abb566a3f Updating copyright to .NET Foundation and Contributors 2021-11-11 13:27:50 -08:00
Tanner Gooding 7765cf9c33 Add support for a new --with-namespace option 2021-11-09 13:37:56 -08:00
Tanner Gooding e6d18c4856 Add support for generating trimmable vtbls 2021-11-06 23:14:00 -07:00
Tanner Gooding d5fb352600 Adding support for specifying a transparent struct kind 2021-10-31 10:36:52 -07:00
Tanner Gooding b16ceb635d Adding basic support for "transparent structs" 2021-10-30 16:46:46 -07:00
Tanner Gooding 079de21a37 Moving forward to net6.0 and fixing a few issues around -m64 2021-10-28 19:38:30 -07:00
Tanner Gooding c941128dcd Adding support for overriding the access specifier 2021-10-11 08:13:33 -07:00
Tanner Gooding 8051870da0 Updating the versioning information to v13.0.0 2021-10-01 19:29:48 -07:00
Tanner Gooding 98d8b6751a Fixing a test and ensuring the handling for static readonlies doesn't break 2021-09-28 21:58:46 -07:00
Tanner Gooding 2175ae3610 Adding support for generating unmanaged constants 2021-09-26 19:14:14 -07:00
Tanner Gooding f9c3c091e1 Fixing some tests and simplify when casts are inserted for character literals 2021-09-23 18:56:52 -07:00
Tanner Gooding 9ecf2e70aa Adjusting the pack tests to pass on 32-bit machines 2021-08-26 10:26:05 -07:00
Tanner Gooding 7d4f662962 Fixing a couple tests related to the struct packing fix 2021-08-26 08:17:10 -07:00
Tanner Gooding 700c8057fb
Ensure that the record packing and calling convention are correct regardless of -m32 or -m64 (#258)
* Ensure that the record packing and calling convention are correct regardless of -m32 or -m64

* Disable the macOS legs
2021-08-04 14:09:21 -07:00
Tanner Gooding 69bf841684
Fix additional low hanging bugs (#257)
* Refactoring how the calling convention is looked up for a given cursor or type

* Ensure that non-char based string literals don't assert with debug clang

* Ensure that managled names are correctly represented in DllImport

* Ensure creating a span over a pointer works on netstandard

* Don't include the underscore prefix on the entry point name for simple C exports
2021-08-04 10:28:19 -07:00
Tanner Gooding d0ca6a68a2
Fixing some low hanging bugs. (#256)
* Ensure ObjCProtocol creates an ObjCProtocolDecl

* Ensure the number of indirections for function pointer typedefs is correct

* Handle type prefixes in C

* Add basic handling for VarDecl and OffsetOfExpr

* Allow specifying just `-x c` on the command line

* Fix the C test on Unix
2021-08-03 20:49:51 -07:00
Tanner Gooding 702d4704df
Updating to Clang v12.0.0 (#235)
* Updating Clang/LLVM to 12.0.0

* Splitting the main project into ClangSharp and ClangSharp.Interop

* Enable long file paths before cloning win32metadata

* Add ClangSharpPInvokeGenerator to the path when testing win32metadata
2021-05-28 07:10:30 -07:00
Andrew Boyarshin b3fdc2ff94
Introduce EnumDesc, add ability to output source location attribute (#227)
* Introduce EnumDesc, add ability to output source location attribute

* Expose config flag and add struct+field test

* Add method+parameter test

* Update PInvokeGeneratorConfigurationOptions to use bit shifting
2021-04-10 12:20:32 -07:00
Thad House cbe1fb38b1
Mark ternary macros that can be evaluated as constants as const (#221)
Previously, all conditionals were marked as not constant. However, if the Cond, LHS and RHS are all constant, the ternary can be marked constant as well
2021-04-08 15:37:10 -07:00
Tanner Gooding dd684be635
Fixing various bugs, analyzer warnings, and adding very basic template support (#226)
* Adjusting how the index is retrieved for call expressions

* Allow getting the current contents of the C# output builder

* Better handle getting the cursor qualified name when DeclContext is null

* Handle IntegerLiteral where the kind is a named constant

* Ensure the checks in Type.CastAs and Type.GetAs are correct

* Fallback to ThisObjectType.AsCXXRecordDecl when CXXMethodDecl.Parent is null

* Better support generating names for template types

* Handle call expressions that don't have a declaration

* Don't try to directly visit a virtual destructor declaration

* Correctly handle argument counts for instance CXXOperatorCallExpr

* Don't use Finalize for destructors as it is reserved

* Adding basic support for CXXNewExpr

* Adding basic support for CXXDefaultArgExpr

* Adding basic support for SubstNonTypeTemplateParmExpr

* Adding support for builtin and pointer init list expressions

* Handle FriendDecl and TemplateSpecializationType

* Adding basic support for ExprWithCleanups

* Ensure existing expression types are handled by IsChecked and IsConstant

* Updating GetRemappedName to respect remappings to the same name

* Resolving analyzer diagnostics

* Adding basic support for handling class and function template declarations

* Don't emit NativeTypeNameAttribute when the names only differ by whitespace

* Don't double count anonymous record decls when computing size

* Handle label declarations

* Respect an existing type name remapping

* Ensure we don't traverse too far up for indirect field decl context parts

* Ensure ArraySubscriptExpr differentiates LHS vs RHS

* Ensure we still do the nativeTypeName == remappedName check in all paths

* Collect artifacts from the win32metadata test

* Fixing an issue with the "exclude function bodies" logic

* Don't process template decls without explicit opt-in

* Ensure GetTypeSize doesn't end up with an alignment of -1
2021-04-03 13:27:35 -07:00
Tanner Gooding b550825b04
Ensure remapping and anonymous record names are correct (#219)
* Catch exceptions and return them as a trailing error diagnostic

* Handle null statements

* Ensure nested anonymous records get the correct name

* Adding tests to cover remapping nested type names

* Ensure remapping works for either A::B or A.B
2021-03-23 18:51:34 -07:00
Tanner Gooding f5e2b194b0
Ensure the right call conv is checked for x86 Windows (#216) 2021-03-22 01:14:26 -07:00
Tanner Gooding 7105c10502
Cleanup to resolves some bugs and codegen issues (#215)
* Adding an option for generating a VtblIndex attribute

* Adding tests validating the VtblIndexAttribute, NativeInheritanceAttribute, and explicit vtbl generation

* Move fnptr and nint codegen to be part of latest by default

* Ensure multi-dimensional fixed-sized buffers use the correct name for the first field

* Ensure multi-dimensional buffers are correctly handled for variable declarations

* Ensure we use main and beta3 in our CI and versions
2021-03-21 23:50:51 -07:00
Tanner Gooding f29a2c37f9
Updating libClangSharp to have more extensive support for the underlying AST (#213)
* Ensure vtbl indices are properly accounted for.

* Updating Stmts to use Stmt.Children where possible

* Expanding support for Expr in libClangSharp

* Expanding support for Decl in libClangSharp

* Ensure that the P/Invoke Generator works with libClangSharp changes

* Ensure ObjC and AtomicExpr expose their members

* Switch to ConcurrentDictionary to better handle parallel translation unit creation/destruction

* Ensure we aren't taking the address of an rvalue

* Ensure the right vtbl indices are picked for Unix vs Windows

* Updating libClangSharp to beta2
2021-03-21 18:40:34 -07:00
Tanner Gooding b43ff4c47e
Adding test coverage for the XML generator (#212)
* Adding XmlLatestWindows tests

* Adding XmlCompatibleWindows tests

* Adding XmlLatestUnix and XmlCompatibleUnix tests

* Ensure we use expectedPack for XmlCompatibleUnix
2021-03-20 18:43:52 -07:00
Tanner Gooding 40e5053efb
Updating the tests coverage (#211)
* Ensure tests run for Latest vs Compat and Unix vs Window modes

* Ensure \n is used in the xml generator

* Fixing up some running on unix vs windows test differences
2021-03-20 13:08:23 -07:00
Dylan Perks 9e21dc1110
Abstract away output mechanisms & add support for XML dumps (#206)
* Start of XML output

* Continuation of XML output

* Add Rider stuff to the .gitignore

* Start breaking the ice on COM

* Finished(?) structs with COM helpers

* It builds!

* Change to om

* Fix NRE

* Initial set of fixes

* C# fixes

* XML fixes

* Internalise

* Internalise OutputBuilderFactory

* Fix some tests

* Be more stern with our dividers

* Continued

* Revert "Continued"

This reverts commit ae28f46a35.

* Try hacking something together

* Move

* Try again

* Boolean logic is failing me

* Somewhat hacky fix but it makes sense

* ConstantDesc

* FieldDesc

* Flags

* Update FunctionOrDelegateDesc.cs

* Update FunctionOrDelegateDesc.cs

* Update StructDesc.cs

* Accessibility enums?

* Calling convention enum

* Set vtbl methods as unsafe by default

* Ensure "unsafe" is inserted for standalone delegates

* Ensure unsafe isn't emitted on the method class due to vtbl helper methods

Co-authored-by: Tanner Gooding <tagoo@outlook.com>
2021-03-19 21:10:37 -07:00
Tanner Gooding 2d37452f67
Updating to support .NET 5 and to use Open.snk (#202)
* Add the libClangSharp files as solution items

* Updating to support .NET 5 and to use Open.snk

* Don't set RuntimeIdentifier at the solution level

* Don't build ClangSharpPInvokeGenerator for net461 since that blocks packing as a tool

* Adding a job to build the release nuget packages
2021-02-10 23:32:01 -08:00
John Tur 3a0418113c
Insert cast to enum underlying type when casting to enum type in enum initializer (#197)
* Remove casts to enum types in enum initializers

* Try to fix test

* Rework
2021-01-30 15:36:46 -08:00
John Tur 9e7cc46b8d
Add better support for function-like casts (#196) 2021-01-29 16:04:19 -08:00
John Tur 4ed1d65265
Add support for templates in type signatures (#192)
* Add support for templates in type signatures

* Fix possible stack overflow

* Address PR feedback, add test coverage

* Use IntPtr instead of UIntPtr
2021-01-21 09:22:05 -08:00
John Tur b01ebedc8f Add unchecked handling for reinterpret_cast (#193) 2021-01-19 09:29:49 -08:00
John Tur da66f976f1
Fix remapping for union field names (#191)
* Fix remapping for union field names

* Remove dead logic
2021-01-08 09:14:11 -08:00
John Tur 280d879377
Fix translation for implicit move constructor invocation (#188) 2021-01-07 21:14:28 -08:00
John Tur 077eaba468
Fix translation for constant string literals (#189) 2021-01-07 21:04:54 -08:00
Tanner Gooding 2e4f410e6c
Regenerating bindings for Clang 11.0.0 (#181)
* Regenerating bindings for Clang 11.0.0

* Ensure some libClangSharp enums are updated for libClang 11
2020-10-26 11:38:44 -07:00
Mukul Sabharwal 32640d4ca1
Fix struct parsing in C mode (#172) 2020-09-15 15:07:09 -07:00
John Tur 8ccc392797
Fix unchecked generation for pointers (#169)
* Fix unchecked generation for pointers

* Fix build break on .NET Standard 2.0
2020-09-14 08:38:05 -07:00
Tanner Gooding 3ac96c58b9
Add exclusion support for helper methods and support for AggressiveInlining (#168)
* Simplifying several of the local functions to implicitly capture `this`

* Adding support for aggressively inlining helper functions

* Simplifying the outputBuilder calls

* Optimize exclusion checks

* Fixing the location of AggressiveInlining attributes

* Simplifying the test helper method for validating generated bindings

* Fixing OutputVtblHelperMethod to correctly track the index even when excluding
2020-09-02 09:34:16 -07:00
Tanner Gooding 22ab4a162f
Fix a few code generation bugs around fixed sized buffers and nested anonymous records (#166)
* Better handle emitting the qualified name for nested anonymous records

* Ensure fixed sized buffers defined via typedefs are emitted properly.

* Better handle fixed sized buffers in anonymous records for compat mode
2020-08-19 12:49:34 -07:00
Tanner Gooding ebe0a66e34
Further improve codegen around UUID attributes and parentheses handling (#165)
* Automatically handle uuid attributes

* Don't emit EntryPoint if unnecessary

* Automatically generate IID_RecordName variables for uuid attributes

* Track struct inheritance in the NativeTypeName attribute

* Traverse namespace declarations and perform better statement lookthrough for parentheses

* Fixing a check in IsEnumOperator

* Skip the GuidTest on Unix
2020-08-05 10:40:52 -07:00
Tanner Gooding b4f48863c7
Improve the generated code for a number of scenarios (#163)
* Adding support for automatically excluding com proxies, certain conflicting method declarations, empty records, and enum operators

* Improve generated code for a number of scenarios
2020-08-03 12:38:13 -07:00
Tanner Gooding 28dd07399a
Update libClangSharp to 10.0.2-beta and improve some codegen handling (#162)
* Exposing additional information about types

* Don't pack as tool for local builds

* Handle Enum as the backing bitfield type

* Handle CXXUuidofExpr

* Handle arrays with a size of 0

* Adding support for alignof UnaryExprOrTypeTraitExpr

* Adding support for GotoStmt and LabelStmt

* Ensure the number of template arguments is correctly returned

* Escape string literals

* Cleaning up how semicolons are emitted and statement bodies are visited

* Upgrading libClangSharp to 10.0.2-beta2

* Adding Microsoft.SourceLink.GitHub

* Fixing the handling of while statement bodies
2020-07-23 11:19:06 -07:00
Tanner Gooding 7a873c847c
Massively improve the perf of MacroDefinitionRecord handling (#161)
* Handle some explicit integer literal suffixes

* Changing macro binding support to parse at most one additional translation unit

* Ensure UnaryExprOrTypeTraitExpr doesn't crash

* Better handle insertion of unchecked for explicit and implicit casts over integer literals

* Ensure nested anonymous structs have the right name
2020-07-10 17:32:57 -07:00
Tanner Gooding 6355b742f7
Improve the handling of various declaration types and add support for generating macro bindings (#160)
* Removing unnecessary IsExcluded checks

* Updating anonymous unions to generate ref helpers for more natural access

* Adding minimal support for handling macro definition records

* Adding minimal handling for multi-line macro definition records

* Adding minimal handling for string literals

* Adding dedicated support for Guid constants

* Handle floating-point constants ending with just . or .f

* Cleaning up how the cursor parent is tracked so items can be lazily created

* Use WeakReference to help with memory for large ASTs

* Ensure LinkageSpecDecl children are still visited

* Regenerate libClang bindings

* Fixing a test to expect =>

* Fixing the handling for nested anonymous bitfield declarations

* Don't exclude VarDecl created for a MacroDefinitionRecord
2020-07-10 11:05:16 -07:00
Tanner Gooding d82f320e56
Extended the support for ClangSharp via libClangSharp (#159)
* Expanding the support for declarations

* Expanding the support for expressions and statements

* Ensure all cursors are traversed up front so the hiearchy is correct.

* Fixing a build warning

* Updating libClangSharp nuspecs to 10.0.0-beta2

* Updating ClangSharp to be 10.0.0-beta2

* Regenerating the interop bindings for libClangSharp

* Removing a duplicated file

* Fixing some issues in libClangSharp

* Updating ClangSharp to account for libClangSharp changes

* Updating libClangSharp to 10.0.1-beta2

* Fixing the CLANGSHARP_LINKAGE definition on Windows
2020-07-06 10:32:26 -07:00
Tanner Gooding 3bb10a05a1
Ensure bitfields are still correctly handled if there is only one (#156) 2020-06-24 16:04:28 -07:00
Tanner Gooding e23c23df60
Improving handling of bitfields (#152) 2020-06-20 15:07:57 -07:00
Tanner Gooding 89ef26a6be
Adding an explicit test covering structs that contain pointers to the same type (#147) 2020-06-16 09:00:39 -07:00
Tanner Gooding a175b130a1
Support implicit VTBLs and generating basic interop tests (#143)
* Fixing up how function pointer signatures are emitted for VTBLs

* Add a new config option for generating explicit vs implicit vtbls and make implicit the default.

* Adding basic support for generating tests

* Adding basic sanity tests for the interop structs

* Adding a missing parenthese

* Fixing a test to assert the correct size on 32-bit vs 64-bit
2020-06-07 08:06:36 -07:00
Tanner Gooding d43acbe885
Updating the binding generator with additional functionality (#142)
* Add a DebuggerDisplay attribute to Cursor and Type

* Ensure we insert unchecked casts for certain implicit conversions

* Adding some more members to Cursors/Preprocessings/*

* Allow more members to be excluded and to be excluded via the fully qualified name

* Adding a switch to log declarations which get excluded and why

* Adjusting the declaration exclusion check to include the file check and support logging visited files

* Adding functionality to get the argument type or expression from a UnaryExprOrTypeTraitExpr

* Don't return a void expression

* Allow folding away a sizeof for an optional argument expression when the size is fixed

* Ensure we ignore prior visitations for decl statements

* Partially handle class template specializations in the qualified name logic

* Include nothrow in the method qualified name

* Handle bool and packing

* Handle UnaryExprOrTypeTraitExpr which have a Ref child

* Avoid a warning for Linux/macOS in the enum declaration tests
2020-05-30 07:48:24 -07:00
Tanner Gooding ff5e44084f
Add a with-librarypath option and better handle anonymous names by default (#141)
* Enable better default handling of anonymous names

* Add a --with-librarypath option

* Use a case insensitive comparison on Windows

* Don't emit the calling convention for Winapi

* Don't add extra quotes around the older --libraryPath option
2020-05-24 07:36:07 -07:00
Tanner Gooding 0ca80de67d
Update dependencies and fix some functionality (#140)
* Removing dependency on Microsoft.Net.Compilers.Toolset

* Updating dependencies to their latest versions

* Removing a System.CommandLine workaround for the argument arity

* Make the --library optional

* Adding support for with-setlasterror

* Fixing function pointers to not unnecessarily add an indirection

* Ensure ReferenceTypes are dereferenced using ->

* Don't use pointers for the fixed sized-buffer ref codegen
2020-05-22 07:55:31 -07:00
Tanner Gooding 05c0ee0ab2
Fixing some pain points around paths and ensure a couple of edge scenarios are handled (#128)
* Work around a limitation in System.CommandLine

* Normalize paths when checking for files to traverse

* Ensure we traverse LinkageSpecDecls so that extern "C" { #include <file> } isn't missed

* Normalize the native type name when it contains a path

* Normalizing paths when printing diagnostics

* Handling visiting typedefs to attributed types

* Handle empty return statements

* Adding handling for anonymous field declarations
2020-04-30 07:58:22 -07:00
Tanner Gooding 9fbfa57afb
Adds a 'preview-codegen' config option (#123)
* Add support for generating nint/nuint as a preview feature

* Add support for generating fnptrs as a preview feature

* Don't mark the Vtbl field as readonly

* Fixing up the tests to not require `readonly Vtbl`
2020-04-15 22:34:38 -07:00
Tanner Gooding 862552cf4e
Update to Clang 10.0.0 (#121)
* Updating the version to 10.0.0

* Updating dependencies to their latest stable versions

* Upgrading to .NET Core 3.1

* Resolving issues from upgrading System.CommandLine

* Switching the launchSettings.json to use rsp files

* Fixing up the libClangSharp helper library for 10.0.0

* Regenerating the ClangSharp bindings for 10.0.0

* Fixing up the Interop.Extensions

* Fixing up the managed API

* Updating the Linux rid to ubuntu.18.04-x64

* Upgrade the unit test projects to netcoreapp3.1
2020-04-11 23:36:44 -07:00
Tanner Gooding 39d7508a99
Support a few more statement and declaration types (#115)
* Support InitListExpr

* Support CXXConversionDecl

* Fixing spacing of VarDecls and trim unnecessary literal specifiers

* Print a diagnostic when encountering a function template

* Handle non-virtual method declarations from base classes

* Take LValueReferenceType transformations into account when visiting AddrOf unary operators

* Provide a more fine-tuned way to exclude methods and change --with-namespace to be called --with-using
2019-12-05 19:13:18 -08:00
Tanner Gooding 3d3f5d835e
Adding support for binding the most common statement and expression kinds (#114)
* Ensure base types with fields are handled

* Ensure using declarations are handled

* Fixing how "new" is applied to the member names

* Handle typedefs to references

* Handle character literals

* Adding tests covering more optional parameter types

* Changing the visitation logic to only track visited declarations

* Handle the common case of implicit conversion from 0 to nullptr

* Handle cxx named cast expressions

* Ensure that static using directives are printed when there are no regular using directives

* Adding support for array subscript expressions

* Updating BinaryOperator and CallExpr to use explicit indices

* Handle conditional operators

* Handle member expressions

* Handle cxx this expressions

* Adding support for declaration statements

* Updating OutputBuilder to directly track and handle additional newline requirements

* Handle if/then/else statements

* Fixing VisitDeclStmt to need a newline unless the previous statement was also a DeclStmt

* Adding some logic for better handling semicolons and newlines in statements

* Adding support for do and while statements

* Adding support for for statements

* Adding support for switch, case, default, break, and continue statements

* Adding support for CXXMemberCallExpr

* Support CXXConstructorDecl and CXXDestructorDecl

* Adding support for binding and calling operators
2019-12-04 18:18:33 -08:00
Tanner Gooding 29c7016671
Fixing binding generation to support multidimensional arrays and conflicting names (#113)
* Ensure multidimensional constant arrays work as expected

* Support adding the "new" keyword when required for certain member names.

* Fixing the vtbl binding generation to account for conflicting names.
2019-12-03 01:21:51 -08:00
Tanner Gooding 2ca5ba990c
Adding support for optional parameters, overriding the EnumDecl type, and overriding the CallingConv (#112)
* Adding support for optional parameters

* Adding support for overriding an enum decl type and a function callconv.
2019-12-02 23:29:17 -08:00
Tanner Gooding a87de9ad5b
Provide a mechanism for providing additional attributes and using directives for declarations (#111)
* Ensure the expansion location is taken into account for all declaration traversals

* Provide a mechanism for providing additional attributes and using directives for declarations
2019-12-02 20:39:07 -08:00
Tanner Gooding ddb471a433
Add binding generation support for virtual instance methods (#110)
* Don't add a diagnostic if an anonymous declaration is remapped

* Add binding generation support for virtual instance methods
2019-12-01 11:12:10 -08:00
Tanner Gooding cde619a415
Adding support for generating bitfield bindings (#109)
* Moving the constant array output builder code to a static local function

* Adding support for generating bitfield bindings
2019-11-30 17:48:47 -08:00
Tanner Gooding 1fc258b8e0
Updating the GetTypeName handling to better handle anonymous records and pointee types (#108)
* Fixing GetTypeName to handle anonymous records

* Fixing GetTypeName to handle remapped pointee types
2019-11-30 12:23:18 -08:00
Tanner Gooding dc05b769f8
Adding explicit tests covering C style unions (#107) 2019-11-30 10:41:25 -08:00