|
@@ -721,16 +721,31 @@ struct ValidationContext {
|
|
|
}
|
|
|
LastRuleEmit = Rule;
|
|
|
LastDebugLocEmit = L;
|
|
|
+ }
|
|
|
+
|
|
|
+ // Print the error header matched by IDE regexes
|
|
|
+ DiagPrinter << "error: ";
|
|
|
|
|
|
+ // Print the debug location, if any, as matched by IDE regexes
|
|
|
+ if (L) {
|
|
|
L.print(DiagStream());
|
|
|
- DiagPrinter << ' ';
|
|
|
- return true;
|
|
|
+ DiagPrinter << ": ";
|
|
|
}
|
|
|
+
|
|
|
BasicBlock *BB = I->getParent();
|
|
|
Function *F = BB->getParent();
|
|
|
|
|
|
- DiagPrinter << "at " << I;
|
|
|
- DiagPrinter << " inside block ";
|
|
|
+ // Printthe instruction
|
|
|
+ std::string InstrStr;
|
|
|
+ raw_string_ostream InstrStream(InstrStr);
|
|
|
+ I->print(InstrStream);
|
|
|
+ InstrStream.flush();
|
|
|
+ StringRef InstrStrRef = InstrStr;
|
|
|
+ InstrStrRef = InstrStrRef.ltrim(); // Ignore indentation
|
|
|
+ DiagPrinter << "at '" << InstrStrRef << "'";
|
|
|
+
|
|
|
+ // Print the parent block name
|
|
|
+ DiagPrinter << " in block '";
|
|
|
if (!BB->getName().empty()) {
|
|
|
DiagPrinter << BB->getName();
|
|
|
}
|
|
@@ -741,10 +756,16 @@ struct ValidationContext {
|
|
|
if (BB == &(*i)) {
|
|
|
break;
|
|
|
}
|
|
|
+ idx++;
|
|
|
}
|
|
|
DiagPrinter << "#" << idx;
|
|
|
}
|
|
|
- DiagPrinter << " of function " << *F << ' ';
|
|
|
+ DiagPrinter << "'";
|
|
|
+
|
|
|
+ // Print the function name
|
|
|
+ DiagPrinter << " of function '" << F->getName() << "': ";
|
|
|
+
|
|
|
+ // Parent will print the message
|
|
|
return true;
|
|
|
}
|
|
|
|