Chris Lattner | ad9a176 | 2009-07-06 22:24:16 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 2 | |
| 3 | #===- make/filter-inputs ---------------------------------------------------===# |
| 4 | # |
| 5 | # The LLVM Compiler Infrastructure |
| 6 | # |
| 7 | # This file is distributed under the University of Illinois Open Source |
| 8 | # License. See LICENSE.TXT for details. |
| 9 | # |
| 10 | #===------------------------------------------------------------------------===# |
| 11 | |
| 12 | # Given a list of files, return a new list of files taking only the |
| 13 | # first file for any particular filename. |
| 14 | def main(): |
| 15 | import os,sys |
| 16 | |
| 17 | seen = set() |
| 18 | for file in sys.argv[1:]: |
| 19 | base = os.path.basename(file) |
| 20 | if base not in seen: |
| 21 | seen.add(base) |
| 22 | print file |
| 23 | |
| 24 | if __name__ == '__main__': |
| 25 | main() |