From: Craig Topper Date: Wed, 22 Apr 2015 02:59:06 +0000 (+0000) Subject: Revert "[TableGen] Use cast instead of dyn_cast where result isn't checked before... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0b67fe729322ef415ee59a87619795136a1def4f;p=oota-llvm.git Revert "[TableGen] Use cast instead of dyn_cast where result isn't checked before being dereferenced." Turns out I misread the parentheses. Though I'm pretty sure its always a RecordRecTy and non of the callers really seem to expect null. But until I'm completely sure I'm going to revert this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235469 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index b81254b99cc..bdafbbc6209 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -345,7 +345,7 @@ Init *DagRecTy::convertValue(BinOpInit *BO) { } RecordRecTy *RecordRecTy::get(Record *R) { - return cast(R->getDefInit()->getType()); + return dyn_cast(R->getDefInit()->getType()); } std::string RecordRecTy::getAsString() const {