[PATCH] Fix asserts about emitting constexpr methods twice during dllexport explicit instantiation (PR21718)

David Majnemer david.majnemer at gmail.com
Fri Jan 9 16:23:30 PST 2015


LGTM with nits.


================
Comment at: lib/CodeGen/CodeGenModule.cpp:1105-1108
@@ -1104,2 +1104,6 @@
 
-    assert(GV == GetGlobalValue(getMangledName(D)));
+    if (GV)
+      assert(GV == GetGlobalValue(getMangledName(D)));
+    else
+      GV = GetGlobalValue(getMangledName(D));
+
----------------
Maybe:
  assert(!GV || GV == GetGlobalValue(getMangledName(D)));
  if (!GV)
    GV = GetGlobalValue(getMangledName(D));

================
Comment at: lib/CodeGen/CodeGenModule.cpp:1389
@@ +1388,3 @@
+    assert(!MayBeEmittedEagerly(Global));
+    addDeferredDeclToEmit(nullptr, GD);
+  } else {
----------------
You may want to make this a little more clear:
  addDeferredDeclToEmit(/*GV=*/nullptr, GD);

http://reviews.llvm.org/D6674

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






More information about the cfe-commits mailing list