Mercurial > projects > ldc
comparison gen/passes/GarbageCollect2Stack.cpp @ 1553:f55ca8a1598c
Value::getNameStart and Value::getNameLength were removed
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Thu, 23 Jul 2009 20:34:35 +0200 |
parents | ed0feda76820 |
children | d6e8d5db259f |
comparison
equal
deleted
inserted
replaced
1552:08c8ef491c97 | 1553:f55ca8a1598c |
---|---|
201 GlobalVariable* ClassInfo = dyn_cast<GlobalVariable>(arg); | 201 GlobalVariable* ClassInfo = dyn_cast<GlobalVariable>(arg); |
202 if (!ClassInfo) | 202 if (!ClassInfo) |
203 return false; | 203 return false; |
204 | 204 |
205 std::string metaname = CD_PREFIX; | 205 std::string metaname = CD_PREFIX; |
206 metaname.append(ClassInfo->getNameStart(), ClassInfo->getNameEnd()); | 206 metaname += ClassInfo->getName(); |
207 | 207 |
208 GlobalVariable* global = A.M.getGlobalVariable(metaname); | 208 GlobalVariable* global = A.M.getGlobalVariable(metaname); |
209 if (!global || !global->hasInitializer()) | 209 if (!global || !global->hasInitializer()) |
210 return false; | 210 return false; |
211 | 211 |
346 if (Callee == 0 || !Callee->isDeclaration() || | 346 if (Callee == 0 || !Callee->isDeclaration() || |
347 !(Callee->hasExternalLinkage() || Callee->hasDLLImportLinkage())) | 347 !(Callee->hasExternalLinkage() || Callee->hasDLLImportLinkage())) |
348 continue; | 348 continue; |
349 | 349 |
350 // Ignore unknown calls. | 350 // Ignore unknown calls. |
351 const char *CalleeName = Callee->getNameStart(); | |
352 StringMap<FunctionInfo*>::iterator OMI = | 351 StringMap<FunctionInfo*>::iterator OMI = |
353 KnownFunctions.find(CalleeName, CalleeName+Callee->getNameLen()); | 352 KnownFunctions.find(Callee->getName()); |
354 if (OMI == KnownFunctions.end()) continue; | 353 if (OMI == KnownFunctions.end()) continue; |
355 | 354 |
356 assert(isa<PointerType>(Inst->getType()) | 355 assert(isa<PointerType>(Inst->getType()) |
357 && "GC function doesn't return a pointer?"); | 356 && "GC function doesn't return a pointer?"); |
358 | 357 |
395 GlobalVariable* ti_global = dyn_cast<GlobalVariable>(typeinfo->stripPointerCasts()); | 394 GlobalVariable* ti_global = dyn_cast<GlobalVariable>(typeinfo->stripPointerCasts()); |
396 if (!ti_global) | 395 if (!ti_global) |
397 return NULL; | 396 return NULL; |
398 | 397 |
399 std::string metaname = TD_PREFIX; | 398 std::string metaname = TD_PREFIX; |
400 metaname.append(ti_global->getNameStart(), ti_global->getNameEnd()); | 399 metaname += ti_global->getName(); |
401 | 400 |
402 GlobalVariable* global = M.getGlobalVariable(metaname); | 401 GlobalVariable* global = M.getGlobalVariable(metaname); |
403 if (!global || !global->hasInitializer()) | 402 if (!global || !global->hasInitializer()) |
404 return NULL; | 403 return NULL; |
405 | 404 |