Add a function to return the pointer type for a given triple.

Also use a slightly tidier naming convention for such functions.
This commit is contained in:
Dan Gohman
2018-12-06 10:50:12 -05:00
parent 38d1d58e06
commit 566c160c37
3 changed files with 13 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ pub enum CallConv {
impl CallConv {
/// Return the default calling convention for the given target triple.
pub fn default_for_triple(triple: &Triple) -> Self {
pub fn triple_default(triple: &Triple) -> Self {
match triple.default_calling_convention() {
// Default to System V for unknown targets because most everything
// uses System V.

View File

@@ -208,7 +208,7 @@ pub trait TargetIsa: fmt::Display + Sync {
/// Get the default calling convention of this target.
fn default_call_conv(&self) -> CallConv {
CallConv::default_for_triple(self.triple())
CallConv::triple_default(self.triple())
}
/// Get the pointer type of this ISA.