mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 05:22:04 +00:00
Removing an "if (!this)" check from two print methods. The condition will
never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210497 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2156,10 +2156,6 @@ void NamedMDNode::print(raw_ostream &ROS) const {
|
||||
}
|
||||
|
||||
void Type::print(raw_ostream &OS) const {
|
||||
if (!this) {
|
||||
OS << "<null Type>";
|
||||
return;
|
||||
}
|
||||
TypePrinting TP;
|
||||
TP.print(const_cast<Type*>(this), OS);
|
||||
|
||||
@@ -2172,10 +2168,6 @@ void Type::print(raw_ostream &OS) const {
|
||||
}
|
||||
|
||||
void Value::print(raw_ostream &ROS) const {
|
||||
if (!this) {
|
||||
ROS << "printing a <null> value\n";
|
||||
return;
|
||||
}
|
||||
formatted_raw_ostream OS(ROS);
|
||||
if (const Instruction *I = dyn_cast<Instruction>(this)) {
|
||||
const Function *F = I->getParent() ? I->getParent()->getParent() : nullptr;
|
||||
|
||||
Reference in New Issue
Block a user