Dimitar Dobrev
bcdc2cf667
Fix leaking the memory of an entire Clang AST
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
João Matos
6a007e6d60
Implement basic support for parsing function-like macros.
5 years ago
Dimitar Dobrev
78ed7c72a1
Clean all C++ warnings in the parser
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
7fc681a41d
Ensure complete template specializations in AST
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
João Matos
c21ddcca1e
Implement parsing and AST processing of C++ deprecated attributes.
5 years ago
Dimitar Dobrev
c80986e04e
Always keep default constructors in the AST
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
40cd49ac37
Keep copy/move constructors and assignment in AST
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
8b0aecef9b
Instantiate exception specifications before reading
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
299cb912cc
Update LLVM to the latest version
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
5 years ago
Dimitar Dobrev
709fcb6f7e
Work around MSVC 32 crashing reading of exported symbols in Mach-O
...
See https://bugs.llvm.org/show_bug.cgi?id=44433 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
eab2620c18
Update LLVM to the latest version.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
Signed-off-by: Joao Matos <joao@tritao.eu>
6 years ago
Joao Matos
ac7bdb2585
Refactor Clang builtins directory logic and move it to the managed side.
...
This now matches systems Clang includes order on macOS which fixes a bug.
Signed-off-by: Joao Matos <joao@tritao.eu>
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
29c0b8593a
Print the parser target triple in verbose mode.
...
Signed-off-by: Joao Matos <joao@tritao.eu>
6 years ago
Joao Matos
7df1623e6d
Cleanup Clang resource directory lookup logic.
...
Now the logic is more standard across platforms, we always re-use the builtin bundled headers.
Fixes https://github.com/mono/CppSharp/issues/1259 .
6 years ago
Joao Matos
c5bcb48cc2
Implement UnresolvedUsingType and UnresolvedUsingTypename.
...
Fixes https://github.com/mono/CppSharp/issues/1235 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
17cc96bafd
Regenerate the parser bindings
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
6e963c1033
Remove useless creation of managed std::strings
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
547a9f2819
Fix the passing of std::string by value
...
std::string has a non-trivial copy constructor which was erroneously ignored.
Fixes #867 .
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
72368d5050
Fix returned objects by value attributed with inalloca
...
For more details see https://llvm.org/docs/InAlloca.html . This specific crash happened on Win 32 only.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
1fc1b4ec51
Fix default arguments to only map to null if pointers
...
This bug is revealed by properly fixing the reading of ABI parameters in the parser.
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
c579b65a3b
Update LLVM/Clang
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Dimitar Dobrev
a9bfe1c31f
Support indirect parameters
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 years ago
Joao Matos
3eee343554
Add parsing and AST support for RecordArgABI information in class records.
6 years ago
Joao Matos
ea7023dfad
Remove ParserOptions.Abi since its misleading as it serves no purpose.
6 years ago
Joao Matos
f35bd75563
Improved robustness when parsing C++ ABI kind.
...
Fixes https://github.com/mono/CppSharp/issues/1202 .
6 years ago
Joao Matos
378c9b301e
Added support for parsing function bodies (and option `SkipFunctionBodies`).
6 years ago
Joao Matos
d7fdf20b1e
Generate the native parser code for expression and statements.
6 years ago
Joao Matos
e9a2dda3fa
Improve robustness when parsing types and decls.
6 years ago
Joao Matos
aa73692543
Obsolete managed expression class machinery.
6 years ago
Dimitar Dobrev
2fe157d51a
Obsoleted all hand-written types for expressions.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
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
Dimitar Dobrev
e203463a9d
Added an option for skipping private declarations.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
6 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
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
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
97e24602c3
Fixed a possible crash when instantiating template functions in the parser.
...
Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
8 years ago