[PATCH] D17946: Add a flag to the LLVMContext to disable name for Value other than GlobalValue

Chandler Carruth via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 9 11:25:47 PST 2016


chandlerc accepted this revision.
chandlerc added a comment.
This revision is now accepted and ready to land.

LGTM with the nits below fixed and with whatever name we finally settle on. (We can also tweak the name later if needed). But sync up with Justin before you land it to be sure he's OK.


================
Comment at: include/llvm/IR/LLVMContext.h:114
@@ -106,1 +113,3 @@
+  /// especially in release mode.
+  void setDiscardValueNames(bool Preserve);
 
----------------
The parameter name seems... confusing. ;] Probably want this to be "Discard" now.

================
Comment at: lib/IR/LLVMContextImpl.h:1037-1039
@@ -1036,1 +1036,5 @@
 
+  /// Flag to indicate if Value (other than GlobalValue) retains their name or
+  /// not.
+  bool PreserveNames = true;
+
----------------
I would make this consistent with the interface (DiscardValueNames).

================
Comment at: lib/LTO/LTOCodeGenerator.cpp:76-77
@@ -75,1 +75,4 @@
 
+static cl::opt<bool> DiscardNamedValues(
+    "discard-named-values",
+    cl::desc("Strip names from Value (other than GlobalValue)."),
----------------
I would probably name the flags to exactly match the context: '-discard-value-names' (or whatever that ends up being).


http://reviews.llvm.org/D17946





More information about the llvm-commits mailing list