[C API] PR19859: Add LLVMGetFCmpPredicate and LLVMConstRealGetDouble.
[oota-llvm.git] / include / llvm-c / Core.h
index 4f9da09a6d874338db2c3cd4defdfc8098f88501..485cf9481f2f9b2b0c2d07450594d9fdf364cfc9 100644 (file)
@@ -1548,6 +1548,14 @@ unsigned long long LLVMConstIntGetZExtValue(LLVMValueRef ConstantVal);
  */
 long long LLVMConstIntGetSExtValue(LLVMValueRef ConstantVal);
 
+/**
+ * Obtain the double value for an floating point constant value.
+ * losesInfo indicates if some precision was lost in the conversion.
+ *
+ * @see llvm::ConstantFP::getDoubleValue
+ */
+double LLVMConstRealGetDouble(LLVMValueRef ConstantVal, LLVMBool *losesInfo);
+
 /**
  * @}
  */
@@ -2408,6 +2416,16 @@ LLVMOpcode   LLVMGetInstructionOpcode(LLVMValueRef Inst);
  */
 LLVMIntPredicate LLVMGetICmpPredicate(LLVMValueRef Inst);
 
+/**
+ * Obtain the float predicate of an instruction.
+ *
+ * This is only valid for instructions that correspond to llvm::FCmpInst
+ * or llvm::ConstantExpr whose opcode is llvm::Instruction::FCmp.
+ *
+ * @see llvm::FCmpInst::getPredicate()
+ */
+LLVMRealPredicate LLVMGetFCmpPredicate(LLVMValueRef Inst);
+
 /**
  * Create a copy of 'this' instruction that is identical in all ways
  * except the following: