[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 01:33:07 PST 2016


chandlerc added inline comments.

================
Comment at: lib/AsmParser/LLParser.cpp:51
@@ +50,3 @@
+        Lex.getLoc(),
+        "Can read textual IR with a Context that doesn't support named Values");
+
----------------
FWIW, latest version of patch still has "Can read ..." here. =]

================
Comment at: lib/LTO/LTOCodeGenerator.cpp:79-81
@@ -78,2 +78,5 @@
       TheLinker(new Linker(*MergedModule)) {
+#ifdef NDEBUG
+  Context.setPreserveNonGlobalValueNames(false);
+#endif
   initializeLTOPasses();
----------------
It'd be nice to make this be flag-controlled as well instead of NDEBUG controlled. Is that not possible?

================
Comment at: tools/llc/llc.cpp:107
@@ +106,3 @@
+static cl::opt<bool> DisableNamedValue(
+    "disable-named-value",
+    cl::desc("Strip name from Value (other than GlobalValue)."),
----------------
"disable-named-values" maybe?

================
Comment at: tools/llc/llc.cpp:213
@@ -207,1 +212,3 @@
 
+  // Honor "-disable-named-value" command line option
+  Context.setPreserveNonGlobalValueNames(!DisableNamedValue);
----------------
No need for the comment, the code seems quite clear.

================
Comment at: tools/opt/opt.cpp:200
@@ +199,3 @@
+static cl::opt<bool> DisableNamedValue(
+    "disable-named-value",
+    cl::desc("Strip name from Value (other than GlobalValue)."),
----------------
Same here.


http://reviews.llvm.org/D17946





More information about the llvm-commits mailing list