summaryrefslogtreecommitdiffstats
path: root/bin/gen-iwyu-dummy-lib.awk
diff options
context:
space:
mode:
Diffstat (limited to 'bin/gen-iwyu-dummy-lib.awk')
-rw-r--r--bin/gen-iwyu-dummy-lib.awk34
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/gen-iwyu-dummy-lib.awk b/bin/gen-iwyu-dummy-lib.awk
new file mode 100644
index 000000000..464d9515c
--- /dev/null
+++ b/bin/gen-iwyu-dummy-lib.awk
@@ -0,0 +1,34 @@
+BEGIN { domatch = 0; }
+
+{
+ if ($0 ~ /use_external(s)?,/ )
+ {
+ if (index($0, "))"))
+ {
+ gsub(/.*,/, "");
+ gsub(/\)+/, "");
+ if (!($0 in exts))
+ {
+ exts[$0];
+ print $0;
+ }
+ }
+ else
+ {
+ domatch = 1;
+ }
+ }
+ else if ($0 ~ /\)\)/ )
+ {
+ domatch = 0;
+ }
+ else if (domatch == 1)
+ {
+ if (!($1 in exts))
+ {
+ exts[$1];
+ print $1;
+ }
+ }
+}
+