Exemplo n.º 1
0
        public bool Equals(SourceLocationInfo source)
        {
            if (Count == source.GetRecords().Count)
            {
                bool result = true;
                for (int i = 0; i < Count; i++)
                {
                    result = result && this[i].Equals(source.GetRecords()[i]);
                }
                return(result);
            }

            // handling the case where the verifier ignores header and we don't
            // refer OpenCL/atomics/refined_atomic_abstraction/access_in_loop as an example
            if (source.GetRecords().Count == 1)
            {
                SourceLocationInfo.Record record = source.GetRecords().First();
                if (this.Count(x => x.File == record.GetFile()) == 1)
                {
                    return(this.First(x => x.File == record.GetFile()).Equals(record));
                }
            }

            return(false);
        }
Exemplo n.º 2
0
        public static IEnumerable <LocationChain> GetLocationChain(this SourceLocationInfo source)
        {
            List <LocationChain> chains = new List <LocationChain>();

            foreach (LocationChain chain in ProgramMetadata.Locations.Values)
            {
                if (chain.Equals(source))
                {
                    chains.Add(chain);
                    return(chains);
                }
            }

            foreach (LocationChain chain in ProgramMetadata.Locations.Values)
            {
                if (chain.Last().Equals(source.GetRecords().Last()))
                {
                    chains.Add(chain);
                }
            }

            return(chains);
        }