Only allocate the module file name once. Fixes #90.

This commit is contained in:
Christian Kamm
2008-10-12 10:35:16 +02:00
parent 40f724234d
commit 6cb213badf
7 changed files with 29 additions and 57 deletions

View File

@@ -1,9 +1,16 @@
#include "gen/llvm.h"
#include "gen/tollvm.h"
#include "gen/irstate.h"
#include "ir/irmodule.h"
IrModule::IrModule(Module* module)
IrModule::IrModule(Module* module, const char* srcfilename)
{
M = module;
LLConstant* slice = DtoConstString(srcfilename);
fileName = new llvm::GlobalVariable(
slice->getType(), true, LLGlobalValue::InternalLinkage, slice, ".modulefilename", gIR->module);
dwarfCompileUnit = NULL;
}