Skip to contentSkip to conversation

gcc-plugins: Rename last_stmt() for GCC 14+

PATCH New Kees Cook 1 participant 1 message Aug 11, 2023 Gcc plugins

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 gcc-plugins: Rename last_stmt() for GCC 14+

In GCC 14, last_stmt() was renamed to last_nondebug_stmt(). Add a helper macro to handle the renaming.

---
 scripts/gcc-plugins/gcc-common.h | 4 ++++
 1 file changed, 4 insertions(+)
scripts/gcc-plugins/gcc-common.h +4 -0
index 84c730da36dd..1ae39b9f4a95 100644
@@ -440,4 +440,8 @@ static inline void debug_gimple_stmt(const_gimple s)
 #define SET_DECL_MODE(decl, mode)	DECL_MODE(decl) = (mode)
 #endif
 
+#if BUILDING_GCC_VERSION >= 14000
+#define last_stmt(x)			last_nondebug_stmt(x)
+#endif
+
 #endif
Signature · 1 line
2.34.1