diff options
| author | bors <bors@rust-lang.org> | 2014-01-17 07:56:45 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-17 07:56:45 -0800 |
| commit | 4098327b1fe1112ddf661b587be9eeec1d80adde (patch) | |
| tree | 3d1a8d2613c1101d46657fd5de25d32403e9626b /src/rustllvm/RustWrapper.cpp | |
| parent | 1e1871f35eb83ae6a63952a145e5132deffded2c (diff) | |
| parent | b520c2f28002db0e4120797d823380914871bac4 (diff) | |
| download | rust-4098327b1fe1112ddf661b587be9eeec1d80adde.tar.gz rust-4098327b1fe1112ddf661b587be9eeec1d80adde.zip | |
auto merge of #11585 : nikomatsakis/rust/issue-3511-rvalue-lifetimes, r=pcwalton
Major changes: - Define temporary scopes in a syntax-based way that basically defaults to the innermost statement or conditional block, except for in a `let` initializer, where we default to the innermost block. Rules are documented in the code, but not in the manual (yet). See new test run-pass/cleanup-value-scopes.rs for examples. - Refactors Datum to better define cleanup roles. - Refactor cleanup scopes to not be tied to basic blocks, permitting us to have a very large number of scopes (one per AST node). - Introduce nascent documentation in trans/doc.rs covering datums and cleanup in a more comprehensive way. r? @pcwalton
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
| -rw-r--r-- | src/rustllvm/RustWrapper.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 1fb05b89381..280df8cb10f 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -522,6 +522,17 @@ extern "C" char *LLVMTypeToString(LLVMTypeRef Type) { return strdup(os.str().data()); } +extern "C" char *LLVMValueToString(LLVMValueRef Value) { + std::string s; + llvm::raw_string_ostream os(s); + os << "("; + unwrap<llvm::Value>(Value)->getType()->print(os); + os << ":"; + unwrap<llvm::Value>(Value)->print(os); + os << ")"; + return strdup(os.str().data()); +} + extern "C" bool LLVMRustLinkInExternalBitcode(LLVMModuleRef dst, char *bc, size_t len) { Module *Dst = unwrap(dst); |
