Joao Matos
c4a215f5fa
Re-generate the parser bindings.
6 years ago
Joao Matos
a5c5b4c930
Added initial generated files `Expr.h` and `Stmt.h`.
6 years ago
Joao Matos
f5d1040725
Improve parser bootstrapping generator to generate skeletons of statements.
6 years ago
Joao Matos
4ab3343fe5
Use `takeError()` when handling errors in parsing libraries.
6 years ago
Joao Matos
45c5435899
Fully qualify references to `clang::Stmt` in parser code.
6 years ago
Joao Matos
e9005f6eb2
Implemented Clang's MSVC toolchain lookup mode with `ForceClangToolchainLookup`.
6 years ago
Joao Matos
0be7e83a0e
Improve `ParserOptions.Verbose` to print compiler arguments.
6 years ago
Joao Matos
07e3113cef
Added a parsing option to skip gathering of native layout info.
...
The way we get AST layout info from Clang sometimes causes us to crash deep inside Clang.
While layout info is needed for binding C++ code, it is not usually necessary for more generalized AST consumption tasks, so add this option to make parsing code less problematic, until we are able to get the bugs tracked down.
6 years ago
Dimitar Dobrev
72709dcd7a
Fixed a crash when parsing libraries on macOS.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
beca1b5942
Fixed error handling when parsing non-existent libraries.
6 years ago
Joao Matos
4fcfe4e4eb
Build changes.
...
- Added support for building with Clang and LLD
- Switched to use csc.exe Roslyn compiler under Mono
- Disable most of the support for explicit pre-C++11 ABI since we do not
need it anymore
6 years ago
Dimitar Dobrev
e203463a9d
Added an option for skipping private declarations.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
c3629a2aad
Initial support for building under .NET Core.
6 years ago
Dimitar Dobrev
9a12db86d9
Fixed a regression in the generator of C++/CLI.
...
Restored the sorting by order of definition.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
32da859711
Exported all additional symbols on macOS.
...
Many functions in libc++ are marked with _LIBCPP_INLINE_VISIBILITY. This means they are only exported when actually used. This is why exporting just the templates themselves failed to export their functions but listing the functions themselves worked. We need to define _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS to have the functions always exported.
We use _LIBCPP_VERSION to detect if we use libc++ i.e. Clang's standard C++ library.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
41b22762a4
Fixed the marshalling of std::string with GCC 6+ on Linux.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
e035b27686
Fixed a crash when parsing type aliases.
...
This was caused by a change in behaviour in Clang - a8770a7e8e
(SVN revision 346146).
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
1356b9755d
Updated to LLVM/Clang revisions 348759/348755 respectively.
...
This fixes the parsing of the headers for MinGW 7.3.0 64-bit.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
84dec5d745
Removed a condition useless after the fixed late parsing of templates.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Joao Matos
a73635a497
Clean up re-usage and ownership of diagnostic clients in the parser.
7 years ago
Joao Matos
ef0b054301
Split Parser::ParseHeader into helper methods.
...
Use clang::SemaConsumer interface callback to walk over the parsed AST.
This deals with a nasty bug that occurs when processing late-parsed template declarations.
The clang::Parser object life is tied to clang::ParseAST function, so we need to process the AST in the callback.
Fixes https://github.com/mono/CppSharp/issues/1123 and (hopefully) https://github.com/mono/CppSharp/issues/1124 .
7 years ago
Dimitar Dobrev
a1af3d3182
Fixed the generated C# for a certain case of two default parameters.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
9908c746f4
Stopped using methods deprecated in recent Clang.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
9ed3c79d9d
Worked around a missing symbol from a template specialization on macOS.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
8f96b8e1bc
Worked around a missing symbol from a template specialization on macOS.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
c8536b4141
Updated to LLVM/Clang revisions 339502/339494 respectively.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
7 years ago
Dimitar Dobrev
fceb204a98
Fixed the generated C# for members of types nested in templates.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
cdc2e73f84
Fixed the generated C# when a template is nested in another.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
573818f33e
Fixed a regression, a crash, when generating the parser bindings.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Rokas Kupstys
aa33609d45
Clean up linux includes setup.
...
Includes setup was moved to ParserOptions.cs and is used just like `SetupMSVC()` and `SetupXcode()`. Native compiler is queried for it's type and version. Correct include paths are set up in cases where system has multiple compilers installed as well.
8 years ago
Rokas Kupstys
1cac2e0d78
Enable cxx11 abi for GCC 4.9+ on linux.
...
GCC version is checked, if version is 4.8 or lower then cxx11 ABI is disabled. Added new `--no-cxx11-abi` option. It explicitly disables cxx11 ABI even on new compilers. This option is also taken into account when building LLVM.
8 years ago
Dimitar Dobrev
a097cdd437
Fixed a crash when the body of a templated function contains references to non-functions.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
ed0c21aa4b
Regenerated the parser bindings.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Rokas Kupstys
05445f3028
Linux fixes, Bootstrap.cs build errors, warnings ( #1010 )
...
* Fix warnings about unused variables
* Fix linux include paths in ParserGen and CLI generator.
Remove parsing of `CppSharp.CppParser.lib` as it is not used.
* Fix build errors in CppSharp.Parser.Bootstrap target.
8 years ago
Dimitar Dobrev
97e24602c3
Fixed a possible crash when instantiating template functions in the parser.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
853e82f095
Fixed the generated C# for specialisations only used as type arguments.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
4d3c02e6e5
Validated bodies of instantiated template functions.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
faf0fbb656
Included template specialisations only used as returned types.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
aed21bed67
Included the destructor of std::allocator to the C++ symbols.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
e53b25346e
Prevented C++ generation for invalid specialised functions.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
481bbc0351
Updated to LLVM/Clang revisions 318543/318538 respectively.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
450a26a443
Revert "Removed an unused field and redundant parameters from the parser."
...
This reverts commit 51a109d2db
.
# Conflicts:
# src/CppParser/CppParser.cpp
# src/CppParser/CppParser.h
# src/CppParser/Parser.cpp
# src/CppParser/Parser.h
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
254cc0d279
Simplified the getting of the target info in the parser.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
33bc64ad9a
Reused the parsing of headers to get the target info as well.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
3abe0e5195
Deleted an useless field from the parser options.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
28f42bb1c7
Deleted useless fields from the parser.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
51a109d2db
Removed an unused field and redundant parameters from the parser.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
4945b595de
Renamed SetupHeader to Setup in order to generalise it for future extension.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
9c2f62c3eb
Fixed a crash when parsing unnamed declarations in name-spaces.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago
Dimitar Dobrev
310f1110df
Handled any level of nesting when generating internals for specialisations in C#.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago