This is an archive of the discontinued LLVM Phabricator instance.

Change cast to dyn_cast to be consistent with other casts within same scope.
Needs ReviewPublic

Authored by BrandonTJones on Apr 9 2019, 2:32 AM.

Details

Reviewers
andreadb
grosbach
Summary

This cast seems incorrect looking at similar and may cause errors.

Diff Detail

Event Timeline

BrandonTJones created this revision.Apr 9 2019, 2:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 9 2019, 2:32 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
dblaikie added inline comments.
llvm/lib/MC/MCExpr.cpp
764

If this dyn_cast is never false (if the original code never hit an assert) then the 'if' condition should be removed, and the cast should remain as a cast (not a dyn_cast)

If there are cases where the RHS is not an MCTargetExpr (even though the LHS is) - then this change should include a test case that demonstrates/exercises that case.