From 8e6ba1345e86ae69d3238ce1e35db820c047bb4c Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Fri, 23 Jan 2015 16:59:08 +0100 Subject: [PATCH] PetScan::extract: improve error message Signed-off-by: Sven Verdoolaege --- scan.cc | 12 +++++++++++- scan.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scan.cc b/scan.cc index bf08128..8a3e75d 100644 --- a/scan.cc +++ b/scan.cc @@ -228,6 +228,16 @@ void PetScan::unsupported(Stmt *stmt) report(stmt, id); } +/* Report an unsupported statement type, unless autodetect is set. + */ +void PetScan::report_unsupported_statement_type(Stmt *stmt) +{ + DiagnosticsEngine &diag = PP.getDiagnostics(); + unsigned id = diag.getCustomDiagID(DiagnosticsEngine::Warning, + "this type of statement is not supported"); + report(stmt, id); +} + /* Report a missing prototype, unless autodetect is set. */ void PetScan::report_prototype_required(Stmt *stmt) @@ -1621,7 +1631,7 @@ __isl_give pet_tree *PetScan::extract(Stmt *stmt, bool skip_declarations) tree = extract(cast(stmt)); break; default: - unsupported(stmt); + report_unsupported_statement_type(stmt); return NULL; } diff --git a/scan.h b/scan.h index f364eb6..489cf4e 100644 --- a/scan.h +++ b/scan.h @@ -200,6 +200,7 @@ private: void report(clang::Stmt *stmt, unsigned id); void unsupported(clang::Stmt *stmt); + void report_unsupported_statement_type(clang::Stmt *stmt); void report_prototype_required(clang::Stmt *stmt); void report_missing_increment(clang::Stmt *stmt); void report_missing_summary_function(clang::Stmt *stmt); -- 2.11.4.GIT