comparison gen/llvmhelpers.cpp @ 291:068cb3c60afb trunk

[svn r312] Changed assert codegen to insert an unreachable terminator after the call to the assert function, which currently calls abort(). Changed array comparison runtime support to pass the array typeinfo instead of the element typeinfo. This allows a cleaner and faster implementation.
author lindquist
date Sat, 21 Jun 2008 21:16:26 +0200
parents ebaf65fc4726
children 94435b0ab2dd
comparison
equal deleted inserted replaced
290:ebaf65fc4726 291:068cb3c60afb
96 96
97 // param attrs 97 // param attrs
98 llvm::PAListPtr palist; 98 llvm::PAListPtr palist;
99 int idx = 1; 99 int idx = 1;
100 100
101 // FIXME: every assert creates a global for the filename !!!
101 c = DtoConstString(loc->filename); 102 c = DtoConstString(loc->filename);
102 103
103 // msg param 104 // msg param
104 if (msg) 105 if (msg)
105 { 106 {
142 args.push_back(c); 143 args.push_back(c);
143 144
144 // call 145 // call
145 llvm::CallInst* call = llvm::CallInst::Create(fn, args.begin(), args.end(), "", gIR->scopebb()); 146 llvm::CallInst* call = llvm::CallInst::Create(fn, args.begin(), args.end(), "", gIR->scopebb());
146 call->setParamAttrs(palist); 147 call->setParamAttrs(palist);
148
149 // after assert is always unreachable
150 gIR->ir->CreateUnreachable();
147 } 151 }
148 152
149 /****************************************************************************************/ 153 /****************************************************************************************/
150 /*//////////////////////////////////////////////////////////////////////////////////////// 154 /*////////////////////////////////////////////////////////////////////////////////////////
151 // NESTED VARIABLE HELPERS 155 // NESTED VARIABLE HELPERS