zaskar9 / oberon-lang

An LLVM frontend for the Oberon programming language
MIT License
19 stars 2 forks source link

Output file argument not working #17

Closed tenko closed 7 months ago

tenko commented 7 months ago

I added/replaced the following lines to src\codegen\llvm\LLVMCodeGen.cpp from line 254:

std::string name = config_.getOutputFile(); if (name == "") { name = path.replace_extension(ext).string(); }

This seems to fix the issue.

zaskar9 commented 7 months ago

I think I never fully introduced that option. At some point, I want to make the command-line interface of oberon-lang as close to clang and gcc (but not msvc 😎) as possible. As part of this change, I'm planning to retire the --filetype option and achieve the same by supporting the following options.

Option -o will override the default name of the output file and, additionally, --emit-llvm will write a *.bc file in compile mode and a *.ll file in assembly mode.

Thus far the plan. Apart from introducing some of these options, I never implemented this functionality as the compiler currently does not support the full pipeline (including linking). Your fix seems fine for the time being!

tenko commented 7 months ago

Change implemented in pull request #19