about summary refs log tree commit diff
path: root/src/librustc_llvm
diff options
context:
space:
mode:
authorStepan Koltsov <stepan.koltsov@gmail.com>2017-06-29 17:52:43 +0300
committerStepan Koltsov <stepan.koltsov@gmail.com>2017-07-01 03:16:43 +0300
commitb62bdaafe038b8933fac5df5fa0fa5ddbaf176b7 (patch)
tree49c307dc988def19093d3af845ca037c9458c048 /src/librustc_llvm
parent37849a002ed91ac2b80aeb2172364b4e19250e05 (diff)
downloadrust-b62bdaafe038b8933fac5df5fa0fa5ddbaf176b7.tar.gz
rust-b62bdaafe038b8933fac5df5fa0fa5ddbaf176b7.zip
When writing LLVM IR output demangled fn name in comments
`--emit=llvm-ir` looks like this now:

```
; <alloc::vec::Vec<T> as core::ops::index::IndexMut<core::ops::range::RangeFull>>::index_mut
; Function Attrs: inlinehint uwtable
define internal { i8*, i64 } @"_ZN106_$LT$alloc..vec..Vec$LT$T$GT$$u20$as$u20$core..ops..index..IndexMut$LT$core..ops..range..RangeFull$GT$$GT$9index_mut17h7f7b576609f30262E"(%"alloc::vec::Vec<u8>"* dereferenceable(24)) unnamed_addr #0 {
start:
  ...
```

cc https://github.com/integer32llc/rust-playground/issues/15
Diffstat (limited to 'src/librustc_llvm')
-rw-r--r--src/librustc_llvm/ffi.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/librustc_llvm/ffi.rs b/src/librustc_llvm/ffi.rs
index 312b5a38d6e..770d16e5c02 100644
--- a/src/librustc_llvm/ffi.rs
+++ b/src/librustc_llvm/ffi.rs
@@ -1597,7 +1597,13 @@ extern "C" {
                                    Output: *const c_char,
                                    FileType: FileType)
                                    -> LLVMRustResult;
-    pub fn LLVMRustPrintModule(PM: PassManagerRef, M: ModuleRef, Output: *const c_char);
+    pub fn LLVMRustPrintModule(PM: PassManagerRef,
+                               M: ModuleRef,
+                               Output: *const c_char,
+                               Demangle: extern fn(*const c_char,
+                                                   size_t,
+                                                   *mut c_char,
+                                                   size_t) -> size_t);
     pub fn LLVMRustSetLLVMOptions(Argc: c_int, Argv: *const *const c_char);
     pub fn LLVMRustPrintPasses();
     pub fn LLVMRustSetNormalizedTarget(M: ModuleRef, triple: *const c_char);