The structure of this method now matches the one above it.
Details
Diff Detail
Unit Tests
Event Timeline
I agree that the call site uses are somewhat problematic, but cast has stronger guarantee. Do you have a test case to trigger a code path that dyn_cast returns nullptr? If not, the if statement should just be replaced with unconditional cast.
llvm/lib/Object/ELFObjectFile.cpp | ||
---|---|---|
785–786 | This can just used cast and delete llvm_unreachable |
llvm/utils/TableGen/DecoderEmitter.cpp | ||
---|---|---|
2111 ↗ | (On Diff #480661) | See the reverted ba59ec2843f99f19d55d7cd9f9ac536fb038fdab: this change seems wrong. |
llvm/lib/MC/MCExpr.cpp | ||
---|---|---|
889 | R isn't checked for null after this so if the dynamic cast fails it will dereference a null point. cast would have generated an assert on assertion builds. |
I'll land this patch for you. Your previous changes are all about this kind of NFC cleanup. I think I only want to endorse people with contributions like bug fixing or useful feature requests...
R isn't checked for null after this so if the dynamic cast fails it will dereference a null point. cast would have generated an assert on assertion builds.