LDC with MSP430

Nicholas Wilson via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Jun 20 03:52:14 PDT 2017


On Tuesday, 20 June 2017 at 08:59:05 UTC, Luís Marques wrote:
> On Tuesday, 20 June 2017 at 06:52:05 UTC, Nicholas Wilson wrote:
>> What data layout is being used? Can you get clang to 
>> `-emit-llvm` and look at the resulting file 2nd line?
>>
>> should look like target datalayout = "..." .Please post the ...
>
> I was going to say that I hadn't built clang, only LLVM, but 
> that you could find that info in the target:
>
> LLVMTargetMachine(T, "e-m:e-p:16:16-i32:16:32-a:16-n8:16", TT, 
> CPU, FS,
>                         Options, getEffectiveRelocModel(RM), 
> CM, OL),
>
> ...but I want to help and I was not 100% sure that was what you 
> wanted, so I went the extra mile ;)
>
> target datalayout = "e-m:e-p:16:16-i32:16:32-a:16-n8:16"
>
>>  also please also compile with `-vv` and post the last section 
>> of diagnostics printed (warning it spits out a lot), the 
>> length of the backtrace should suffice.
>
> This is the full output for an empty .d file:
> [...]

Hmm it strikes me as odd that it handles char[] fine but not 
byte[].

Might want to confirm the types and sizes involved by adding:

Logger::cout() << "getMemberSize: D type " << type->toChars() << 
" ("<< dSize<<" bytes)" <<" LL type " << *llType <<"(" << 
llSize<< " bytes)\n";

(I hope I have that right to just copy & paste) between the call 
to

gDataLayout->getTypeAllocSize(llType);

and the assert on line 1348 of llvmhelpers.cpp





More information about the digitalmars-d-ldc mailing list