Teşekkürler, kesinlikle çok işime yarayacak!
Hemen denedim de sanki DMD'nin look-up table olayını kullanmıyor:
Alıntı:
>.LC0:
.string "bir"
.LC1:
.string "iki"
movl %fs:int example.i@tpoff, %eax
cmpl $1, %eax
je .L3
cmpl $2, %eax
jne .L6
movq $3, %fs:immutable(char)[] example.s@tpoff
movq $.LC1, %fs:immutable(char)[] example.s@tpoff+8
.L6:
xorl %eax, %eax
ret
.L3:
movq $3, %fs:immutable(char)[] example.s@tpoff
xorl %eax, %eax
movq $.LC0, %fs:immutable(char)[] example.s@tpoff+8
ret
void example.__modinit():
movq _Dmodule_ref(%rip), %rax
movq $__mod_ref.1590, _Dmodule_ref(%rip)
movq %rax, __mod_ref.1590(%rip)
ret
immutable(char)[] example.s:
int example.i:
__mod_ref.1590:
.quad 0
.quad _D7example12__ModuleInfoZ
Kodu şu:
// Type your code here, or load an example.
int i=1;
string s;
void main() {
switch(i) {
case 0: break;
case 1: s = "bir"; break;
case 2: s = "iki"; break;
default:
}
}
--
[ Bu gönderi, http://ddili.org/forum'dan dönüştürülmüştür. ]