aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPhilip Herron <philip.herron@embecosm.com>2022-02-11 10:18:24 +0000
committerPhilip Herron <philip.herron@embecosm.com>2022-02-11 10:18:24 +0000
commit5801e165b3902f3376387649c632933c05647274 (patch)
tree8c7e1c8cb8cd8c2fa708da79dae95d7a1e5cdcd6 /gcc
parentd21ae240496a48628cf1beafcc192760ebe1be89 (diff)
downloadgcc-5801e165b3902f3376387649c632933c05647274.zip
gcc-5801e165b3902f3376387649c632933c05647274.tar.gz
gcc-5801e165b3902f3376387649c632933c05647274.tar.bz2
Fix warnings when including rust-target.h information
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/rust-session-manager.cc20
-rw-r--r--gcc/rust/rust-target.h9
2 files changed, 8 insertions, 21 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 4e140fd..5529fbf 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -19,21 +19,6 @@
#include "rust-session-manager.h"
#include "rust-diagnostics.h"
-
-//#include "rust-target.h"
-/*TODO This isn't (currently?) necessary, but if '#include'd after '#include
- "target.h"', causes: In file included from
- [...]/gcc/rust/rust-session-manager.cc:31:
- [...]/gcc/rust/rust-target.h:23: error: "DEFHOOK" redefined [-Werror]
- 23 | #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (*NAME) PARAMS;
- |
- In file included from [...]/gcc/rust/rust-session-manager.cc:27:
- [...]/gcc/target.h:272: note: this is the location of the previous
- definition 272 | #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (* NAME)
- PARAMS;
- |
-*/
-
#include "rust-lex.h"
#include "rust-parse.h"
#include "rust-macro-expand.h"
@@ -47,10 +32,7 @@
#include "diagnostic.h"
#include "input.h"
-#include "target.h"
-#include "tm.h"
-#include "memmodel.h"
-#include "tm_p.h"
+#include "rust-target.h"
extern bool
saw_errors (void);
diff --git a/gcc/rust/rust-target.h b/gcc/rust/rust-target.h
index 9669c4a..743ac51 100644
--- a/gcc/rust/rust-target.h
+++ b/gcc/rust/rust-target.h
@@ -18,9 +18,14 @@
#ifndef GCC_RUST_TARGET_H
#define GCC_RUST_TARGET_H
+#include "target.h"
+#include "tm.h"
+#include "memmodel.h"
+#include "tm_p.h"
+
// TODO: find out what this stuff actually does
#define DEFHOOKPOD(NAME, DOC, TYPE, INIT) TYPE NAME;
-#define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (*NAME) PARAMS;
+// #define DEFHOOK(NAME, DOC, TYPE, PARAMS, INIT) TYPE (*NAME) PARAMS;
#define DEFHOOK_UNDOC DEFHOOK
#define HOOKSTRUCT(FRAGMENT) FRAGMENT
@@ -39,4 +44,4 @@ extern struct gcc_targetrustm targetrustm;
extern void
rust_add_target_info (const char *key, const char *value);
-#endif \ No newline at end of file
+#endif