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

2016-02-03 Thread Evgeniy Stepanov via cfe-commits
eugenis closed this revision. eugenis added a comment. http://llvm.org/viewvc/llvm-project?rev=259716=rev Repository: rL LLVM http://reviews.llvm.org/D16823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2016-02-03 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGClass.cpp:2608 @@ -2607,3 +2607,3 @@ auto TypeId = CGM.CreateCfiIdForTypeMetadata(MD); if (CGM.getCodeGenOpts().SanitizeCfiCrossDso && TypeId) { EmitCfiSlowPathCheck(M, BitSetTest, TypeId, CastedVTable,

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

2016-02-03 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 46807. Repository: rL LLVM http://reviews.llvm.org/D16823 Files: lib/CodeGen/CGClass.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h test/CodeGen/cfi-check-fail.c test/CodeGenCXX/cfi-cast.cpp

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

2016-02-03 Thread Alexey Samsonov via cfe-commits
samsonov accepted this revision. samsonov added a reviewer: samsonov. samsonov added a comment. This revision is now accepted and ready to land. LGTM Comment at: lib/CodeGen/CGClass.cpp:2608 @@ -2607,3 +2607,3 @@ auto TypeId = CGM.CreateCfiIdForTypeMetadata(MD); if

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

2016-02-02 Thread Evgeniy Stepanov via cfe-commits
eugenis created this revision. eugenis added reviewers: pcc, kcc. eugenis added a subscriber: cfe-commits. eugenis set the repository for this revision to rL LLVM. Avoid crashing when printing diagnostics for vtable-related CFI errors. In diagnostic mode, the frontend does an additional check of

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

2016-02-02 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:2494 @@ +2493,3 @@ + llvm::Value *ValidVtable = nullptr; + if (CheckAndAppendValidVtable) { +llvm::Value *AllVtables = llvm::MetadataAsValue::get( samsonov wrote: > This is really ugly. Why

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

2016-02-02 Thread Alexey Samsonov via cfe-commits
samsonov added a subscriber: samsonov. Comment at: lib/CodeGen/CGExpr.cpp:2494 @@ +2493,3 @@ + llvm::Value *ValidVtable = nullptr; + if (CheckAndAppendValidVtable) { +llvm::Value *AllVtables = llvm::MetadataAsValue::get( This is really ugly. Why are you not

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

2016-02-02 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:2494 @@ +2493,3 @@ + llvm::Value *ValidVtable = nullptr; + if (CheckAndAppendValidVtable) { +llvm::Value *AllVtables = llvm::MetadataAsValue::get( pcc wrote: > eugenis wrote: > > samsonov

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

2016-02-02 Thread Peter Collingbourne via cfe-commits
pcc added inline comments. Comment at: lib/CodeGen/CGExpr.cpp:2494 @@ +2493,3 @@ + llvm::Value *ValidVtable = nullptr; + if (CheckAndAppendValidVtable) { +llvm::Value *AllVtables = llvm::MetadataAsValue::get( eugenis wrote: > samsonov wrote: > > This is

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

2016-02-02 Thread Alexey Samsonov via cfe-commits
samsonov 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),

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

2016-02-02 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 46718. eugenis added a comment. Moved bitset.text call outside. LLVM is smart enough to sink it along the cold branch, so performance should not suffer. Repository: rL LLVM http://reviews.llvm.org/D16823 Files: lib/CodeGen/CGClass.cpp

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

2016-02-02 Thread Evgeniy Stepanov via cfe-commits
eugenis updated this revision to Diff 46723. eugenis marked an inline comment as done. Repository: rL LLVM http://reviews.llvm.org/D16823 Files: lib/CodeGen/CGClass.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h test/CodeGen/cfi-check-fail.c

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

2016-02-02 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:4053 @@ +4052,3 @@ + + if (!CodeGenOpts.SanitizeTrap.has(SanitizerKind::CFIVCall) || + !CodeGenOpts.SanitizeTrap.has(SanitizerKind::CFINVCall) || I don't like emitting all these bitset

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

2016-02-02 Thread Evgeniy Stepanov via cfe-commits
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),