diff options
author | Luboš Luňák <l.lunak@suse.cz> | 2012-10-09 16:27:25 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@suse.cz> | 2012-10-09 17:25:28 +0200 |
commit | 4fc56b9d4cd12cca51d7696e0776de5aa8f822cd (patch) | |
tree | 8a513a329ca300785307e3185eb9df4b686ce50c /compilerplugins/clang/bodynotinblock.cxx | |
parent | d4aa136e975b150add5f32013ea37aa68e9ccb57 (diff) |
move some code to a common base
Change-Id: Ife306c69054dfcc20b1339b88a4e14e5333ced71
Diffstat (limited to 'compilerplugins/clang/bodynotinblock.cxx')
-rw-r--r-- | compilerplugins/clang/bodynotinblock.cxx | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/compilerplugins/clang/bodynotinblock.cxx b/compilerplugins/clang/bodynotinblock.cxx index 9f5bf0e75c4e..ce19a5f6477a 100644 --- a/compilerplugins/clang/bodynotinblock.cxx +++ b/compilerplugins/clang/bodynotinblock.cxx @@ -12,8 +12,6 @@ #include <clang/Basic/SourceManager.h> -using namespace clang; - namespace loplugin { @@ -23,19 +21,8 @@ but are not inside a compound statement and thus the second one is unrelated. */ BodyNotInBlock::BodyNotInBlock( ASTContext& context ) - : context( context ) - { - } - -DiagnosticBuilder BodyNotInBlock::report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc ) + : Plugin( context ) { - // Do some mappings (e.g. for -Werror) that clang does not do for custom messages for some reason. - DiagnosticsEngine& diag = context.getDiagnostics(); - if( level == DiagnosticsEngine::Warning && diag.getWarningsAsErrors()) - level = DiagnosticsEngine::Error; - if( level == DiagnosticsEngine::Error && diag.getErrorsAsFatal()) - level = DiagnosticsEngine::Fatal; - return diag.Report( loc, diag.getCustomDiagID( level, message )); } void BodyNotInBlock::run() |