Mercurial > hg > graal-compiler
comparison mx/mx_graal.py @ 21537:ca14581fadc4
handle duplicates when extracting service files
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 25 May 2015 17:09:00 +0200 |
parents | 6420ac0cbe3c |
children | 5324104ac4f3 |
comparison
equal
deleted
inserted
replaced
21536:7fed589ff982 | 21537:ca14581fadc4 |
---|---|
618 afterName = declLine[len(className):] | 618 afterName = declLine[len(className):] |
619 if not afterName.startswith(' extends '): | 619 if not afterName.startswith(' extends '): |
620 classification[className] = False | 620 classification[className] = False |
621 break | 621 break |
622 superInterfaces = afterName[len(' extends '):-len(' {')].split(',') | 622 superInterfaces = afterName[len(' extends '):-len(' {')].split(',') |
623 if 'com.oracle.graal.api.runtime.Service' in superInterfaces: | 623 if 'com.oracle.jvmci.runtime.Service' in superInterfaces: |
624 classification[className] = True | 624 classification[className] = True |
625 break | 625 break |
626 maybe = [_eraseGenerics(superInterface) for superInterface in superInterfaces] | 626 maybe = [_eraseGenerics(superInterface) for superInterface in superInterfaces] |
627 classification[className] = maybe | 627 classification[className] = maybe |
628 break | 628 break |
630 if v is None: | 630 if v is None: |
631 mx.abort('Could not find interface for service ' + className + ':\n' + output) | 631 mx.abort('Could not find interface for service ' + className + ':\n' + output) |
632 return classification | 632 return classification |
633 | 633 |
634 def _extractMaybes(classification): | 634 def _extractMaybes(classification): |
635 maybes = [] | 635 maybes = set() |
636 for v in classification.values(): | 636 for v in classification.values(): |
637 if isinstance(v, list): | 637 if isinstance(v, list): |
638 maybes.extend(v) | 638 maybes.update(v) |
639 return maybes | 639 return list(maybes) |
640 | 640 |
641 def _mergeClassification(classification, newClassification): | 641 def _mergeClassification(classification, newClassification): |
642 for className, value in classification.items(): | 642 for className, value in classification.items(): |
643 if isinstance(value, list): | 643 if isinstance(value, list): |
644 classification[className] = None | 644 classification[className] = None |