[PATCH] CodeGen: Emit constant array temporaries into read-only globals.

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Tue Mar 3 10:26:01 PST 2015


This looks like a really nice improvement!


================
Comment at: lib/CodeGen/CGExpr.cpp:313
@@ +312,3 @@
+        assert(Inner->isConstantInitializer(CGF.getContext(), false));
+        auto *GV = new llvm::GlobalVariable(
+            CGF.CGM.getModule(), Init->getType(), /*isConstant=*/true,
----------------
If this function is in a COMDAT, this GV should be in it too.

http://reviews.llvm.org/D8034

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list