Ejemplo n.º 1
0
// Print any errors collected by the error reporter. Return true if
// there were any.
static bool CheckABIVerifyErrors(PNaClABIErrorReporter &Reporter,
                                 const Twine &Name) {
  bool HasErrors = Reporter.getErrorCount() > 0;
  if (HasErrors) {
    if (!Quiet) {
      outs() << "ERROR: " << Name << " is not valid PNaCl bitcode:\n";
      Reporter.printErrors(outs());
    }
  }
  Reporter.reset();
  return HasErrors;
}
Ejemplo n.º 2
0
static void CheckABIVerifyErrors(PNaClABIErrorReporter &Reporter,
                                 const Twine &Name) {
  if (PNaClABIVerify && Reporter.getErrorCount() > 0) {
    std::string errors;
    raw_string_ostream os(errors);
    os << (PNaClABIVerifyFatalErrors ? "ERROR: " : "WARNING: ");
    os << Name << " is not valid PNaCl bitcode:\n";
    Reporter.printErrors(os);
    if (PNaClABIVerifyFatalErrors) {
      report_fatal_error(os.str());
    }
    errs() << os.str();
  }
  Reporter.reset();
}