From 976f69c842b928035e41782888cac006b93ae3d8 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Tue, 9 Apr 2019 16:36:14 -0400 Subject: [PATCH 186/217] FIXME: move auto_cfun to header --- gcc/analyzer/analyzer.h | 11 +++++++++++ gcc/analyzer/engine.cc | 13 ------------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/gcc/analyzer/analyzer.h b/gcc/analyzer/analyzer.h index 19651a8..72c55df 100644 --- a/gcc/analyzer/analyzer.h +++ b/gcc/analyzer/analyzer.h @@ -33,6 +33,17 @@ extern void register_analyzer_pass (); extern std::string expr_to_string (tree t); +/* An RAII-style class for pushing/popping cfun within a scope. + Doing so ensures we get "In function " announcements + from the diagnostics subsystem. */ + +class auto_cfun +{ +public: + auto_cfun (function *fun) { push_cfun (fun); } + ~auto_cfun () { pop_cfun (); } +}; + #if CHECKING_P namespace selftest { diff --git a/gcc/analyzer/engine.cc b/gcc/analyzer/engine.cc index c4a2cb7..b549fc8 100644 --- a/gcc/analyzer/engine.cc +++ b/gcc/analyzer/engine.cc @@ -49,19 +49,6 @@ class sm_instance; //////////////////////////////////////////////////////////////////////////// -/* An RAII-style class for pushing/popping cfun within a scope. - Doing so ensures we get "In function " announcements - from the diagnostics subsystem. */ - -class auto_cfun -{ -public: - auto_cfun (function *fun) { push_cfun (fun); } - ~auto_cfun () { pop_cfun (); } -}; - -//////////////////////////////////////////////////////////////////////////// - /* Gotcha: it's required that hashables have a different "deleted" value from the "empty" value. We use reinterpret_cast (1) for pointer deletion, following -- 1.8.5.3