diff options
author | Sean Silva <silvas@purdue.edu> | 2012-10-11 23:30:40 +0000 |
---|---|---|
committer | Sean Silva <silvas@purdue.edu> | 2012-10-11 23:30:40 +0000 |
commit | 8b8fa7b2f403ae2f342413239c4151e075022c97 (patch) | |
tree | 70dca59e93c6b45c7a55b1e328c89fe332e36d77 /lib/Bitcode | |
parent | 8ac1995456d6938b68f232995f49c86369dd121d (diff) |
Casting.h: Automatically handle isa<Base>(Derived).
Additionally, all such cases are handled with no dynamic check.
All `classof()` of the form
class Foo {
[...]
static bool classof(const Bar *) { return true; }
[...]
}
where Foo is an ancestor of Bar are no longer necessary.
Don't write them!
Note: The exact test is `is_base_of<Foo, Bar>`, which is non-strict, so
that Foo is considered an ancestor of itself.
This leads to the following rule of thumb for LLVM-style RTTI:
The argument type of `classof()` should be a strict ancestor.
For more information about implementing LLVM-style RTTI, see
docs/HowToSetUpLLVMStyleRTTI.rst
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165765 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode')
0 files changed, 0 insertions, 0 deletions