if (!MD)
return 0;
+ SubmoduleID OrigModID = ModID;
bool isUndefined = false;
Optional<bool> isPublic;
for (; MD; MD = MD->getPrevious()) {
isUndefined = false;
isPublic = Optional<bool>();
}
+ // We are looking for a definition in a different submodule than the one
+ // that we started with. If a submodule has re-definitions of the same
+ // macro, only the last definition will be used as the "exported" one.
+ if (ModID == OrigModID)
+ continue;
if (DefMacroDirective *DefMD = dyn_cast<DefMacroDirective>(MD)) {
if (!isUndefined && (!isPublic.hasValue() || isPublic.getValue()))
-
-
+#define TOP_RIGHT_REDEF float
+// The last definition will be exported from the sub-module.
#define TOP_RIGHT_REDEF int
#define TOP_RIGHT_UNDEF int