Mercurial > projects > ldc
comparison gen/llvmhelpers.cpp @ 632:df196c8dea26
Updated to latest LLVM trunk, function notes have been removed and merged with parameter attributes, which have been renamed to just attributes. Nothing seems to have broke!
author | Tomas Lindquist Olsen <tomas.l.olsen@gmail.com> |
---|---|
date | Wed, 01 Oct 2008 23:17:14 +0200 |
parents | 26fce59fe80a |
children | 8aebdf56c455 |
comparison
equal
deleted
inserted
replaced
629:607b6b5819a7 | 632:df196c8dea26 |
---|---|
115 // func | 115 // func |
116 const char* fname = msg ? "_d_assert_msg" : "_d_assert"; | 116 const char* fname = msg ? "_d_assert_msg" : "_d_assert"; |
117 llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, fname); | 117 llvm::Function* fn = LLVM_D_GetRuntimeFunction(gIR->module, fname); |
118 | 118 |
119 // param attrs | 119 // param attrs |
120 llvm::PAListPtr palist; | 120 llvm::AttrListPtr palist; |
121 int idx = 1; | 121 int idx = 1; |
122 | 122 |
123 // FIXME: every assert creates a global for the filename !!! | 123 // FIXME: every assert creates a global for the filename !!! |
124 c = DtoConstString(loc->filename); | 124 c = DtoConstString(loc->filename); |
125 | 125 |
139 } | 139 } |
140 else | 140 else |
141 { | 141 { |
142 args.push_back(msg->getRVal()); | 142 args.push_back(msg->getRVal()); |
143 } | 143 } |
144 palist = palist.addAttr(idx++, llvm::ParamAttr::ByVal); | 144 palist = palist.addAttr(idx++, llvm::Attribute::ByVal); |
145 } | 145 } |
146 | 146 |
147 // file param | 147 // file param |
148 llvm::AllocaInst* alloc = gIR->func()->srcfileArg; | 148 llvm::AllocaInst* alloc = gIR->func()->srcfileArg; |
149 if (!alloc) | 149 if (!alloc) |
155 DtoStore(c->getOperand(0), ptr); | 155 DtoStore(c->getOperand(0), ptr); |
156 ptr = DtoGEPi(alloc, 0,1, "tmp"); | 156 ptr = DtoGEPi(alloc, 0,1, "tmp"); |
157 DtoStore(c->getOperand(1), ptr); | 157 DtoStore(c->getOperand(1), ptr); |
158 | 158 |
159 args.push_back(alloc); | 159 args.push_back(alloc); |
160 palist = palist.addAttr(idx++, llvm::ParamAttr::ByVal); | 160 palist = palist.addAttr(idx++, llvm::Attribute::ByVal); |
161 | 161 |
162 | 162 |
163 // line param | 163 // line param |
164 c = DtoConstUint(loc->linnum); | 164 c = DtoConstUint(loc->linnum); |
165 args.push_back(c); | 165 args.push_back(c); |
166 | 166 |
167 // call | 167 // call |
168 CallOrInvoke* call = gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); | 168 CallOrInvoke* call = gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); |
169 call->setParamAttrs(palist); | 169 call->setAttributes(palist); |
170 | 170 |
171 // after assert is always unreachable | 171 // after assert is always unreachable |
172 gIR->ir->CreateUnreachable(); | 172 gIR->ir->CreateUnreachable(); |
173 } | 173 } |
174 | 174 |