[LLVM-C] Add Accessors for Discarding Value Names in the IR

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

llvm-svn: 350196
diff --git a/llvm/lib/IR/Core.cpp b/llvm/lib/IR/Core.cpp
index a306573..77d93dd 100644
--- a/llvm/lib/IR/Core.cpp
+++ b/llvm/lib/IR/Core.cpp
@@ -108,6 +108,14 @@
   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);
 }