along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "coretypes.h"
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_VECTOR
#include "config.h"
/* For use with name_hint. */
#include "system.h"
/* This file implements the parts of the language independent aspect
of diagnostic messages that implicitly use global_dc. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "coretypes.h"
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "coretypes.h"
dump (m_logger->get_stream (), m_logger->get_indent ());
}
+ for (auto iter : m_sinks)
+ iter->finalize_extensions ();
+
/* We might be handling a fatal error.
Close any active diagnostic groups, which may trigger flushing
sinks. */
{
dumping::emit_heading (out, indent, "printer");
m_printer->dump (out, indent + 2);
+
+ dumping::emit_heading (out, indent, "extensions");
+ if (m_extensions.empty ())
+ dumping::emit_none (out, indent + 2);
+ else
+ for (auto &ext : m_extensions)
+ ext->dump (out, indent + 2);
+}
+
+void
+sink::finalize_extensions ()
+{
+ for (auto &ext : m_extensions)
+ ext->finalize ();
}
void
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "coretypes.h"
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "coretypes.h"
class sink
{
public:
+ /* Abstract base class for adding additional functionality to a sink
+ (e.g. via a plugin). */
+ class extension
+ {
+ public:
+ virtual ~extension () {}
+ virtual void dump (FILE *out, int indent) const = 0;
+ virtual void finalize () {}
+
+ sink &get_sink () const { return m_sink; }
+
+ protected:
+ extension (sink &sink_)
+ : m_sink (sink_)
+ {
+ }
+
+ private:
+ sink &m_sink;
+ };
+
virtual ~sink () {}
virtual text_sink *dyn_cast_text_sink () { return nullptr; }
logging::logger *get_logger () { return m_context.get_logger (); }
+ void
+ add_extension (std::unique_ptr<extension> sink_ext)
+ {
+ m_extensions.push_back (std::move (sink_ext));
+ }
+
+ void
+ finalize_extensions ();
+
protected:
sink (context &dc)
: m_context (dc),
protected:
context &m_context;
std::unique_ptr<pretty_printer> m_printer;
+
+private:
+ std::vector<std::unique_ptr<extension>> m_extensions;
};
extern void
for possible use later. If a line does not match a legal
construction, then the saved error message is reported. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "coretypes.h"
compilation is specified by a string called a "spec". */
#define INCLUDE_STRING
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#ifdef HOST_HAS_PERSONALITY_ADDR_NO_RANDOMIZE
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "coretypes.h"
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "intl.h"
/* { dg-options "-O" } */
+#define INCLUDE_VECTOR
#include "gcc-plugin.h"
#include "config.h"
#include "system.h"
to ensure that further very long lines don't start a new linemap.
This also means that we can't use macros in the test files. */
+#define INCLUDE_VECTOR
#include "gcc-plugin.h"
#include "config.h"
#include "system.h"
/* Plugin for testing how gracefully we degrade in the face of very
large source files. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "gcc-plugin.h"
#include "system.h"
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "coretypes.h"
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
+#define INCLUDE_VECTOR
#include "config.h"
#include "system.h"
#include "coretypes.h"
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
+#define INCLUDE_VECTOR
#include "gcc-plugin.h"
#include "system.h"
#include "coretypes.h"