]> granicus.if.org Git - clang/commit
[CodeGen] Devirtualize calls to methods marked final in a derived class
authorVedant Kumar <vsk@apple.com>
Thu, 20 Oct 2016 18:44:14 +0000 (18:44 +0000)
committerVedant Kumar <vsk@apple.com>
Thu, 20 Oct 2016 18:44:14 +0000 (18:44 +0000)
commit149b77526e93b1ebe3cead46e3e459923660b750
tree9ab13a126d00439397e9275bc36914f57c02567c
parente02feb3964e30644b8e3156807ac431fe244c9c7
[CodeGen] Devirtualize calls to methods marked final in a derived class

If we see a virtual method call to Base::foo() but can infer that the
object is an instance of Derived, and that 'foo' is marked 'final' in
Derived, we can devirtualize the call to Derived::foo().

Differential Revision: https://reviews.llvm.org/D25813

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@284766 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/devirtualize-virtual-function-calls-final.cpp
test/CodeGenCXX/ubsan-devirtualized-calls.cpp