[BOLT] Do not process empty functions.

Summary:
While running on a recent test binary BOLT failed with an error. We were
trying to process '__hot_end' (which is not really a function), and asserted
that it had no basic blocks.

This diff marks functions with empty basic blocks list as non-simple since
there's no need to process them.

(cherry picked from FBD4696517)
This commit is contained in:
Maksim Panchenko
2017-03-12 11:30:05 -07:00
parent 2e5c2e689f
commit 351af0c895

View File

@@ -1612,6 +1612,11 @@ bool BinaryFunction::buildCFG() {
}
}
if (BasicBlocks.empty()) {
setSimple(false);
return false;
}
// Intermediate dump.
DEBUG(print(dbgs(), "after creating basic blocks"));