aboutsummaryrefslogtreecommitdiff
path: root/src/zig_llvm.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2015-12-08 12:25:30 -0700
committerAndrew Kelley <superjoe30@gmail.com>2015-12-08 12:25:30 -0700
commit2f0e4e9cb26df7a6f6251d0e865d0d964680831e (patch)
tree24716849a69bdc49d82e87a599f58d2b4e6c50f3 /src/zig_llvm.cpp
parent3e06ed0e8cdfba69e28600a2fcf52d795a86f3bb (diff)
downloadzig-2f0e4e9cb26df7a6f6251d0e865d0d964680831e.tar.gz
zig-2f0e4e9cb26df7a6f6251d0e865d0d964680831e.zip
codegen does signed, unsigned, and floating point math
Diffstat (limited to 'src/zig_llvm.cpp')
-rw-r--r--src/zig_llvm.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/zig_llvm.cpp b/src/zig_llvm.cpp
index 43dd68b6b0..4cbb19360d 100644
--- a/src/zig_llvm.cpp
+++ b/src/zig_llvm.cpp
@@ -185,6 +185,10 @@ unsigned LLVMZigEncoding_DW_ATE_signed(void) {
return dwarf::DW_ATE_signed;
}
+unsigned LLVMZigEncoding_DW_ATE_float(void) {
+ return dwarf::DW_ATE_float;
+}
+
unsigned LLVMZigLang_DW_LANG_C99(void) {
return dwarf::DW_LANG_C99;
}
@@ -322,6 +326,16 @@ LLVMZigDILocation *LLVMZigGetDebugLoc(unsigned line, unsigned col, LLVMZigDIScop
return reinterpret_cast<LLVMZigDILocation*>(debug_loc.get());
}
+void LLVMZigSetFastMath(LLVMBuilderRef builder_wrapped, bool on_state) {
+ if (on_state) {
+ FastMathFlags fmf;
+ fmf.setUnsafeAlgebra();
+ unwrap(builder_wrapped)->SetFastMathFlags(fmf);
+ } else {
+ unwrap(builder_wrapped)->clearFastMathFlags();
+ }
+}
+
//------------------------------------
enum FloatAbi {