Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-03 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33982. nmusgrave marked 2 inline comments as done. nmusgrave added a comment. - Clean method headers, style. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h test/CodeGenCXX/sanitize-d

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-03 Thread Richard Smith via cfe-commits
rsmith accepted this revision. rsmith added a comment. This revision is now accepted and ready to land. LGTM with a couple of tweaks. Comment at: lib/CodeGen/CGCXX.cpp:45-46 @@ +44,4 @@ + // an alias, unless this class owns no members. + unsigned totalFields = + std::dis

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-03 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33978. nmusgrave marked 4 inline comments as done. nmusgrave added a comment. - Simplified fields and checks for aliasing. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h test/CodeGen

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-03 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:140-147 @@ -131,1 +139,10 @@ + // If sanitizing memory to check for use-after-dtor, do not emit as + // an alias, unless this class owns no members with trivial destructors. + const CXXMethodDecl *MD = + ca

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-03 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33959. nmusgrave added a comment. - Refined testing for bit fields. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h test/CodeGenCXX/sanitize-dtor-bit-field.cpp test/CodeGenCXX/sanit

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-03 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33956. nmusgrave marked 4 inline comments as done. nmusgrave added a comment. - Testing sanitizing bit fields. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h test/CodeGenCXX/sanitize

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-02 Thread Richard Smith via cfe-commits
rsmith added a comment. I'd like to see some tests for poisoning bitfields, and particularly anonymous bitfields (I think the code works fine in those cases, but they're a bit special so explicitly testing them is useful). Comment at: lib/CodeGen/CGCXX.cpp:151 @@ +150,3 @@ +

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-02 Thread Evgeniy Stepanov via cfe-commits
eugenis added a comment. LGTM but please wait for Richard's answer Comment at: lib/CodeGen/CGClass.cpp:1551 @@ +1550,3 @@ + // Prevent the current stack frame from disappearing from the stack trace. + CGF.CurFn->addFnAttr("disable-tail-calls", "true"); + -

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-02 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33887. nmusgrave marked 4 inline comments as done. nmusgrave added a comment. - Update comments, consistent style for attribute checking. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-02 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:45 @@ +44,3 @@ + // destructors. + if (getCodeGenOpts().SanitizeMemoryUseAfterDtor) +return true; This simply suppresses all dtor alias under UseAfterDtor, effectively disabling the second che

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-01 Thread Naomi Musgrave via cfe-commits
nmusgrave added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:42-44 @@ -33,1 +41,5 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) { + // If sanitizing memory to check for use-after-dtor, do not emit as + // an alias, unless it has no fields

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-01 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33752. nmusgrave marked 13 inline comments as done. nmusgrave added a comment. - Simplified implementation of class field poisoning, to avoid redundant counting and conditional checks. Expensive checks delayed. http://reviews.llvm.org/D12022 Files: lib

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-01 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:42-44 @@ -33,1 +41,5 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) { + // If sanitizing memory to check for use-after-dtor, do not emit as + // an alias, unless it has no fields o

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-09-01 Thread Richard Smith via cfe-commits
rsmith added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:42-44 @@ -33,1 +41,5 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) { + // If sanitizing memory to check for use-after-dtor, do not emit as + // an alias, unless it has no fields or

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-28 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33463. nmusgrave marked an inline comment as done. nmusgrave added a comment. - Alias-repressing test case ignores casting of pointers. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-28 Thread Naomi Musgrave via cfe-commits
nmusgrave added inline comments. Comment at: test/CodeGenCXX/sanitize-dtor-repress-aliasing.cpp:30 @@ +29,2 @@ +// Definition of virtual function table +// CHECK: @_ZTV7Derived = {{.*}}(void (%struct.Derived*)* @_ZN7DerivedD1Ev to i8*){{.*}}(void (%struct.Derived*)* @_ZN7DerivedD

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-28 Thread Naomi Musgrave via cfe-commits
nmusgrave marked 3 inline comments as done. nmusgrave added a comment. http://reviews.llvm.org/D12022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-28 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33436. nmusgrave added a comment. - Checking for existence of fields to poison in alias emission. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h test/CodeGenCXX/sanitize-dtor-nontriv

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-26 Thread Evgeniy Stepanov via cfe-commits
eugenis added a comment. Richard, would you mind taking a look a this change? http://reviews.llvm.org/D12022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-25 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33115. nmusgrave added a comment. - Simplify parameters, rename function, for examining fields of class to destroy. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h test/CodeGenCXX/sa

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-25 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:31 @@ -30,1 +30,3 @@ +static bool HasTrivialField(CodeGenModule &CGM, const CXXDestructorDecl *D) { + for (const auto *Field : D->getParent()->fields()) I think this should be called "HasFieldWith

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-25 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33100. nmusgrave marked an inline comment as done. nmusgrave added a comment. - Check flags before dtor sanitizing http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h test/CodeGenCXX/sani

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-24 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 33037. nmusgrave marked 4 inline comments as done. nmusgrave added a comment. - Simplify function invocations http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h test/CodeGenCXX/sanitize-

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-24 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:44 @@ +43,3 @@ + // destructors. + const ASTRecordLayout &Layout = Context.getASTRecordLayout(D->getParent()); + This is unused. Comment at: lib/CodeGen/CGCXX.cpp:47 @@ +46,3 @@ +

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-24 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 32986. nmusgrave added a comment. - Refactored for simpler trivial field checking http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp lib/CodeGen/CodeGenModule.h test/CodeGenCXX/sanitize-dtor-nontrivial-virtual-base

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-23 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 32930. nmusgrave added a comment. - Refactoring dtor sanitizing emission order - support for virtual functions & virtual bases WIP - Repress dtor aliasing when sanitizing in dtor - CFE test for dtor aliasing, and repression of aliasing in dtor code generati

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-21 Thread Naomi Musgrave via cfe-commits
nmusgrave added inline comments. Comment at: lib/CodeGen/CGClass.cpp:1578 @@ +1577,3 @@ +if (CGF.CGM.FieldHasTrivialDestructorBody(Context, Field) || +Field->getType()->isPointerType()) { + // Start sanitizing at this field eugenis wro

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-21 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGClass.cpp:1578 @@ +1577,3 @@ +if (CGF.CGM.FieldHasTrivialDestructorBody(Context, Field) || +Field->getType()->isPointerType()) { + // Start sanitizing at this field Why do you ne

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-21 Thread Naomi Musgrave via cfe-commits
nmusgrave added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:41 @@ +40,3 @@ + if (getCodeGenOpts().SanitizeMemoryUseAfterDtor && Layout.getFieldCount() > 0 + && HasTrivialDestructorBody(Context, D->getParent(), D->getParent())) { +return true;

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-21 Thread Naomi Musgrave via cfe-commits
nmusgrave added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:41 @@ +40,3 @@ + if (getCodeGenOpts().SanitizeMemoryUseAfterDtor && Layout.getFieldCount() > 0 + && HasTrivialDestructorBody(Context, D->getParent(), D->getParent())) { +return true;

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-21 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGCXX.cpp:41 @@ +40,3 @@ + if (getCodeGenOpts().SanitizeMemoryUseAfterDtor && Layout.getFieldCount() > 0 + && HasTrivialDestructorBody(Context, D->getParent(), D->getParent())) { +return true; I'

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-21 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 32873. nmusgrave marked 2 inline comments as done. nmusgrave added a comment. - Poisoning on field-by-field basis, with collective poisoning of trivial members when possible. - Cleaned up implementation of calculating region to poison in dtor. http://revi

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-19 Thread Evgeniy Stepanov via cfe-commits
eugenis added a comment. The test for virtual base that you added effectively disables the aliasing test, because Derived now has non-trivial members. Move it to a separate file. Comment at: test/CodeGenCXX/sanitize-dtor-repress-aliasing.cpp:38 @@ +37,3 @@ +// Declaration of vi

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-19 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 32608. nmusgrave added a comment. - More complex testing for destruction order. Tests class with base, virtual base, trivial, and nontrivial member to ensure destruction order is correct. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp li

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-19 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 32600. nmusgrave added a comment. - CFE test for dtor aliasing, and repression of aliasing in dtor code generation. http://reviews.llvm.org/D12022 Files: lib/CodeGen/CGCXX.cpp lib/CodeGen/CGClass.cpp test/CodeGenCXX/sanitize-dtor-repress-aliasing.c

Re: [PATCH] D12022: Refactored dtor sanitizing into EHScopeStack

2015-08-19 Thread Evgeniy Stepanov via cfe-commits
eugenis added a comment. +cfe-commits http://reviews.llvm.org/D12022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits