[PATCH] D60527: [LLVM-C] Add accessors to the default floating-point metadata node

Robert Widmann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 06:11:31 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL358883: [LLVM-C] Add accessors to the default floating-point metadata node (authored by CodaFi, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D60527?vs=194558&id=196060#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60527/new/

https://reviews.llvm.org/D60527

Files:
  llvm/trunk/include/llvm-c/Core.h
  llvm/trunk/lib/IR/Core.cpp


Index: llvm/trunk/include/llvm-c/Core.h
===================================================================
--- llvm/trunk/include/llvm-c/Core.h
+++ llvm/trunk/include/llvm-c/Core.h
@@ -3535,7 +3535,24 @@
  * @see llvm::IRBuilder::SetInstDebugLocation()
  */
 void LLVMSetInstDebugLocation(LLVMBuilderRef Builder, LLVMValueRef Inst);
-  
+
+/**
+ * Get the dafult floating-point math metadata for a given builder.
+ *
+ * @see llvm::IRBuilder::getDefaultFPMathTag()
+ */
+LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder);
+
+/**
+ * Set the default floating-point math metadata for the given builder.
+ *
+ * To clear the metadata, pass NULL to \p FPMathTag.
+ *
+ * @see llvm::IRBuilder::setDefaultFPMathTag()
+ */
+void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder,
+                                    LLVMMetadataRef FPMathTag);
+
 /**
  * Deprecated: Passing the NULL location will crash.
  * Use LLVMGetCurrentDebugLocation2 instead.
Index: llvm/trunk/lib/IR/Core.cpp
===================================================================
--- llvm/trunk/lib/IR/Core.cpp
+++ llvm/trunk/lib/IR/Core.cpp
@@ -3033,6 +3033,18 @@
   unwrap(Builder)->SetInstDebugLocation(unwrap<Instruction>(Inst));
 }
 
+void LLVMBuilderSetDefaultFPMathTag(LLVMBuilderRef Builder,
+                                    LLVMMetadataRef FPMathTag) {
+
+  unwrap(Builder)->setDefaultFPMathTag(FPMathTag
+                                       ? unwrap<MDNode>(FPMathTag)
+                                       : nullptr);
+}
+
+LLVMMetadataRef LLVMBuilderGetDefaultFPMathTag(LLVMBuilderRef Builder) {
+  return wrap(unwrap(Builder)->getDefaultFPMathTag());
+}
+
 /*--.. Instruction builders ................................................--*/
 
 LLVMValueRef LLVMBuildRetVoid(LLVMBuilderRef B) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60527.196060.patch
Type: text/x-patch
Size: 1806 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190422/3d0f853a/attachment.bin>


More information about the llvm-commits mailing list