codegen does signed, unsigned, and floating point math

This commit is contained in:
Andrew Kelley
2015-12-08 12:25:30 -07:00
parent 3e06ed0e8c
commit 2f0e4e9cb2
4 changed files with 106 additions and 15 deletions

View File

@@ -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 {