Add a location to verifier error messages.
The verifier reports the 'location' of an error message as a reference to the entity that has a problem. This uses the 'AnyEntity' type to refer to instructions/values/ebbs etc. Also add an err! macro similar to the one used by the parser.
This commit is contained in:
@@ -259,7 +259,7 @@ impl Job {
|
||||
|
||||
// Should we run the verifier before this test?
|
||||
if !context.verified && test.needs_verifier() {
|
||||
try!(verify_function(&func));
|
||||
try!(verify_function(&func).map_err(|e| e.to_string()));
|
||||
context.verified = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ fn verifier_tests_from_source(function_source: &str) {
|
||||
let result = Verifier::new(&func).run();
|
||||
match verifier_results[i] {
|
||||
Some(ref re) => {
|
||||
assert_eq!(re.is_match(&result.err().unwrap()), true);
|
||||
assert_eq!(re.is_match(&result.err().unwrap().message), true);
|
||||
},
|
||||
None => {
|
||||
assert_eq!(result, Ok(()));
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
function test(i32) { ; Err(terminating)
|
||||
function test(i32) { ; Err(terminator)
|
||||
ebb0(v0: i32):
|
||||
jump ebb1
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user