diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-08-05 21:21:37 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-08-20 08:33:52 -0700 |
| commit | 7f91e7740dfbf020e2538d95e21851a32a3454a6 (patch) | |
| tree | 2f92d18adfbedc90fae93d6423c7d6e5d21b9e7d /src/rustllvm/RustWrapper.cpp | |
| parent | d1e48152551548fbb2a4a0b6a21756342d5dd2a9 (diff) | |
| download | rust-7f91e7740dfbf020e2538d95e21851a32a3454a6.tar.gz rust-7f91e7740dfbf020e2538d95e21851a32a3454a6.zip | |
Fix LLVM compilation issues and use the new attrs
This implements #[no_split_stack] and also changes #[fast_ffi] to using the new "fixedstacksegment" string attribute instead of integer attribute.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
| -rw-r--r-- | src/rustllvm/RustWrapper.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 04c062072d6..632edd85611 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -43,7 +43,7 @@ extern "C" void LLVMRustAddPrintModulePass(LLVMPassManagerRef PMR, const char* path) { PassManager *PM = unwrap<PassManager>(PMR); std::string ErrorInfo; - raw_fd_ostream OS(path, ErrorInfo, raw_fd_ostream::F_Binary); + raw_fd_ostream OS(path, ErrorInfo, sys::fs::F_Binary); formatted_raw_ostream FOS(OS); PM->add(createPrintModulePass(&FOS)); PM->run(*unwrap(M)); @@ -412,7 +412,7 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR, bool NoVerify = false; std::string ErrorInfo; raw_fd_ostream OS(path, ErrorInfo, - raw_fd_ostream::F_Binary); + sys::fs::F_Binary); if (ErrorInfo != "") { LLVMRustError = ErrorInfo.c_str(); return false; @@ -481,6 +481,10 @@ extern "C" LLVMTypeRef LLVMMetadataTypeInContext(LLVMContextRef C) { return wrap(Type::getMetadataTy(*unwrap(C))); } +extern "C" void LLVMAddFunctionAttrString(LLVMValueRef fn, const char *Name) { + unwrap<Function>(fn)->addFnAttr(Name); +} + extern "C" LLVMValueRef LLVMBuildAtomicLoad(LLVMBuilderRef B, LLVMValueRef source, const char* Name, @@ -624,7 +628,7 @@ extern "C" LLVMValueRef LLVMDIBuilderCreateFunction( return wrap(Builder->createFunction( unwrapDI<DIScope>(Scope), Name, LinkageName, unwrapDI<DIFile>(File), LineNo, - unwrapDI<DIType>(Ty), isLocalToUnit, isDefinition, ScopeLine, + unwrapDI<DICompositeType>(Ty), isLocalToUnit, isDefinition, ScopeLine, Flags, isOptimized, unwrap<Function>(Fn), unwrapDI<MDNode*>(TParam), |
