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 config.substitutions.append(('%if', ' '.join(if_atts_cmd))) | 99 config.substitutions.append(('%if', ' '.join(if_atts_cmd))) |
100 | 100 |
101 # Translate LLVM source for each compiler setup. | 101 # Translate LLVM source for each compiler setup. |
102 config.substitutions.append(('%p2i', ' '.join(llvm2ice_cmd))) | 102 config.substitutions.append(('%p2i', ' '.join(llvm2ice_cmd))) |
103 config.substitutions.append(('%l2i', ' '.join(ifl2i_atts_cmd + llvm2ice_cmd | 103 config.substitutions.append(('%l2i', ' '.join(ifl2i_atts_cmd + llvm2ice_cmd |
104 + ['--llvm']))) | 104 + ['--llvm']))) |
105 config.substitutions.append(('%lc2i', ' '.join(iflc2i_atts_cmd + llvm2ice_cmd | 105 config.substitutions.append(('%lc2i', ' '.join(iflc2i_atts_cmd + llvm2ice_cmd |
106 + ['--llvm-source']))) | 106 + ['--llvm-source']))) |
107 | 107 |
108 config.substitutions.append(('%llvm2ice', llvm2icetool)) | 108 config.substitutions.append(('%llvm2ice', llvm2icetool)) |
109 config.substitutions.append(('%szdiff', os.path.join(pydir, 'szdiff.py'))) | |
110 | 109 |
111 llvmbintools = [r"\bFileCheck\b", r"\bllvm-as\b", r"\bllvm-mc\b", | 110 llvmbintools = [r"\bFileCheck\b", r"\bllvm-as\b", r"\bllvm-mc\b", |
112 r"\bllvm-objdump\b", r"\bnot\b", r"\bpnacl-freeze\b", | 111 r"\bllvm-objdump\b", r"\bnot\b", r"\bpnacl-freeze\b", |
113 r"\bpnacl-bcdis\b"] | 112 r"\bpnacl-bcdis\b"] |
114 | 113 |
115 for tool in llvmbintools: | 114 for tool in llvmbintools: |
116 # The re.sub() line is adapted from one of LLVM's lit.cfg files. | 115 # The re.sub() line is adapted from one of LLVM's lit.cfg files. |
117 # Extract the tool name from the pattern. This relies on the tool | 116 # Extract the tool name from the pattern. This relies on the tool |
118 # name being surrounded by \b word match operators. If the | 117 # name being surrounded by \b word match operators. If the |
119 # pattern starts with "| ", include it in the string to be | 118 # pattern starts with "| ", include it in the string to be |
120 # substituted. | 119 # substituted. |
121 substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$", | 120 substitution = re.sub(r"^(\\)?((\| )?)\W+b([0-9A-Za-z-_]+)\\b\W*$", |
122 r"\2" + llvmbinpath + "/" + r"\4", | 121 r"\2" + llvmbinpath + "/" + r"\4", |
123 tool) | 122 tool) |
124 config.substitutions.append((tool, substitution)) | 123 config.substitutions.append((tool, substitution)) |
125 | 124 |
126 # Add a feature to detect the Python version. | 125 # Add a feature to detect the Python version. |
127 config.available_features.add("python%d.%d" % (sys.version_info[0], | 126 config.available_features.add("python%d.%d" % (sys.version_info[0], |
128 sys.version_info[1])) | 127 sys.version_info[1])) |
129 | 128 |
130 # Debugging output | 129 # Debugging output |
131 def dbg(s): | 130 def dbg(s): |
132 print '[DBG] %s' % s | 131 print '[DBG] %s' % s |
133 | 132 |
134 dbg('bin_root = %s' % bin_root) | 133 dbg('bin_root = %s' % bin_root) |
135 dbg('llvmbinpath = %s' % llvmbinpath) | 134 dbg('llvmbinpath = %s' % llvmbinpath) |
136 dbg("Build attributes = %s" % llvm2iceatts) | 135 dbg("Build attributes = %s" % llvm2iceatts) |
OLD | NEW |