Mercurial > projects > ldc
comparison gen/aa.cpp @ 1350:15e9762bb620
Adds explicit alignment information for alloca instructions in general, there's a few cases that still needs to be looked at but this should catch the majority. Fixes ticket #293 .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail com> |
---|---|
date | Thu, 14 May 2009 13:26:40 +0200 |
parents | 0686701178d3 |
children | f5f8c21ce6ef |
comparison
equal
deleted
inserted
replaced
1349:a376776e2301 | 1350:15e9762bb620 |
---|---|
31 else if (key->isConst()) { | 31 else if (key->isConst()) { |
32 needmem = true; | 32 needmem = true; |
33 pkey = key->getRVal(); | 33 pkey = key->getRVal(); |
34 } | 34 } |
35 else { | 35 else { |
36 LLValue* tmp = DtoAlloca(DtoType(keytype), "aatmpkeystorage"); | 36 LLValue* tmp = DtoAlloca(keytype, "aatmpkeystorage"); |
37 DVarValue var(keytype, tmp); | 37 DVarValue var(keytype, tmp); |
38 DtoAssign(loc, &var, key); | 38 DtoAssign(loc, &var, key); |
39 return tmp; | 39 return tmp; |
40 } | 40 } |
41 | 41 |
42 // give memory | 42 // give memory |
43 if (needmem) { | 43 if (needmem) { |
44 LLValue* tmp = DtoAlloca(DtoType(keytype), "aatmpkeystorage"); | 44 LLValue* tmp = DtoAlloca(keytype, "aatmpkeystorage"); |
45 DtoStore(pkey, tmp); | 45 DtoStore(pkey, tmp); |
46 pkey = tmp; | 46 pkey = tmp; |
47 } | 47 } |
48 | 48 |
49 return pkey; | 49 return pkey; |