OLD | NEW |
1 # -*- Python -*- | 1 # -*- Python -*- |
2 # Taken from utils/lit/tests in the LLVM tree and hacked together to support | 2 # Taken from utils/lit/tests in the LLVM tree and hacked together to support |
3 # our tests. | 3 # our tests. |
4 # | 4 # |
5 # Note: This configuration has simple commands to run Subzero's translator. | 5 # Note: This configuration has simple commands to run Subzero's translator. |
6 # They have the form %X2i (i.e. %p2i, %l2i, and %lc2i) where X is defined | 6 # They have the form %X2i (i.e. %p2i, %l2i, and %lc2i) where X is defined |
7 # as follows: | 7 # as follows: |
8 # | 8 # |
9 # p : Run Subzero's translator, building ICE from PNaCl bitcode directly. | 9 # p : Run Subzero's translator, building ICE from PNaCl bitcode directly. |
10 # l : Run Subzero's translator, converting the .ll file to a PNaCl bitcode | 10 # l : Run Subzero's translator, converting the .ll file to a PNaCl bitcode |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 | 99 |
100 # Translate LLVM source for each compiler setup. | 100 # Translate LLVM source for each compiler setup. |
101 config.substitutions.append(('%p2i', ' '.join(llvm2ice_cmd))) | 101 config.substitutions.append(('%p2i', ' '.join(llvm2ice_cmd))) |
102 config.substitutions.append(('%l2i', ' '.join(ifl2i_atts_cmd + llvm2ice_cmd | 102 config.substitutions.append(('%l2i', ' '.join(ifl2i_atts_cmd + llvm2ice_cmd |
103 + ['--llvm']))) | 103 + ['--llvm']))) |
104 config.substitutions.append(('%lc2i', ' '.join(iflc2i_atts_cmd + llvm2ice_cmd | 104 config.substitutions.append(('%lc2i', ' '.join(iflc2i_atts_cmd + llvm2ice_cmd |
105 + ['--llvm-source']))) | 105 + ['--llvm-source']))) |
106 | 106 |
107 config.substitutions.append(('%llvm2ice', llvm2icetool)) | 107 config.substitutions.append(('%llvm2ice', llvm2icetool)) |
108 | 108 |
109 llvmbintools = [r"\bFileCheck\b", r"\bllvm-as\b", r"\bllvm-mc\b", | 109 llvmbintools = [r"\bFileCheck\b", |
110 r"\bllvm-objdump\b", r"\bnot\b", r"\bpnacl-freeze\b", | 110 r"\bllvm-as\b", |
| 111 r"\bllvm-mc\b", |
| 112 r"\bllvm-objdump\b", |
| 113 r"\bllvm-readobj\b", |
| 114 r"\bnot\b", |
| 115 r"\bpnacl-freeze\b", |
111 r"\bpnacl-bcdis\b"] | 116 r"\bpnacl-bcdis\b"] |
112 | 117 |
113 for tool in llvmbintools: | 118 for tool in llvmbintools: |
114 # The re.sub() line is adapted from one of LLVM's lit.cfg files. | 119 # The re.sub() line is adapted from one of LLVM's lit.cfg files. |
115 # Extract the tool name from the pattern. This relies on the tool | 120 # Extract the tool name from the pattern. This relies on the tool |
116 # name being surrounded by \b word match operators. If the | 121 # name being surrounded by \b word match operators. If the |
117 # pattern starts with "| ", include it in the string to be | 122 # pattern starts with "| ", include it in the string to be |
118 # substituted. | 123 # substituted. |
119 substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$", | 124 substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$", |
120 r"\2" + llvmbinpath + "/" + r"\4", | 125 r"\2" + llvmbinpath + "/" + r"\4", |
121 tool) | 126 tool) |
122 config.substitutions.append((tool, substitution)) | 127 config.substitutions.append((tool, substitution)) |
123 | 128 |
124 # Add a feature to detect the Python version. | 129 # Add a feature to detect the Python version. |
125 config.available_features.add("python%d.%d" % (sys.version_info[0], | 130 config.available_features.add("python%d.%d" % (sys.version_info[0], |
126 sys.version_info[1])) | 131 sys.version_info[1])) |
127 | 132 |
128 # Debugging output | 133 # Debugging output |
129 def dbg(s): | 134 def dbg(s): |
130 print '[DBG] %s' % s | 135 print '[DBG] %s' % s |
131 | 136 |
132 dbg('bin_root = %s' % bin_root) | 137 dbg('bin_root = %s' % bin_root) |
133 dbg('llvmbinpath = %s' % llvmbinpath) | 138 dbg('llvmbinpath = %s' % llvmbinpath) |
134 dbg("Build attributes = %s" % llvm2iceatts) | 139 dbg("Build attributes = %s" % llvm2iceatts) |
OLD | NEW |