[PATCH] D12312: Emiting invariant.group.barrier and adding -fstrict-vptrs

Piotr Padlewski via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 27 14:52:58 PDT 2015


Prazek added inline comments.

================
Comment at: lib/CodeGen/CGClass.cpp:1279
@@ +1278,3 @@
+  if (CGM.getCodeGenOpts().StrictVPtrs && BaseVPtrsInitialized)
+    CXXThisValue = Builder.CreateInvariantGroupBarrier(LoadCXXThis());
+
----------------
rjmccall wrote:
> Should this just be in InitializeVTablePointers?
I want to add invariant.group.barrier only if it's needed. F.e. I don't want to put before I initialize vptrs for base, or when my class doesn't inherit frome anything. I want emit barrier after I will initialize some other vptrs.

InitializeVptrs is called in EmitBaseInitializer, and also I woudnt want to put some extra flag if it must produce barrier or not (because it is hard to distinguish it from inside)


http://reviews.llvm.org/D12312





More information about the cfe-commits mailing list