]> git.lizzy.rs Git - rust.git/commit
Auto merge of #28612 - gandro:targetvendor, r=alexcrichton
authorbors <bors@rust-lang.org>
Sat, 26 Sep 2015 00:14:39 +0000 (00:14 +0000)
committerbors <bors@rust-lang.org>
Sat, 26 Sep 2015 00:14:39 +0000 (00:14 +0000)
commit78ce46ffddfed7dee58569b5f30242b00d299dfe
treeae80a901ab56af79be5338bdb61cf2bdffc6a66b
parent69f27c856b3e18e54b9a48412a918c91fe8b08e7
parentabfedb7d16fc536e85e271f945195335ca0ba9e0
Auto merge of #28612 - gandro:targetvendor, r=alexcrichton

This adds a new target property, `target_vendor`. It is to be be used as a matcher for conditional compilation. The vendor is part of the [autoconf target triple](http://llvm.org/docs/doxygen/html/classllvm_1_1Triple.html#details): `<arch><sub>-<vendor>-<os>-<env>`. `arch`, `target_os` and `target_env` are already supported by Rust.

This change was suggested in PR #28593. It enables conditional compilation based on the vendor. This is needed for the rumprun target, which needs to match against both, target_os and target_vendor.

The default value for `target_vendor` is "unknown", "apple" and "pc" are other common values.

Matching against the `target_vendor` is introduced behind the feature gate `#![feature(cfg_target_vendor)]`.

This is the first time I messed around with rustc internals. I just added the my code where I found the existing `target_*` variables, hopefully I haven't missed anything. Please review with care. :)

r? @alexcrichton
src/doc/reference.md
src/libsyntax/feature_gate.rs