[ScopDetectionDiagnostic] Add meaningfull enduser message for regions with entry block

Before this change the user only saw "Unspecified Error", when a region
contained the entry block. Now we report:

"Scop contains function entry (not yet supported)."

llvm-svn: 293169
This commit is contained in:
Tobias Grosser 2017-01-26 10:41:37 +00:00
parent 6f4ed077d0
commit 77363965c0
2 changed files with 5 additions and 0 deletions

View File

@ -702,6 +702,7 @@ public:
/// @name RejectReason interface
//@{
virtual std::string getMessage() const override;
virtual std::string getEndUserMessage() const override;
virtual const DebugLoc &getDebugLoc() const override;
//@}
};

View File

@ -549,6 +549,10 @@ std::string ReportEntry::getMessage() const {
return "Region containing entry block of function is invalid!";
}
std::string ReportEntry::getEndUserMessage() const {
return "Scop contains function entry (not yet supported).";
}
const DebugLoc &ReportEntry::getDebugLoc() const {
return BB->getTerminator()->getDebugLoc();
}