comparison ir/irmodule.cpp @ 683:b411c41a9716

Only allocate the module file name once. Fixes #90.
author Christian Kamm <kamm incasoftware de>
date Sun, 12 Oct 2008 10:35:16 +0200
parents e3355ce5444b
children 1714836f2c0b
comparison
equal deleted inserted replaced
682:518b8cc84369 683:b411c41a9716
1 #include "gen/llvm.h" 1 #include "gen/llvm.h"
2 #include "gen/tollvm.h"
3 #include "gen/irstate.h"
2 #include "ir/irmodule.h" 4 #include "ir/irmodule.h"
3 5
4 IrModule::IrModule(Module* module) 6 IrModule::IrModule(Module* module, const char* srcfilename)
5 { 7 {
6 M = module; 8 M = module;
9
10 LLConstant* slice = DtoConstString(srcfilename);
11 fileName = new llvm::GlobalVariable(
12 slice->getType(), true, LLGlobalValue::InternalLinkage, slice, ".modulefilename", gIR->module);
13
7 dwarfCompileUnit = NULL; 14 dwarfCompileUnit = NULL;
8 } 15 }
9 16
10 IrModule::~IrModule() 17 IrModule::~IrModule()
11 { 18 {