[PATCH] D16823: [cfi] Safe handling of unaddressable vtable pointers (clang).

Evgeniy Stepanov via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 2 18:03:20 PST 2016


eugenis added inline comments.

================
Comment at: lib/CodeGen/CGExpr.cpp:2642
@@ +2641,3 @@
+      llvm::MDString::get(CGM.getLLVMContext(), "all-vtables"));
+  llvm::Value *ValidVtable = Builder.CreateZExt(
+      Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::bitset_test),
----------------
samsonov wrote:
> This is almost the same as EmitVTablePtrCheck, but with ZExt? Is the difference intentional/important? Is it possible to extract this logic (getting "all-vtables" metadata and running bitset test) to a function?
Not important. Zext makes the test a bit simpler.
Extracting these two lines to a function is surely possible, but is it worth it?



Repository:
  rL LLVM

http://reviews.llvm.org/D16823





More information about the cfe-commits mailing list