about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-08-20 11:31:59 -0700
committerbors <bors@rust-lang.org>2013-08-20 11:31:59 -0700
commita8c3fe45c6138cd1f4d143fdb0e843ee2d4759b2 (patch)
tree73c09899e53768afb90d337c870e4f63bb06ff2a /src/rustllvm/RustWrapper.cpp
parent67c954e365970e4c2cd06f0c50724656d7010f45 (diff)
parent7f91e7740dfbf020e2538d95e21851a32a3454a6 (diff)
downloadrust-a8c3fe45c6138cd1f4d143fdb0e843ee2d4759b2.tar.gz
rust-a8c3fe45c6138cd1f4d143fdb0e843ee2d4759b2.zip
auto merge of #8328 : alexcrichton/rust/llvm-head, r=brson
The first commit message is pretty good, but whomever reviews this should probably also at least glance at the changes I made in LLVM. I basically reorganized our pending patch queue to be a bit more organized and clearer in what needs to go where. After this, our queue would be:

* Add the `no-split-stack` attribute
* Add the `fixedstacksegment` attribute
* Add split-stacks for arm android
* Add split-stacks for arm linux
* Add split stacks for mips

Then there's a patch which I added to get rust to build at all on LLVM-head, and I'm not quite sure why it's there, but nothing seems to be crashing for now! (famous last words).

Otherwise, I just updated code to reflect the changes I made in LLVM with the only major change being the advent of the new `no_split_stack` attribute. This is work towards #1226, but someone more familiar with the code should probably actually assign the attribute to the appropriate functions.

Also as a bonus, I've verified that this closes #5774
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
-rw-r--r--src/rustllvm/RustWrapper.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp
index 61ea0d549b3..1a4b7f32329 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));
@@ -413,7 +413,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;
@@ -482,6 +482,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,
@@ -625,7 +629,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),