aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf/dwarf2reader.cc
diff options
context:
space:
mode:
authorjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-03-30 21:36:58 +0000
committerjimblandy <jimblandy@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-03-30 21:36:58 +0000
commit608d142aaa1da8e68e4635db77fd9f36d337276c (patch)
treefbe8ebddf73c9a210df1e975de4d3b353f40206e /src/common/dwarf/dwarf2reader.cc
parentBreakpad Linux dumper: Make changes requested by Neal Sidhwaney in issue 59002. (diff)
downloadbreakpad-608d142aaa1da8e68e4635db77fd9f36d337276c.tar.xz
Breakpad DWARF parser: correct comments regarding dynamic_cast.
The comments don't accurately describe what the style guide says. Regardless of what the style guide says, RTTI seems to make trouble in practice, because so many people build with it disabled. Since only the symbol dumper uses RTTI, not the client library, it may be practical for people to simply enable RTTI for the dumper. Failing that, it may be best in the long run to violate the style guide and make the code work sans RTTI. a=jimblandy, r=mmentovai git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@561 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/dwarf/dwarf2reader.cc')
-rw-r--r--src/common/dwarf/dwarf2reader.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc
index 2952243c..b2b9d0de 100644
--- a/src/common/dwarf/dwarf2reader.cc
+++ b/src/common/dwarf/dwarf2reader.cc
@@ -919,7 +919,8 @@ class CallFrameInfo::UndefinedRule: public CallFrameInfo::Rule {
return handler->UndefinedRule(address, reg);
}
bool operator==(const Rule &rhs) const {
- // dynamic_cast is prohibited by Google C++ Style Guide, but justified.
+ // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
+ // been carefully considered; cheap RTTI-like workarounds are forbidden.
const UndefinedRule *our_rhs = dynamic_cast<const UndefinedRule *>(&rhs);
return (our_rhs != NULL);
}
@@ -935,7 +936,8 @@ class CallFrameInfo::SameValueRule: public CallFrameInfo::Rule {
return handler->SameValueRule(address, reg);
}
bool operator==(const Rule &rhs) const {
- // dynamic_cast is prohibited by Google C++ Style Guide, but justified.
+ // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
+ // been carefully considered; cheap RTTI-like workarounds are forbidden.
const SameValueRule *our_rhs = dynamic_cast<const SameValueRule *>(&rhs);
return (our_rhs != NULL);
}
@@ -953,7 +955,8 @@ class CallFrameInfo::OffsetRule: public CallFrameInfo::Rule {
return handler->OffsetRule(address, reg, base_register_, offset_);
}
bool operator==(const Rule &rhs) const {
- // dynamic_cast is prohibited by Google C++ Style Guide, but justified.
+ // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
+ // been carefully considered; cheap RTTI-like workarounds are forbidden.
const OffsetRule *our_rhs = dynamic_cast<const OffsetRule *>(&rhs);
return (our_rhs &&
base_register_ == our_rhs->base_register_ &&
@@ -981,7 +984,8 @@ class CallFrameInfo::ValOffsetRule: public CallFrameInfo::Rule {
return handler->ValOffsetRule(address, reg, base_register_, offset_);
}
bool operator==(const Rule &rhs) const {
- // dynamic_cast is prohibited by Google C++ Style Guide, but justified.
+ // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
+ // been carefully considered; cheap RTTI-like workarounds are forbidden.
const ValOffsetRule *our_rhs = dynamic_cast<const ValOffsetRule *>(&rhs);
return (our_rhs &&
base_register_ == our_rhs->base_register_ &&
@@ -1005,7 +1009,8 @@ class CallFrameInfo::RegisterRule: public CallFrameInfo::Rule {
return handler->RegisterRule(address, reg, register_number_);
}
bool operator==(const Rule &rhs) const {
- // dynamic_cast is prohibited by Google C++ Style Guide, but justified.
+ // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
+ // been carefully considered; cheap RTTI-like workarounds are forbidden.
const RegisterRule *our_rhs = dynamic_cast<const RegisterRule *>(&rhs);
return (our_rhs && register_number_ == our_rhs->register_number_);
}
@@ -1024,7 +1029,8 @@ class CallFrameInfo::ExpressionRule: public CallFrameInfo::Rule {
return handler->ExpressionRule(address, reg, expression_);
}
bool operator==(const Rule &rhs) const {
- // dynamic_cast is prohibited by Google C++ Style Guide, but justified.
+ // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
+ // been carefully considered; cheap RTTI-like workarounds are forbidden.
const ExpressionRule *our_rhs = dynamic_cast<const ExpressionRule *>(&rhs);
return (our_rhs && expression_ == our_rhs->expression_);
}
@@ -1043,7 +1049,8 @@ class CallFrameInfo::ValExpressionRule: public CallFrameInfo::Rule {
return handler->ValExpressionRule(address, reg, expression_);
}
bool operator==(const Rule &rhs) const {
- // dynamic_cast is prohibited by Google C++ Style Guide, but justified.
+ // dynamic_cast is allowed by the Google C++ Style Guide, if the use has
+ // been carefully considered; cheap RTTI-like workarounds are forbidden.
const ValExpressionRule *our_rhs =
dynamic_cast<const ValExpressionRule *>(&rhs);
return (our_rhs && expression_ == our_rhs->expression_);