Mercurial > projects > ldc
diff gen/toobj.cpp @ 580:7824c21a58e3
Restructure path handling a bit. Fixes #66.
author | Christian Kamm <kamm incasoftware de> |
---|---|
date | Sat, 06 Sep 2008 12:27:27 +0200 |
parents | 3c07287765bc |
children | 12bda38ea366 |
line wrap: on
line diff
--- a/gen/toobj.cpp Fri Sep 05 23:02:18 2008 +0200 +++ b/gen/toobj.cpp Sat Sep 06 12:27:27 2008 +0200 @@ -164,22 +164,10 @@ // 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 @@ // 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); }