aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/c-lang.cc12
-rw-r--r--gcc/c/c-tree.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/gcc/c/c-lang.cc b/gcc/c/c-lang.cc
index eecc0a0..0e67045 100644
--- a/gcc/c/c-lang.cc
+++ b/gcc/c/c-lang.cc
@@ -46,9 +46,21 @@ enum c_language_kind c_language = clk_c;
#undef LANG_HOOKS_GET_SUBSTRING_LOCATION
#define LANG_HOOKS_GET_SUBSTRING_LOCATION c_get_substring_location
+#undef LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE
+#define LANG_HOOKS_GET_SARIF_SOURCE_LANGUAGE c_get_sarif_source_language
+
/* Each front end provides its own lang hook initializer. */
struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+/* Get a value for the SARIF v2.1.0 "artifact.sourceLanguage" property,
+ based on the list in SARIF v2.1.0 Appendix J. */
+
+const char *
+c_get_sarif_source_language (const char *)
+{
+ return "c";
+}
+
#if CHECKING_P
namespace selftest {
diff --git a/gcc/c/c-tree.h b/gcc/c/c-tree.h
index 3b322ad..e655afd 100644
--- a/gcc/c/c-tree.h
+++ b/gcc/c/c-tree.h
@@ -837,6 +837,8 @@ set_c_expr_source_range (c_expr *expr,
/* In c-fold.cc */
extern vec<tree> incomplete_record_decls;
+extern const char *c_get_sarif_source_language (const char *filename);
+
#if CHECKING_P
namespace selftest {
extern void run_c_tests (void);