Mercurial > projects > ldc
comparison gen/llvmhelpers.cpp @ 936:2ebac4750adb
Removed some dead code.
Fixed assertion filenames for imported template instances. Fixes #152 .
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 04 Feb 2009 02:10:23 +0100 |
parents | b56f3571c450 |
children | 39519a1ff603 |
comparison
equal
deleted
inserted
replaced
935:acd745fbdb66 | 936:2ebac4750adb |
---|---|
107 /****************************************************************************************/ | 107 /****************************************************************************************/ |
108 /*//////////////////////////////////////////////////////////////////////////////////////// | 108 /*//////////////////////////////////////////////////////////////////////////////////////// |
109 // ASSERT HELPER | 109 // ASSERT HELPER |
110 ////////////////////////////////////////////////////////////////////////////////////////*/ | 110 ////////////////////////////////////////////////////////////////////////////////////////*/ |
111 | 111 |
112 void DtoAssert(Loc* loc, DValue* msg) | 112 void DtoAssert(Module* M, Loc* loc, DValue* msg) |
113 { | 113 { |
114 std::vector<LLValue*> args; | 114 std::vector<LLValue*> args; |
115 | 115 |
116 // func | 116 // func |
117 const char* fname = msg ? "_d_assert_msg" : "_d_assert"; | 117 const char* fname = msg ? "_d_assert_msg" : "_d_assert"; |
122 { | 122 { |
123 args.push_back(msg->getRVal()); | 123 args.push_back(msg->getRVal()); |
124 } | 124 } |
125 | 125 |
126 // file param | 126 // file param |
127 args.push_back(DtoLoad(gIR->dmodule->ir.irModule->fileName)); | 127 |
128 // we might be generating for an imported template function | |
129 if (!M->ir.irModule) | |
130 M->ir.irModule = new IrModule(M, M->srcfile->toChars()); | |
131 | |
132 args.push_back(DtoLoad(M->ir.irModule->fileName)); | |
128 | 133 |
129 // line param | 134 // line param |
130 LLConstant* c = DtoConstUint(loc->linnum); | 135 LLConstant* c = DtoConstUint(loc->linnum); |
131 args.push_back(c); | 136 args.push_back(c); |
132 | 137 |