diff --git a/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp b/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp index 01dbdca3b8f..865da35de3c 100644 --- a/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp +++ b/lib/Target/PIC16/PIC16Passes/PIC16Cloner.cpp @@ -89,6 +89,9 @@ bool PIC16Cloner::runOnModule(Module &M) { if (mainCGN && isrCGN) break; } + + // We have nothing to do if any of the main or ISR is missing. + if (! mainCGN || ! isrCGN) return false; // Time for some diagnostics. // See if the main itself is interrupt function then report an error.