kosarev added inline comments.

================
Comment at: lib/CodeGen/CGClass.cpp:2426
   llvm::StoreInst *Store = Builder.CreateStore(VTableAddressPoint, 
VTableField);
-  CGM.DecorateInstructionWithTBAA(Store, CGM.getTBAAVTablePtrAccessInfo());
+  TBAAAccessInfo TBAAInfo = CGM.getTBAAVTablePtrAccessInfo(VTablePtrTy);
+  CGM.DecorateInstructionWithTBAA(Store, TBAAInfo);
----------------
Now that type and access descriptors include information about sizes, the 
function needs to know the type of the virtual table pointer to access.


================
Comment at: lib/CodeGen/CodeGenModule.cpp:139
       (!CodeGenOpts.RelaxedAliasing && CodeGenOpts.OptimizationLevel > 0))
-    TBAA.reset(new CodeGenTBAA(Context, VMContext, CodeGenOpts, getLangOpts(),
+    TBAA.reset(new CodeGenTBAA(Context, TheModule, CodeGenOpts, getLangOpts(),
                                getCXXABI().getMangleContext()));
----------------
To clarify why we pass the module instead of LLVM context: we need it to 
compute the size of virtual table pointers as their types are llvm::Type types 
and not clang::Type or QualType ones.


================
Comment at: lib/CodeGen/CodeGenModule.cpp:585
+  if (AccessType->isIncompleteType())
+    return TBAAAccessInfo::getIncompleteInfo();
+
----------------
getAccessTagInfo() will raise an assertion failure if such an access descriptor 
is passed to it. This way we explicitly claim that generating access tags for 
incomplete objects is not allowed.


Repository:
  rL LLVM

https://reviews.llvm.org/D40176



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

Reply via email to