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 | 35dd8779fa5391255dd4530badb2b642b24848cc (patch) | |
tree | 85e4a35784f1923b44231cb7ce0b3a896adbb404 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | bead14e9de1641f3f669548009c4b279f2693274 (diff) | |
download | bcm5719-llvm-35dd8779fa5391255dd4530badb2b642b24848cc.tar.gz bcm5719-llvm-35dd8779fa5391255dd4530badb2b642b24848cc.zip |
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
llvm-svn: 165765
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions