This makes an existing optimization apply in more cases.
Details
Details
- Reviewers
- None
Diff Detail
Diff Detail
Event Timeline
lib/CodeGen/CGClass.cpp | ||
---|---|---|
1369–1382 | This is not complete; you'll also need to at least consider atomic stores (that might store the this pointer and be picked up by another thread), the implicit call to operator new in a CXXNewExpr (which is not modeled as a CallExpr), implicit destructor calls (which aren't modeled in the AST at all), and probably a lot of other cases. Maybe it would be simpler to store undef to the vptr immediately before calling the base class destructor, and let the LLVM optimization passes remove this vptr store as dead if it can prove the vptr is unused? |
Comment Actions
Thanks for the review and advice; I'll give undef a try. It's a much simpler approach.
This is not complete; you'll also need to at least consider atomic stores (that might store the this pointer and be picked up by another thread), the implicit call to operator new in a CXXNewExpr (which is not modeled as a CallExpr), implicit destructor calls (which aren't modeled in the AST at all), and probably a lot of other cases.
Maybe it would be simpler to store undef to the vptr immediately before calling the base class destructor, and let the LLVM optimization passes remove this vptr store as dead if it can prove the vptr is unused?