Add --flaten for use with --xml-only (#2270).

This commit is contained in:
James Hanlon
2020-04-21 18:14:08 -04:00
committed by Wilson Snyder
parent 65cd4f6047
commit 97cbc10925
9 changed files with 170 additions and 8 deletions
+5 -3
View File
@@ -194,13 +194,15 @@ private:
int refs = modp->user3();
// Should we automatically inline this module?
// If --flatten is specified, then force everything to be inlined that can be.
// inlineMult = 2000 by default.
// If a mod*#refs is < this # nodes, can inline it
bool doit = ((allowed == CIL_USER)
|| ((allowed == CIL_MAYBE)
&& (refs == 1 || statements < INLINE_MODS_SMALLER
|| v3Global.opt.inlineMult() < 1
|| refs * statements < v3Global.opt.inlineMult())));
&& (v3Global.opt.flatten()
|| (refs == 1 || statements < INLINE_MODS_SMALLER
|| v3Global.opt.inlineMult() < 1
|| refs * statements < v3Global.opt.inlineMult()))));
// Packages aren't really "under" anything so they confuse this algorithm
if (VN_IS(modp, Package)) doit = false;
UINFO(4, " Inline=" << doit << " Possible=" << allowed << " Refs=" << refs