Mercurial > projects > ldc
comparison gen/abi.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 | dc608dc33081 |
children | 34f2fd925de3 |
comparison
equal
deleted
inserted
replaced
1349:a376776e2301 | 1350:15e9762bb620 |
---|---|
110 { | 110 { |
111 // int -> struct | 111 // int -> struct |
112 LLValue* get(Type* dty, DValue* dv) | 112 LLValue* get(Type* dty, DValue* dv) |
113 { | 113 { |
114 Logger::println("rewriting int -> struct"); | 114 Logger::println("rewriting int -> struct"); |
115 LLValue* mem = DtoAlloca(DtoType(dty), ".int_to_struct"); | 115 LLValue* mem = DtoAlloca(dty, ".int_to_struct"); |
116 LLValue* v = dv->getRVal(); | 116 LLValue* v = dv->getRVal(); |
117 DtoStore(v, DtoBitCast(mem, getPtrToType(v->getType()))); | 117 DtoStore(v, DtoBitCast(mem, getPtrToType(v->getType()))); |
118 return DtoLoad(mem); | 118 return DtoLoad(mem); |
119 } | 119 } |
120 // int -> struct (with dst lvalue given) | 120 // int -> struct (with dst lvalue given) |