[Swift-commit] r7747 - trunk/src/org/griphyn/vdl/mapping
hategan at ci.uchicago.edu
hategan at ci.uchicago.edu
Sat Mar 22 15:28:48 CDT 2014
Author: hategan
Date: 2014-03-22 15:28:48 -0500 (Sat, 22 Mar 2014)
New Revision: 7747
Modified:
trunk/src/org/griphyn/vdl/mapping/DuplicateMappingChecker.java
Log:
prevent duplicate mapping to null warnings when some fields in a structure are not mapped nor used
Modified: trunk/src/org/griphyn/vdl/mapping/DuplicateMappingChecker.java
===================================================================
--- trunk/src/org/griphyn/vdl/mapping/DuplicateMappingChecker.java 2014-03-22 19:59:06 UTC (rev 7746)
+++ trunk/src/org/griphyn/vdl/mapping/DuplicateMappingChecker.java 2014-03-22 20:28:48 UTC (rev 7747)
@@ -69,7 +69,7 @@
}
Entry e = getEntry(f);
if (e.write != null) {
- warn("Duplicate mapping found:\n\t" +
+ warn("WARNING: duplicate mapping found:\n\t" +
formatInfo(getInfo(h)) + " is used to read from " + f + "\n\t" +
formatInfo(e.write) + " is used to write to " + f);
}
@@ -93,13 +93,23 @@
if (!enabled) {
return;
}
+ if (f == null) {
+ /*
+ * sometimes only a sub-set of a complex structure is mapped and used
+ * such as, for example, in 0755-ext-mapper.swift
+ *
+ * In such cases, don't complain about multiple things being mapped
+ * to null
+ */
+ return;
+ }
Entry e = getEntry(f);
if (e.write != null) {
- warn("Duplicate mapping found:\n\t" +
+ warn("WARNING: duplicate mapping found:\n\t" +
formatInfo(getInfo(h)) + " and " + formatInfo(e.write) + " are both used to write to " + f);
}
if (e.read != null) {
- warn("Duplicate mapping found:\n\t" +
+ warn("WARNING: duplicate mapping found:\n\t" +
formatInfo(e.write) + " is used to write to " + f + "\n\t" +
"The following variables(s) are also used to read from " + f + ":" + formatInfos(e.read));
}
More information about the Swift-commit
mailing list