|Posted by Ferhat Kurtulmuş|
in reply to Jelena
Posted in reply to Jelena
On Monday, 22 May 2023 at 07:35:21 UTC, Jelena wrote:
I am tasked to translate this code: https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.html into D language.
However, I have a problem with part 3.2. where the following appears:
static std::unique_ptr<LLVMContext> TheContext;
static std::unique_ptr<IRBuilder<>> Builder(TheContext);
static std::unique_ptr<Module> TheModule;
static std::map<std::string, Value *> NamedValues;
I am interested in how it is even possible to import things like: LLVMContex, IRBuilder and similar.
Disclaimer: I am not involved in any compiler development stuff.
If I understand, you are trying to do what LDC does, but not in C++ (as LLVM backend of d, LDC, is written in C++), in d instead. Then, you need an LLVM binding to d. Here there is one. If this is not the case, please ignore my message.