}
if (CSPGOKindFlag != NoCSPGO) {
if (P && (P->Action == PGOOptions::IRInstr ||
- P->Action == PGOOptions::SampleUse))
+ P->Action == PGOOptions::SampleUse)) {
errs() << "CSPGOKind cannot be used with IRInstr or SampleUse";
+ return false;
+ }
if (CSPGOKindFlag == CSInstrGen) {
- if (CSProfileGenFile.empty())
+ if (CSProfileGenFile.empty()) {
errs() << "CSInstrGen needs to specify CSProfileGenFile";
+ return false;
+ }
if (P) {
P->CSAction = PGOOptions::CSIRInstr;
P->CSProfileGenFile = CSProfileGenFile;
P = PGOOptions("", CSProfileGenFile, ProfileRemappingFile,
PGOOptions::NoAction, PGOOptions::CSIRInstr);
} else /* CSPGOKindFlag == CSInstrUse */ {
- if (!P)
+ if (!P) {
errs() << "CSInstrUse needs to be together with InstrUse";
+ return false;
+ }
P->CSAction = PGOOptions::CSIRUse;
}
}