Changeset 1650:40bd4a0d4870 for gen/llvmhelpers.cpp
- Timestamp:
- 05/19/10 06:42:32 (2 years ago)
- Files:
-
- gen/llvmhelpers.cpp (modified) (18 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gen/llvmhelpers.cpp
r1643 r1650 161 161 gIR->CreateCallOrInvoke(fn, args.begin(), args.end()); 162 162 163 #ifndef DISABLE_DEBUG_INFO 163 164 // end debug info 164 165 if (global.params.symdebug) 165 166 DtoDwarfFuncEnd(gIR->func()->decl); 167 #endif 166 168 167 169 // after assert is always unreachable … … 269 271 // labels are a special case: they are not required to enclose the current scope 270 272 // for them we use the enclosing scope handler as a reference point 271 LabelStatement* lblstmt = dynamic_cast<LabelStatement*>(target);273 LabelStatement* lblstmt = target ? target->isLabelStatement() : 0; 272 274 if (lblstmt) 273 275 target = lblstmt->enclosingScopeExit; … … 486 488 487 489 // unknown 488 llvm::cout << "unsupported: null value for " << type->toChars() << '\n';490 error("unsupported: null value for %s", type->toChars()); 489 491 assert(0); 490 492 return 0; … … 855 857 gvar->setInitializer(initVal); 856 858 859 #ifndef DISABLE_DEBUG_INFO 857 860 // do debug info 858 861 if (global.params.symdebug) … … 862 865 gIR->usedArray.push_back(llvm::ConstantExpr::getBitCast(gv, getVoidPtrType())); 863 866 } 867 #endif 864 868 } 865 869 } … … 907 911 assert(ex && "ref vars must have expression initializer"); 908 912 assert(ex->exp); 909 AssignExp* as = dynamic_cast<AssignExp*>(ex->exp);913 AssignExp* as = ex->exp->isAssignExp(); 910 914 assert(as && "ref vars must be initialized by an assign exp"); 911 915 vd->ir.irLocal->value = as->e2->toElem(gIR)->getLVal(); 912 916 } 913 917 914 918 // referenced by nested delegate? 915 919 #if DMDV2 … … 920 924 Logger::println("has nestedref set"); 921 925 assert(vd->ir.irLocal); 922 926 923 927 DtoNestedInit(vd); 924 928 } … … 938 942 vd->ir.irLocal->value = allocainst; 939 943 944 #ifndef DISABLE_DEBUG_INFO 940 945 if (global.params.symdebug) 941 {942 946 DtoDwarfLocalVariable(allocainst, vd); 943 }947 #endif 944 948 } 945 949 else … … 1047 1051 // we don't handle aliases either 1048 1052 assert(!var->aliassym); 1049 1053 1050 1054 // alloca if necessary 1051 1055 LLValue* allocaval = NULL; … … 1053 1057 { 1054 1058 addr = DtoAlloca(var->type, var->toChars()); 1055 1059 1060 #ifndef DISABLE_DEBUG_INFO 1056 1061 // add debug info 1057 1062 if (global.params.symdebug) 1058 1063 DtoDwarfLocalVariable(addr, var); 1059 } 1060 1064 #endif 1065 } 1066 1061 1067 // referenced by nested function? 1062 1068 #if DMDV2 … … 1295 1301 Logger::println("template declaration: %s", td->toChars()); 1296 1302 Logger::println("intrinsic name: %s", td->intrinsicName.c_str()); 1297 1303 1298 1304 // for now use the size in bits of the first template param in the instance 1299 1305 assert(ti->tdtypes.dim == 1); … … 1308 1314 char tmp[21]; // probably excessive, but covers a uint64_t 1309 1315 sprintf(tmp, "%lu", (unsigned long) gTargetData->getTypeSizeInBits(DtoType(T))); 1310 1316 1311 1317 // replace # in name with bitsize 1312 1318 name = td->intrinsicName; … … 1331 1337 } 1332 1338 } 1333 1339 1334 1340 Logger::println("final intrinsic name: %s", name.c_str()); 1335 1341 } … … 1341 1347 if (FuncDeclaration* fd = s->isFuncDeclaration()) 1342 1348 { 1343 // we can't (and probably shouldn't?) define functions 1349 // we can't (and probably shouldn't?) define functions 1344 1350 // that weren't semantic3'ed 1345 1351 if (fd->semanticRun < 4) … … 1353 1359 // These will get available_externally linkage, 1354 1360 // so they shouldn't end up in object code. 1355 1361 1356 1362 assert(fd->type->ty == Tfunction); 1357 1363 TypeFunction* tf = (TypeFunction*) fd->type; … … 1372 1378 return true; 1373 1379 } 1374 1380 1375 1381 // This was only semantic'ed for inlining checks. 1376 1382 // We won't be inlining this, so we only need to emit a declaration. … … 1397 1403 if (!opts::singleObj) 1398 1404 return true; 1399 1405 1400 1406 if (!tinst->emittedInModule) 1401 1407 { … … 1405 1411 return tinst->emittedInModule == gIR->dmodule; 1406 1412 } 1407 1413 1408 1414 return s->getModule() == gIR->dmodule; 1409 1415 }

