Skip to content

Commit 975832b

Browse files
committed
---
yaml --- r: 273197 b: refs/heads/beta c: 9afa5a1 h: refs/heads/master i: 273195: 10150e4
1 parent 1eb5520 commit 975832b

File tree

19 files changed

+4308
-3914
lines changed

19 files changed

+4308
-3914
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 0943b1668d9dcf486a77a97d6c28ccd64ffed609
26+
refs/heads/beta: 9afa5a13cc258315d012d5e3a42740e4ac0dff2a
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/compiletest/common.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,8 @@ pub struct Config {
155155
pub lldb_python_dir: Option<String>,
156156

157157
// Explain what's going on
158-
pub verbose: bool
158+
pub verbose: bool,
159+
160+
// Print one character per test instead of one line
161+
pub quiet: bool,
159162
}

branches/beta/src/compiletest/compiletest.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
7777
optopt("", "host-rustcflags", "flags to pass to rustc for host", "FLAGS"),
7878
optopt("", "target-rustcflags", "flags to pass to rustc for target", "FLAGS"),
7979
optflag("", "verbose", "run tests verbosely, showing all output"),
80+
optflag("", "quiet", "print one character per test instead of one line"),
8081
optopt("", "logfile", "file to log test execution to", "FILE"),
8182
optopt("", "target", "the target to build for", "TARGET"),
8283
optopt("", "host", "the host to build for", "HOST"),
@@ -151,6 +152,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
151152
!opt_str2(matches.opt_str("adb-test-dir")).is_empty(),
152153
lldb_python_dir: matches.opt_str("lldb-python-dir"),
153154
verbose: matches.opt_present("verbose"),
155+
quiet: matches.opt_present("quiet"),
154156
}
155157
}
156158

@@ -184,6 +186,7 @@ pub fn log_config(config: &Config) {
184186
logv(c, format!("adb_device_status: {}",
185187
config.adb_device_status));
186188
logv(c, format!("verbose: {}", config.verbose));
189+
logv(c, format!("quiet: {}", config.quiet));
187190
logv(c, format!("\n"));
188191
}
189192

@@ -247,6 +250,7 @@ pub fn test_opts(config: &Config) -> test::TestOpts {
247250
test::TestOpts {
248251
filter: config.filter.clone(),
249252
run_ignored: config.run_ignored,
253+
quiet: config.quiet,
250254
logfile: config.logfile.clone(),
251255
run_tests: true,
252256
bench_benchmarks: true,

branches/beta/src/etc/platform-intrinsics/generator.py

Lines changed: 48 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ def __init__(self):
117117
Type.__init__(self, 0)
118118

119119
def compiler_ctor(self):
120-
return 'void()'
120+
return '::VOID'
121+
122+
def compiler_ctor_ref(self):
123+
return '&' + self.compiler_ctor()
121124

122125
def rust_name(self):
123126
return '()'
@@ -163,10 +166,12 @@ def __init__(self, bitwidth, llvm_bitwidth = None):
163166

164167
def compiler_ctor(self):
165168
if self._llvm_bitwidth is None:
166-
return 'i({})'.format(self.bitwidth())
169+
return '::I{}'.format(self.bitwidth())
167170
else:
168-
return 'i_({}, {})'.format(self.bitwidth(),
169-
self._llvm_bitwidth)
171+
return '::I{}_{}'.format(self.bitwidth(), self._llvm_bitwidth)
172+
173+
def compiler_ctor_ref(self):
174+
return '&' + self.compiler_ctor()
170175

171176
def llvm_name(self):
172177
bw = self._llvm_bitwidth or self.bitwidth()
@@ -182,10 +187,12 @@ def __init__(self, bitwidth, llvm_bitwidth = None):
182187

183188
def compiler_ctor(self):
184189
if self._llvm_bitwidth is None:
185-
return 'u({})'.format(self.bitwidth())
190+
return '::U{}'.format(self.bitwidth())
186191
else:
187-
return 'u_({}, {})'.format(self.bitwidth(),
188-
self._llvm_bitwidth)
192+
return '::U{}_{}'.format(self.bitwidth(), self._llvm_bitwidth)
193+
194+
def compiler_ctor_ref(self):
195+
return '&' + self.compiler_ctor()
189196

190197
def llvm_name(self):
191198
bw = self._llvm_bitwidth or self.bitwidth()
@@ -200,7 +207,10 @@ def __init__(self, bitwidth):
200207
Number.__init__(self, bitwidth)
201208

202209
def compiler_ctor(self):
203-
return 'f({})'.format(self.bitwidth())
210+
return '::F{}'.format(self.bitwidth())
211+
212+
def compiler_ctor_ref(self):
213+
return '&' + self.compiler_ctor()
204214

205215
def llvm_name(self):
206216
return 'f{}'.format(self.bitwidth())
@@ -244,12 +254,16 @@ def modify(self, spec, width, previous):
244254

245255
def compiler_ctor(self):
246256
if self._bitcast is None:
247-
return 'v({}, {})'.format(self._elem.compiler_ctor(),
248-
self._length)
257+
return '{}x{}'.format(self._elem.compiler_ctor(),
258+
self._length)
249259
else:
250-
return 'v_({}, {}, {})'.format(self._elem.compiler_ctor(),
251-
self._bitcast.compiler_ctor(),
252-
self._length)
260+
return '{}x{}_{}'.format(self._elem.compiler_ctor(),
261+
self._length,
262+
self._bitcast.compiler_ctor()
263+
.replace('::', ''))
264+
265+
def compiler_ctor_ref(self):
266+
return '&' + self.compiler_ctor()
253267

254268
def rust_name(self):
255269
return '{}x{}'.format(self._elem.rust_name(), self._length)
@@ -284,10 +298,14 @@ def compiler_ctor(self):
284298
if self._llvm_elem is None:
285299
llvm_elem = 'None'
286300
else:
287-
llvm_elem = 'Some({})'.format(self._llvm_elem.compiler_ctor())
288-
return 'p({}, {}, {})'.format('true' if self._const else 'false',
289-
self._elem.compiler_ctor(),
290-
llvm_elem)
301+
llvm_elem = 'Some({})'.format(self._llvm_elem.compiler_ctor_ref())
302+
return 'Type::Pointer({}, {}, {})'.format(self._elem.compiler_ctor_ref(),
303+
llvm_elem,
304+
'true' if self._const else 'false')
305+
306+
def compiler_ctor_ref(self):
307+
return "{{ static PTR: Type = {}; &PTR }}".format(self.compiler_ctor())
308+
291309

292310
def rust_name(self):
293311
return '*{} {}'.format('const' if self._const else 'mut',
@@ -322,8 +340,14 @@ def modify(self, spec, width, previous):
322340
raise NotImplementedError()
323341

324342
def compiler_ctor(self):
325-
return 'agg({}, vec![{}])'.format('true' if self._flatten else 'false',
326-
', '.join(elem.compiler_ctor() for elem in self._elems))
343+
parts = "{{ static PARTS: [&'static Type; {}] = [{}]; &PARTS }}"
344+
elems = ', '.join(elem.compiler_ctor_ref() for elem in self._elems)
345+
parts = parts.format(len(self._elems), elems)
346+
return 'Type::Aggregate({}, {})'.format('true' if self._flatten else 'false',
347+
parts)
348+
349+
def compiler_ctor_ref(self):
350+
return "{{ static AGG: Type = {}; &AGG }}".format(self.compiler_ctor())
327351

328352
def rust_name(self):
329353
return '({})'.format(', '.join(elem.rust_name() for elem in self._elems))
@@ -518,10 +542,10 @@ def intrinsic_name(self):
518542
return self._platform.platform().intrinsic_prefix() + self.intrinsic_suffix()
519543

520544
def compiler_args(self):
521-
return ', '.join(arg.compiler_ctor() for arg in self._args_raw)
545+
return ', '.join(arg.compiler_ctor_ref() for arg in self._args_raw)
522546

523547
def compiler_ret(self):
524-
return self._ret_raw.compiler_ctor()
548+
return self._ret_raw.compiler_ctor_ref()
525549

526550
def compiler_signature(self):
527551
return '({}) -> {}'.format(self.compiler_args(), self.compiler_ret())
@@ -733,7 +757,7 @@ def open(self, platform):
733757
734758
#![allow(unused_imports)]
735759
736-
use {{Intrinsic, i, i_, u, u_, f, v, v_, agg, p, void}};
760+
use {{Intrinsic, Type}};
737761
use IntrinsicDef::Named;
738762
use rustc::middle::ty::TyCtxt;
739763
@@ -747,10 +771,11 @@ def open(self, platform):
747771
def render(self, mono):
748772
return '''\
749773
"{}" => Intrinsic {{
750-
inputs: vec![{}],
774+
inputs: {{ static INPUTS: [&'static Type; {}] = [{}]; &INPUTS }},
751775
output: {},
752776
definition: Named("{}")
753777
}},'''.format(mono.intrinsic_suffix(),
778+
len(mono._args_raw),
754779
mono.compiler_args(),
755780
mono.compiler_ret(),
756781
mono.llvm_name())

0 commit comments

Comments
 (0)