]> git.lizzy.rs Git - rust.git/commit
Auto merge of #54993 - TimNN:pda-tdl, r=eddyb
authorbors <bors@rust-lang.org>
Sun, 11 Nov 2018 03:44:16 +0000 (03:44 +0000)
committerbors <bors@rust-lang.org>
Sun, 11 Nov 2018 03:44:16 +0000 (03:44 +0000)
commit9b8f9029762da90a88c8ca6f8ff7690177ec696a
tree56bdc1e737f0b9e7c471a20d1a571506d663aa71
parent6408162ea13446852cb45d9e781e64ba85ec7bb1
parent50a2d47b4f57f8f9433b18692fe2d1975f9e84e1
Auto merge of #54993 - TimNN:pda-tdl, r=eddyb

Support for the program data address space option of LLVM's Target Datalayout

This was introduced recently (specifically, for AVR, cc @dylanmckay).

(I came up with this when attempting to run [avr-rust](https://github.com/avr-rust/rust) rebased on the latest [rust-lang](https://github.com/rust-lang/rust) commits. If this requires a different design, some additional discussions, or is not something to pursue right now, I'd be happy to close this PR).

Note that this somewhat overlaps with @DiamondLovesYou's #51576, I think, although the implementation here is significantly simpler: Since the address space applies to _all_ program data, we can just check the pointee's type whenever we create an LLVM pointer type. If it is a function we use the program data address space; if not we use the default address space.

cc @eddyb, who has been reviewing #51576

Ref: https://llvm.org/docs/LangRef.html#data-layout
src/librustc_codegen_llvm/abi.rs