You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+38-35
Original file line number
Diff line number
Diff line change
@@ -1,25 +1,35 @@
1
1
# net-ssa [](https://github.com/m-carrasco/net-ssa/actions/workflows/build.yml)[](https://github.com/m-carrasco/net-ssa/actions/workflows/docker-ubuntu.yml)
2
2
3
-
Microsoft's high-level programming languages, such as C#, are compiled to CIL bytecode. The instruction set architecture of CIL operates on a stack virtual machine with local variables. CIL instruction's operands are implicit because they are elements in the stack. `net-ssa` provides a register-based intermediate representation for CIL where operands become explicit.
4
3
5
-
Using CIL properties, it is possible to know for every instruction which slots of the stack it consumes. Similarly, it is possible to know how many elements it pushes into the stack. `net-ssa`computes its initial representation promoting stack slots into registers. In this form, a stack slot promoted to register can be defined more than once. Local variables are accessed through store and load instructions (like LLVM-IR).
4
+
Microsoft's high-level programming languages, such as C#, are compiled into Common Intermediate Language (CIL) bytecode. The CIL instruction set operates on a stack virtual machine with implicit operands, as they are elements within the stack. `net-ssa`introduces a register-based intermediate representation for CIL, making operands explicit.
6
5
7
-
The initial register-based representation can be transformed into SSA form. SSA guarantees that every register is only defined once, and its unique definition dominates its uses. This transformation is based on dominance frontiers and partially implemented in Datalog.
6
+
CIL properties allow `net-ssa` to determine the stack slots consumed and the pushed elements amount for each instruction. The initial representation involves promoting stack slots into registers using this information. In this stage, a stack slot promoted to a register may have multiple definitions. Local variables are accessed through store and load instructions, similar to LLVM-IR.
8
7
9
-
`net-ssa`can be either used as a library `net-ssa-lib` or as command-line application `net-ssa-cli`.
8
+
The initial register-based representation can undergo transformation into Static Single Assignment (SSA) form. SSA ensures that each register is defined only once, and its unique definition dominates its uses. This transformation relies on dominance frontiers and is partially implemented in Datalog.
10
9
11
-
If you have any questions or suggestions, feel free to open an issue to discuss it.
10
+
`net-ssa` can be employed either as a library (`net-ssa-lib`) or as a command-line application (`net-ssa-cli`).
11
+
12
+
Feel free to open an issue to discuss any questions or suggestions you may have.
-[Simple type inference analysis](#simple-type-inference-analysis)
29
+
-[Precise type inference analysis](#precise-type-inference-analysis)
30
+
-[Contributing](#contributing)
31
+
-[Acknowledgements](#acknowledgements)
32
+
-[License](#license)
23
33
24
34
## Mirror
25
35
@@ -29,43 +39,36 @@ This is caused by Github's Git LFS bandwidth, which is 1GB per month.
29
39
## Quick setup
30
40
31
41
It is possible to develop and test `net-ssa` without installing any dependency in your system but [Docker](https://docs.docker.com/get-docker/).
32
-
However, it is adviced to compile the project at least once in the host system. This is mainly for downloading dependencies and correctly setting up any IDE.
* This is optional, it requires installing dotnet.
40
-
5.`docker build -t net-ssa/net-ssa .`
41
-
6.`docker run --name dev -v $(pwd):/net-ssa -ti net-ssa/net-ssa`
42
-
* This is now an interactive container. `$(pwd)` of the host is shared with the container as `net-ssa` source code folder.
43
-
7. Introduce changes in the source code using your IDE as usual.
44
-
8. Build and test in the container, execute these commands in the container terminal:
45
-
*`cd build`
46
-
*`(cd /net-ssa && dotnet build)`
47
-
*`lit integration-test/ -vvv`
48
-
*`exit # once you finish working`
49
-
9.`docker start -i dev # to resume the container terminal`
50
-
47
+
4.`./scripts/build-image.sh`
48
+
5.`./scripts/tmp-container.sh`
49
+
* This is now an interactive and temporary container.
50
+
* The host's folder containing the repository is shared with the container. In the container, this is located at `/home/ubuntu/net-ssa/`.
51
+
6. Introduce changes in the source code using your IDE as usual.
52
+
7. Build and test in the container, execute these commands in the container terminal:
53
+
*`dotnet build`
54
+
*`dotnet test`
55
+
*`lit integration-test/ -vvv`
51
56
52
57
## Build from sources
53
58
54
-
### Ubuntu 20.04
59
+
### Ubuntu 22.04
55
60
56
61
1.`cd net-ssa`
57
62
2.`git lfs checkout`
58
63
* Install [git lfs](https://git-lfs.github.com/)
59
64
3.`dotnet build`
60
65
4.`dotnet test`
61
-
5.`mkdir build`
62
-
6.`cd build && cmake ..`
63
-
7.`lit integration-test/ -vvv`
66
+
5.`lit integration-test/ -vvv`
64
67
65
-
To know the required dependencies for the integration tests (`cmake` and `lit` step), please check the [Dockerfile](https://github.com/m-carrasco/net-ssa/blob/main/Dockerfile).
68
+
Please check the [Dockerfile](https://github.com/m-carrasco/net-ssa/blob/main/Dockerfile) to know which dependencies must be installed.
66
69
The Dockerfile executes the shell scripts under the [ci](https://github.com/m-carrasco/net-ssa/tree/main/ci) folder. You would just need to execute them once in your system.
67
70
68
-
### Windows and MacOS
71
+
### Windows and macOS
69
72
70
73
The steps are the same as in Ubuntu. The project building and unit testing is done in the CI. Yet, the integration tests aren't configured.
71
74
Anyway, the dependencies should be the same as in Ubuntu. If you encounter any problem while trying this, please open an issue.
@@ -75,9 +78,9 @@ Anyway, the dependencies should be the same as in Ubuntu. If you encounter any p
75
78
`net-ssa` has native dependencies, which are shipped in the project already. You shouldn't need to build them. Usually, this is only required for development. The supported systems are:
76
79
* Linux - x86-64
77
80
* Windows - x86-64
78
-
*MacOS - x86-64 and arm64
81
+
*macOS - x86-64 and arm64
79
82
80
-
In case they must be re-built, [`./net-ssa/souffle/build-all-with-docker.sh`](https://github.com/m-carrasco/net-ssa/blob/main/souffle/build-all-with-docker.sh) is available. The script compiles these dependencies from scratch using the source code in your repository. Under the hood, the script isolates this process using Docker. This only builds the Linux and Windows dependencies. Cross-compilation for MacOS is incredible difficult. If you are a MacOS user, check the CI to figure out the required dependencies and execute `build-souffle-macos-x86-64-arm64.sh`.
83
+
In case they must be re-built, [`./net-ssa/souffle/build-all-with-docker.sh`](https://github.com/m-carrasco/net-ssa/blob/main/souffle/build-all-with-docker.sh) is available. The script compiles these dependencies from scratch using the source code in your repository. Under the hood, the script isolates this process using Docker. This only builds the Linux and Windows dependencies. Cross-compilation for macOS is incredible difficult. If you are a macOS user, check the CI to figure out the required dependencies and execute `build-souffle-macos-x86-64-arm64.sh`.
0 commit comments