Skip to content

Commit 09b6006

Browse files
committed
Add future plans
1 parent f8fb005 commit 09b6006

3 files changed

Lines changed: 74 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Generated Code
2+
3+
## C Wrapper
4+
5+
### Structs
6+
7+
### Unions
8+
9+
### Enums
10+
11+
### Classes
12+
13+
These are represented as structs containing a pointer.
14+
15+
### Functions
16+
17+
C++ function calls are wrapped in a try catch block to allow errors to be propogated to managed land.
18+
19+
### Fields
20+
21+
Generated functions for fields return a memory address for the field.
22+
23+
For instance fields, the generated function returns null if the object instance is null.
24+
25+
## C# Reconstruction
26+
27+
In the generated C# code, we attempt to maintain as much of the original C++ structure as possible.
28+
29+
## Limitations
30+
31+
* No templates. Anything that has them in the signature cannot be used.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Naming Convention
2+
3+
To prevent conflicts and maintain necessary information, a naming scheme is necessary.
4+
5+
Original C++: Namespace.Sub_Namespace.TypeName.Member
6+
7+
Generated C: Prefix__Namespace__Sub_1Namespace__TypeName__Member_i_h00000000
8+
9+
Underscores must be followed by another character.
10+
11+
## Prefix
12+
13+
To prevent conflict with symbols in the global namespace, a prefix is added to all symbols.
14+
15+
## Periods
16+
17+
A period (or `::`) in the original C++ maps to two consecutive underscores.
18+
19+
## Underscores in the original
20+
21+
If the original contained a sequence of underscores, those are represented by an underscore followed by a digit. In the unlikely event that the original had more than 9 consecutive underscores, they are separated into groups of 9. For example, 20 underscores would be `_9_9_2`.
22+
23+
## Overloaded members
24+
25+
If `_h` is encountered in the generated C symbol, anything that follows is considered an implementation detail to handle multiple potential overloads.
26+
27+
## Instance and static members
28+
29+
`_i` and `_s` represent the C# concepts of instance and static, respectively.

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
11
# AssetRipper.Bindings.LLVM
22

33
Bindings for LLVM
4+
5+
## Plans
6+
7+
### Version 1
8+
9+
This is a maximum-compatibility replacement for [LLVMSharp](https://github.com/dotnet/LLVMSharp) and uses the same namespace.
10+
11+
### Version 2
12+
13+
This will include a shift to the `AssetRipper.Bindings.LLVM` namespace along with other name changes.
14+
15+
### Version 3
16+
17+
This will involve significant code generation, with the goal of near-total recreation of the LLVM API in C#.

0 commit comments

Comments
 (0)