Quuxplusone added a subscriber: Quuxplusone.

================
Comment at: test/CodeGen/no-devirt.cpp:16
@@ +15,3 @@
+   if (a > 6) return data[a] ;      // Should not devirtualize
+   if (a > 4) return data.func1(a); // Should devirtualize
+   return data.func2(a);            // Should devirtualize
----------------
This is a really dumb question from the peanut gallery, but, could you explain 
why these two cases (lines 15 and 16) should differ?  It really seems like both 
calls should be able to be devirtualized, because the compiler statically knows 
what they should call.

I think you mention the difference between lines 15 and 16 here:

> except, for some reason, when it is an operator and used with an operator 
> syntax

but you don't explain *why* the difference is desirable. Shouldn't we just fix 
that difference, then?

Is your first fix (

> The first fix will be in the front end to force the instantiation on virtual 
> calls that are potentially devirtualizable.

) basically "fix the difference between lines 15 and 16", or is it talking 
about something else entirely?


https://reviews.llvm.org/D22057



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

Reply via email to