Start writing actual compillation code in compiler series
This commit is contained in:
@@ -55,6 +55,7 @@ a `Module` object, which represents some collection of code and declarations
|
||||
{{< codeblock "C++" "compiler/08/llvm_context.hpp" >}}
|
||||
|
||||
{{< todo >}} Consistently name context / state.{{< /todo >}}
|
||||
{{< todo >}} Explain creation functions. {{< /todo >}}
|
||||
|
||||
We include the LLVM context, builder, and module as members
|
||||
of the context struct. Since the builder and the module need
|
||||
@@ -97,6 +98,8 @@ which you can extrapolate the rest:
|
||||
|
||||
{{< codelines "C++" "compiler/08/llvm_context.cpp" 7 11 >}}
|
||||
|
||||
{{< todo >}} Also show struct body setters. {{< /todo >}}
|
||||
|
||||
Similarly, here are a few lines from `create_functions()`, which
|
||||
give a very good idea of the rest of that method:
|
||||
|
||||
@@ -180,5 +183,7 @@ methods.
|
||||
With these things in mind, here's the signature for `gen_llvm`:
|
||||
|
||||
```C++
|
||||
virtual void gen_llvm(const llvm_context&, llvm::Function*) const;
|
||||
virtual void gen_llvm(llvm_context&, llvm::Function*) const;
|
||||
```
|
||||
|
||||
{{< todo >}} Fix pointer type inconsistencies. {{< /todo >}}
|
||||
|
||||
Reference in New Issue
Block a user