comparison gen/llvmhelpers.cpp @ 1271:0686701178d3

Moved special casing of 'assert(this, "null this");' generated statements from !ThisExp into !AssertExp. Fixed filenames for array bounds errors and probably others, fixes #271 .
author Tomas Lindquist Olsen <tomas.l.olsen gmail com>
date Mon, 27 Apr 2009 13:30:48 +0200
parents 9014d7f0433f
children 8fb39f7f1a7c
comparison
equal deleted inserted replaced
1270:dd135ff697fa 1271:0686701178d3
126 } 126 }
127 127
128 // file param 128 // file param
129 129
130 // we might be generating for an imported template function 130 // we might be generating for an imported template function
131 if (!M->ir.irModule) 131 IrModule* irmod = getIrModule(M);
132 M->ir.irModule = new IrModule(M, M->srcfile->toChars()); 132
133 133 args.push_back(DtoLoad(irmod->fileName));
134 args.push_back(DtoLoad(M->ir.irModule->fileName));
135 134
136 // line param 135 // line param
137 LLConstant* c = DtoConstUint(loc.linnum); 136 LLConstant* c = DtoConstUint(loc.linnum);
138 args.push_back(c); 137 args.push_back(c);
139 138
1397 } 1396 }
1398 1397
1399 ts->unaligned = 1; 1398 ts->unaligned = 1;
1400 return false; 1399 return false;
1401 } 1400 }
1401
1402 //////////////////////////////////////////////////////////////////////////////////////////
1403
1404 IrModule * getIrModule(Module * M)
1405 {
1406 if (M == NULL)
1407 M = gIR->func()->decl->getModule();
1408 assert(M && "null module");
1409 if (!M->ir.irModule)
1410 M->ir.irModule = new IrModule(M, M->srcfile->toChars());
1411 return M->ir.irModule;
1412 }
1413
1414 //////////////////////////////////////////////////////////////////////////////////////////