rjmccall added inline comments.

================
Comment at: lib/CodeGen/CodeGenModule.cpp:4108
+      // consistent with old behavior for this target as it would fail
+      // on the cast<> instead.
+      assert(GV && "isa<CFConstantStringClassReference> isn't a GlobalValue");
----------------
compnerd wrote:
> I think that the comment isn't particularly helpful - it basically is 
> directing you to look at the history of the file.
I think we should just skip this step, even on COFF, if it's not a 
`GlobalValue`.

Probably the most correct move would be to only apply this logic if the IR 
declaration was synthesized.  Or maybe even just change this code to look for a 
global variable called `__CFConstantStringClassReference` in the first place 
and then emit a reference to it if found, and only otherwise try to build the 
synthetic variable.  But just bailing out early if something weird is going on 
is also a legitimate step.


Repository:
  rC Clang

https://reviews.llvm.org/D52344



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to