Restructure path handling a bit. Fixes #66.

This commit is contained in:
Christian Kamm
2008-09-06 12:27:27 +02:00
parent 2f2987371f
commit d44f21687e
5 changed files with 67 additions and 143 deletions

View File

@@ -164,22 +164,10 @@ void Module::genobjfile(int multiobj)
// eventually do our own path stuff, dmd's is a bit strange.
typedef llvm::sys::Path LLPath;
LLPath bcpath;
LLPath llpath;
if (global.params.fqnPaths)
{
bcpath = LLPath(mname);
bcpath.appendSuffix("bc");
llpath = LLPath(mname);
llpath.appendSuffix("ll");
}
else
{
bcpath = LLPath(bcfile->name->toChars());
llpath = LLPath(llfile->name->toChars());
}
LLPath bcpath = LLPath(objfile->name->toChars());
LLPath llpath = bcpath;
llpath.eraseSuffix();
llpath.appendSuffix(std::string(global.ll_ext));
// write bytecode
{
@@ -190,7 +178,7 @@ void Module::genobjfile(int multiobj)
// disassemble ?
if (global.params.disassemble) {
Logger::println("Writing LLVM asm to: %s\n", llfile->name->toChars());
Logger::println("Writing LLVM asm to: %s\n", llpath.c_str());
std::ofstream aos(llpath.c_str());
ir.module->print(aos, NULL);
}