mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-02-26 08:33:14 +01:00
[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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user