Exemplo n.º 1
0
        public override IEnumerable <BuildObject> getDependencies(out DependencyDisposition ddisp)
        {
            OrderPreservingSet <BuildObject> deps = BeatExtensions.getBeatFlavoredShallowDependencies(
                this.contextVerb, this.beatobj, out ddisp, BeatIncludes.ImportFilter.ForBeatOrBasm);

            deps.Add(this.getBeatExecutable());
            return(deps);
        }
Exemplo n.º 2
0
            public BasmModuleAccumulator(IContextGeneratingVerb contextGenVerb, BuildObject upstreamObj, bool linkMode)
            {
                this._contextGenVerb = contextGenVerb;
                this._mutableVerbSet = new HashSet <IVerb>();
                //- NB preserve module definition-dependency order
                this._basmModules   = new OrderPreservingSet <BuildObject>();
                this._auxiliaryDeps = new HashSet <BuildObject>();
                _ddisp = DependencyDisposition.Complete;

                //-try
                //-{
                _mutableVerbSet.Add(contextGenVerb);
                _auxiliaryDeps.UnionWith(contextGenVerb.getOutputs());

                context = contextGenVerb.fetchIfAvailable(ref _ddisp);

                if (context != null)
                {
                    OrderPreservingSet <BuildObject> deps;
                    if (!linkMode)
                    {
                        deps = BeatExtensions.getBeatFlavoredShallowDependencies(
                            contextGenVerb, upstreamObj, out _ddisp, BeatIncludes.ImportFilter.ForBasmOnly);
                    }
                    else
                    {
                        deps = BeatExtensions.getBasmFlavoredTransitiveDependencies(contextGenVerb, upstreamObj, out _ddisp);
                        _mutableVerbSet.Add(BeatExtensions.getBasmFlavoredTransitiveDepVerb(_contextGenVerb, upstreamObj));
                    }
                    string  targetModName = upstreamObj.getFileNameWithoutExtension();
                    ModPart targetModPart = BeatExtensions.whichPart(upstreamObj);

                    //- NB security policy note: When verifying X.imp, we must be sure to supply X.ifc
                    //- to BoogieAsm, so that we know that we're actually verifying the promises
                    //- that other modules are relying on when they say "X" (which is how X got on
                    //- the verification obligation list). That property happens automatically here,
                    //- because we make a list of modules (ignoring ifc/imp part), such as {A,B,X},
                    //- and include *every* .ifc. If we're verifying X.imp, a conditional test
                    //- includes it at the time we consider module X.

                    foreach (BuildObject dep in deps)
                    {
                        string depExtn = dep.getExtension();
                        if (depExtn == null ||
                            depExtn.EndsWith(TransitiveDepsVerb.TDEP_EXTN) ||
                            depExtn.EndsWith(ContextGeneratingVerb.CONTEXT_EXTN))
                        {
                            _auxiliaryDeps.Add(dep);
                        }
                        else
                        {
                            Util.Assert(depExtn.Equals(BeatExtensions.BEATIFC_EXTN) ||
                                        depExtn.Equals(BeatExtensions.BEATIMP_EXTN) ||
                                        depExtn.Equals(BASMIFC_EXTN) ||
                                        depExtn.Equals(BASMIMP_EXTN)); //- Burned too many times by this silly filter-out strategy.
                            string  modName = dep.getFileNameWithoutExtension();
                            ModPart modPart = BeatExtensions.whichPart(dep);
                            getBasmModule(modName, ModPart.Ifc);
                            if ((dep.Equals(upstreamObj) && modPart == ModPart.Imp) || linkMode)
                            {
                                getBasmModule(modName, ModPart.Imp);
                            }
                        }
                    }
                }
                //-}
                //-catch (ObjNotReadyException)
                //-{
                //-
                //-    _ddisp = DependencyDisposition.Incomplete;
                //-}
                //-catch (ObjFailedException)
                //-{
                //-    _ddisp = DependencyDisposition.Failed;
                //-}
            }