Mercurial > projects > ldc
comparison gen/tollvm.cpp @ 144:a27941d00351 trunk
[svn r149] fixed: a bunch of D-style variadics problems.
fixed: GotoDefaultStatement implemented.
fixed: some other minor bugs.
author | lindquist |
---|---|
date | Sat, 26 Jan 2008 17:13:22 +0100 |
parents | a123dca8349b |
children | 4c577c2b7229 |
comparison
equal
deleted
inserted
replaced
143:336ec4f4bbb3 | 144:a27941d00351 |
---|---|
344 | 344 |
345 ////////////////////////////////////////////////////////////////////////////////////////// | 345 ////////////////////////////////////////////////////////////////////////////////////////// |
346 | 346 |
347 llvm::GlobalValue::LinkageTypes DtoLinkage(PROT prot, uint stc) | 347 llvm::GlobalValue::LinkageTypes DtoLinkage(PROT prot, uint stc) |
348 { | 348 { |
349 // turns out we can't really make anything internal with the way D works :( | |
350 // the things we can need much more info than this can extract. | |
351 // TODO : remove this useless function | |
349 switch(prot) | 352 switch(prot) |
350 { | 353 { |
351 case PROTprivate: | 354 case PROTprivate: |
352 if (stc & STCextern) | 355 //if (stc & STCextern) |
353 return llvm::GlobalValue::ExternalLinkage; | 356 return llvm::GlobalValue::ExternalLinkage; |
354 else | 357 //else |
355 return llvm::GlobalValue::InternalLinkage; | 358 // return llvm::GlobalValue::InternalLinkage; |
356 | 359 |
357 case PROTpublic: | 360 case PROTpublic: |
358 case PROTpackage: | 361 case PROTpackage: |
359 case PROTprotected: | 362 case PROTprotected: |
360 case PROTexport: | 363 case PROTexport: |
900 else { | 903 else { |
901 DtoArrayAssign(lhs->getLVal(), rhs->getRVal()); | 904 DtoArrayAssign(lhs->getLVal(), rhs->getRVal()); |
902 } | 905 } |
903 } | 906 } |
904 else if (t->ty == Tsarray) { | 907 else if (t->ty == Tsarray) { |
905 DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal()); | 908 if (DtoType(lhs->getType()) == DtoType(rhs->getType())) { |
909 DtoStaticArrayCopy(lhs->getLVal(), rhs->getRVal()); | |
910 } | |
911 else { | |
912 DtoArrayInit(lhs->getLVal(), rhs->getRVal()); | |
913 } | |
906 } | 914 } |
907 else if (t->ty == Tdelegate) { | 915 else if (t->ty == Tdelegate) { |
908 if (rhs->isNull()) | 916 if (rhs->isNull()) |
909 DtoNullDelegate(lhs->getLVal()); | 917 DtoNullDelegate(lhs->getLVal()); |
910 else if (!rhs->inPlace()) { | 918 else if (!rhs->inPlace()) { |