[ClangAstParser] Adds option ClangAstKeys.IGNORE_HEADER_INCLUDES
@@ -23,6 +23,8 @@ import org.suikasoft.jOptions.Interfaces.DataStore;
import pt.up.fe.specs.clava.ClavaLog;
import pt.up.fe.specs.clava.ClavaOptions;
import pt.up.fe.specs.clava.language.Standard;
+import pt.up.fe.specs.util.SpecsCheck;
+import pt.up.fe.specs.util.utilities.StringList;
public interface ClangAstKeys {
@@ -37,6 +39,13 @@ public interface ClangAstKeys {
DataKey<Boolean> USES_CILK = KeyFactory.bool("usesCilk");
+ DataKey<StringList> IGNORE_HEADER_INCLUDES = KeyFactory.stringList("ignoreHeaderIncludes")
+ .setLabel("Headers to ignore when recreating #include directives (Java regexes)");
+
+ public static String getFlagIgnoreIncludes() {
+ return "ihi";
+ }
+
/**
* Transform flags to the ClangAstDumper into a DataStore.
*
@@ -82,6 +91,18 @@ public interface ClangAstKeys {
continue;
}
+ if (flag.equals(getFlagIgnoreIncludes())) {
+ // Must have another argument
+ SpecsCheck.checkSize(flags, i + 2);
+
+ String value = flags.get(i + 1);
+ config.set(ClangAstKeys.IGNORE_HEADER_INCLUDES, StringList.getCodec().decode(value));
+
+ // Advance an extra flag
+ i++;
+ continue;
+ }
+
parsedFlags.add(flag);
}
