Summary: Add accessors so the performance improvement from this setting is accessible to third parties.
Reviewers: whitequark, deadalnix
Reviewed By: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D56179
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350196
91177308-0d34-0410-b5e6-
96231b3b80d8
void *OpaqueHandle);
/**
+ * Retrieve whether the given context is set to discard all value names.
+ *
+ * @see LLVMContext::shouldDiscardValueNames()
+ */
+bool LLVMContextShouldDiscardValueNames(LLVMContextRef C);
+
+/**
+ * Set whether the given context discards all value names.
+ *
+ * If true, only the names of GlobalValue objects will be available in the IR.
+ * This can be used to save memory and runtime, especially in release mode.
+ *
+ * @see LLVMContext::setDiscardValueNames()
+ */
+void LLVMContextSetDiscardValueNames(LLVMContextRef C, bool Discard);
+
+/**
* Destroy a context instance.
*
* This should be called for every call to LLVMContextCreate() or memory
unwrap(C)->setYieldCallback(YieldCallback, OpaqueHandle);
}
+bool LLVMContextShouldDiscardValueNames(LLVMContextRef C) {
+ return unwrap(C)->shouldDiscardValueNames();
+}
+
+void LLVMContextSetDiscardValueNames(LLVMContextRef C, bool Discard) {
+ unwrap(C)->setDiscardValueNames(Discard);
+}
+
void LLVMContextDispose(LLVMContextRef C) {
delete unwrap(C);
}