diff options
| author | Graydon Hoare <[email protected]> | 2011-02-28 16:36:08 -0800 |
|---|---|---|
| committer | Graydon Hoare <[email protected]> | 2011-02-28 16:36:14 -0800 |
| commit | 1291cc2df90c36eee8642048e1bf1b69a690781f (patch) | |
| tree | bfa8087261a509a81cce8edaebcee4afd170a01f /src/comp/lib | |
| parent | rustc: Write tag variant discriminants into the crate as integer constants (diff) | |
| download | rust-1291cc2df90c36eee8642048e1bf1b69a690781f.tar.xz rust-1291cc2df90c36eee8642048e1bf1b69a690781f.zip | |
Groundwork for structural comparison. Still lacking the actual loop that does it.
Diffstat (limited to 'src/comp/lib')
| -rw-r--r-- | src/comp/lib/llvm.rs | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/comp/lib/llvm.rs b/src/comp/lib/llvm.rs index 751507d6..f75bdbe1 100644 --- a/src/comp/lib/llvm.rs +++ b/src/comp/lib/llvm.rs @@ -76,6 +76,25 @@ const uint LLVMIntSLT = 40u; const uint LLVMIntSLE = 41u; +// Consts for the LLVM RealPredicate type, pre-case to uint. +// FIXME: as above. + +const uint LLVMRealOEQ = 1u; +const uint LLVMRealOGT = 2u; +const uint LLVMRealOGE = 3u; +const uint LLVMRealOLT = 4u; +const uint LLVMRealOLE = 5u; +const uint LLVMRealONE = 6u; + +const uint LLVMRealORD = 7u; +const uint LLVMRealUNO = 8u; +const uint LLVMRealUEQ = 9u; +const uint LLVMRealUGT = 10u; +const uint LLVMRealUGE = 11u; +const uint LLVMRealULT = 12u; +const uint LLVMRealULE = 13u; +const uint LLVMRealUNE = 14u; + native mod llvm = llvm_lib { type ModuleRef; @@ -657,7 +676,7 @@ native mod llvm = llvm_lib { fn LLVMBuildICmp(BuilderRef B, uint Op, ValueRef LHS, ValueRef RHS, sbuf Name) -> ValueRef; - fn LLVMBuildFCmp(BuilderRef B, RealPredicate Op, + fn LLVMBuildFCmp(BuilderRef B, uint Op, ValueRef LHS, ValueRef RHS, sbuf Name) -> ValueRef; @@ -1034,7 +1053,7 @@ obj builder(BuilderRef B) { ret llvm.LLVMBuildICmp(B, Op, LHS, RHS, _str.buf("")); } - fn FCmp(RealPredicate Op, ValueRef LHS, ValueRef RHS) -> ValueRef { + fn FCmp(uint Op, ValueRef LHS, ValueRef RHS) -> ValueRef { ret llvm.LLVMBuildFCmp(B, Op, LHS, RHS, _str.buf("")); } |