about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@pobox.com>2011-06-08 11:41:01 -0700
committerGraydon Hoare <graydon@pobox.com>2011-06-08 11:41:01 -0700
commitf54f2799c33729f124332d69deb7205237a0f018 (patch)
treeff921362c2dbce84d64a00951e141db51e34f691 /src/comp
parent08dcb9306b46bc38c0f4bbb8049da2a93c13082a (diff)
parent698022d351e552b51cd9cca878bdc0de3de05b8c (diff)
Merge pull request #403 from espindola/newllvm
Update rust to build with newer llvm versions.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/back/link.rs1
-rw-r--r--src/comp/lib/llvm.rs2
-rw-r--r--src/comp/middle/trans.rs6
3 files changed, 7 insertions, 2 deletions
diff --git a/src/comp/back/link.rs b/src/comp/back/link.rs
index 6469bbd3ced..b637b7e41b8 100644
--- a/src/comp/back/link.rs
+++ b/src/comp/back/link.rs
@@ -153,7 +153,6 @@ mod write {
                                               True,  // unit-at-a-time
                                               True,  // unroll loops
                                               True,  // simplify lib calls
-                                              True,  // have exceptions
                                               threshold); // inline threshold
         }
 
diff --git a/src/comp/lib/llvm.rs b/src/comp/lib/llvm.rs
index 0de35b9f006..505e07e3f3f 100644
--- a/src/comp/lib/llvm.rs
+++ b/src/comp/lib/llvm.rs
@@ -88,6 +88,7 @@ const uint LLVMNoImplicitFloatAttribute = 8388608u;
 const uint LLVMNakedAttribute = 16777216u;
 const uint LLVMInlineHintAttribute = 33554432u;
 const uint LLVMStackAttribute = 469762048u;     // 7 << 26
+const uint LLVMUWTableAttribute = 1073741824u; // 1 << 30
 
 
 // Consts for the LLVM IntPredicate type, pre-cast to uint.
@@ -813,7 +814,6 @@ native mod llvm = llvm_lib {
                                    Bool UnitAtATime,
                                    Bool UnrollLoops,
                                    Bool SimplifyLibCalls,
-                                   Bool HaveExceptions,
                                    uint InliningThreshold);
 
     /** Destroys a memory buffer. */
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 3780d2c86fb..f08d450e81d 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -1820,6 +1820,11 @@ fn set_no_inline(ValueRef f) {
                               lib::llvm::llvm::Attribute);
 }
 
+fn set_uwtable(ValueRef f) {
+    llvm::LLVMAddFunctionAttr(f, lib::llvm::LLVMUWTableAttribute as
+                              lib::llvm::llvm::Attribute);
+}
+
 fn set_always_inline(ValueRef f) {
     llvm::LLVMAddFunctionAttr(f, lib::llvm::LLVMAlwaysInlineAttribute as
                               lib::llvm::llvm::Attribute);
@@ -6962,6 +6967,7 @@ fn trans_fn(@local_ctxt cx, &span sp, &ast::_fn f, ast::def_id fid,
             option::t[ty_self_pair] ty_self,
             &vec[ast::ty_param] ty_params, &ast::ann ann) {
     auto llfndecl = cx.ccx.item_ids.get(fid);
+    set_uwtable(llfndecl);
 
     // Set up arguments to the function.
     auto fcx = new_fn_ctxt(cx, sp, llfndecl);