about summary refs log tree commit diff
path: root/src/librustc_codegen_llvm/llvm
diff options
context:
space:
mode:
authorDenis Merigoux <denis.merigoux@gmail.com>2018-08-21 17:39:43 +0200
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2018-11-16 14:11:09 +0200
commit1bcb4df16678a71b484ea9d1b65911f22b381d86 (patch)
tree370b780f16b7594c571022d6f6efb4f27f12ab28 /src/librustc_codegen_llvm/llvm
parentbc86624c43a24ed569a08aaeae3bdea7be181bf7 (diff)
downloadrust-1bcb4df16678a71b484ea9d1b65911f22b381d86.tar.gz
rust-1bcb4df16678a71b484ea9d1b65911f22b381d86.zip
Generalized OperandBundleDef in BuilderMethods
Diffstat (limited to 'src/librustc_codegen_llvm/llvm')
-rw-r--r--src/librustc_codegen_llvm/llvm/mod.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/librustc_codegen_llvm/llvm/mod.rs b/src/librustc_codegen_llvm/llvm/mod.rs
index fbd5192a63f..3b5f0b0f7df 100644
--- a/src/librustc_codegen_llvm/llvm/mod.rs
+++ b/src/librustc_codegen_llvm/llvm/mod.rs
@@ -28,6 +28,7 @@ use std::ffi::CStr;
 use std::cell::RefCell;
 use libc::{self, c_uint, c_char, size_t};
 use rustc_data_structures::small_c_str::SmallCStr;
+use traits;
 
 pub mod archive_ro;
 pub mod diagnostic;
@@ -271,6 +272,10 @@ impl OperandBundleDef<'a> {
         };
         OperandBundleDef { raw: def }
     }
+
+    pub fn from_generic(bundle : &traits::OperandBundleDef<'a, &'a Value>) -> Self {
+        Self::new(bundle.name, &[bundle.val])
+    }
 }
 
 impl Drop for OperandBundleDef<'a> {