[svn r233] Added: -oq command line option for writing fully qualified object names.

Added: started support for x86 80bit floating point.
Changed: aggregates passed by value now use the llvm 'byval' parameter attribute, also lays ground work for
using other attributes.
Changed: eliminated a lot more std::vectorS, these showed up pretty much at the top when profiling!
Changed: performed other misc. cleanups.
Changed: halt expression now call the new llvm trap intrinsic instead of an assert(0).
Changed: dstress suite now passes -O0 by default, this only eliminates unreferenced globals, which speeds up
linking quite a bit.
This commit is contained in:
Tomas Lindquist Olsen
2008-06-05 06:38:36 +02:00
parent 1a41b9ef12
commit d03c3a7757
23 changed files with 299 additions and 187 deletions

View File

@@ -16,6 +16,7 @@
#include "llvm/Bitcode/ReaderWriter.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetMachineRegistry.h"
#include "llvm/System/Path.h"
#include "mars.h"
#include "module.h"
@@ -151,17 +152,36 @@ void Module::genobjfile()
// run optimizer
llvmdc_optimize_module(ir.module, global.params.optimizeLevel, global.params.llvmInline);
// 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(md->toChars());
bcpath.appendSuffix("bc");
llpath = LLPath(md->toChars());
llpath.appendSuffix("ll");
}
else
{
bcpath = LLPath(bcfile->name->toChars());
llpath = LLPath(llfile->name->toChars());
}
// write bytecode
{
Logger::println("Writing LLVM bitcode\n");
std::ofstream bos(bcfile->name->toChars(), std::ios::binary);
std::ofstream bos(bcpath.c_str(), std::ios::binary);
llvm::WriteBitcodeToFile(ir.module, bos);
}
// disassemble ?
if (global.params.disassemble) {
Logger::println("Writing LLVM asm to: %s\n", llfile->name->toChars());
std::ofstream aos(llfile->name->toChars());
std::ofstream aos(llpath.c_str());
ir.module->print(aos);
}