From 7f91e7740dfbf020e2538d95e21851a32a3454a6 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 5 Aug 2013 21:21:37 -0700 Subject: 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. --- src/rustllvm/RustWrapper.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/rustllvm/RustWrapper.cpp') 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(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(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(Scope), Name, LinkageName, unwrapDI(File), LineNo, - unwrapDI(Ty), isLocalToUnit, isDefinition, ScopeLine, + unwrapDI(Ty), isLocalToUnit, isDefinition, ScopeLine, Flags, isOptimized, unwrap(Fn), unwrapDI(TParam), -- cgit 1.4.1-3-g733a5