Not all blocks have terminators. I'm not sure how this wasn't crashing before.
Details
Diff Detail
Event Timeline
It looks like this currently happens to not crash because ilist::end() points to a sentinel value which can be validly accessed. Relying on that implementation detail seems like a bad idea though, so this looks like a good idea.
lib/Target/AArch64/AArch64BranchRelaxation.cpp | ||
---|---|---|
265–266 | Is there a particular reason you're changing this to take a reference instead of a pointer (and also getDestBlock below)? If you're doing it to emphasize "this pointer cannot be null" then it would make sense to do the same thing everywhere (i.e. in fixupConditionalBranch, invertBccCondition, etc.). | |
473 | Making a reference only to then take the address of it when calling fixupConditionalBranch seems a little odd. I'd just stick with a pointer. |
lib/Target/AArch64/AArch64BranchRelaxation.cpp | ||
---|---|---|
473 | I was trying to avoid &*I which is gross |
Is there a particular reason you're changing this to take a reference instead of a pointer (and also getDestBlock below)? If you're doing it to emphasize "this pointer cannot be null" then it would make sense to do the same thing everywhere (i.e. in fixupConditionalBranch, invertBccCondition, etc.).