From 38ee454540b9b41d5cc173871dfbf7dd140e8abc Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Fri, 17 Jan 2025 10:39:46 +0100 Subject: pkg/declextract: move const handling logic from the clang tool Export raw info about consts from the clang tool, and let the Go part handle it. The less logic is in the clang tool, the better. Also this will allow to remove unused includes when we know which consts we ended up using. The more includes we include, the higher the chances we include something that's broken. --- pkg/declextract/serialization.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/declextract/serialization.go') diff --git a/pkg/declextract/serialization.go b/pkg/declextract/serialization.go index d69358679..571336097 100644 --- a/pkg/declextract/serialization.go +++ b/pkg/declextract/serialization.go @@ -39,14 +39,14 @@ func (ctx *context) fmt(msg string, args ...any) { } func (ctx *context) serializeIncludes() { - for _, inc := range ctx.Includes { + for _, inc := range ctx.includes { ctx.fmt("include <%s>\n", inc) } ctx.fmt("\n") } func (ctx *context) serializeDefines() { - for _, def := range ctx.Defines { + for _, def := range ctx.defines { ctx.fmt("define %v %v\n", def.Name, def.Value) } ctx.fmt("\n") -- cgit mrf-deployment