Commit 119b8e7d authored by Sergio Costas's avatar Sergio Costas

Full replacement of __crust_t__ with __crust__

parent d6defa83
......@@ -41,7 +41,7 @@ during the C Preprocessor pass.
Then, each C source file must be annotated with the CRUST tags.
The available tags are:
* __crust_t__ : specifies that this is a CRUST element, and must
* __crust__ : specifies that this is a CRUST element, and must
be tracked by the CRUST static analyzer. It can be applied only to
single-indirection pointers.
* __crust_borrow__ : when used with an argument in a function
......
......@@ -8,7 +8,7 @@
#ifndef ENABLE_CRUST_TAGS
#define ENABLE_CRUST_TAGS
#define __crust_t__
#define __crust__
#define __crust_borrow__
#define __crust_recycle__
#define __crust_alias__
......
......@@ -769,19 +769,19 @@ class crust(object):
if param_is_crust:
if var_data is None:
self._add_error(thread["thread_status"], self.MSG_CRITICAL, "Expected a __crust_t__ variable as argument {:d} when calling function '{:s}' at line {:d}", pos+1, statement.name, statement.line)
self._add_error(thread["thread_status"], self.MSG_CRITICAL, "Expected a __crust__ variable as argument {:d} when calling function '{:s}' at line {:d}", pos+1, statement.name, statement.line)
error_found = True
continue
if not passed_is_crust:
self._add_error(thread["thread_status"], self.MSG_CRITICAL, "Expected a __crust_t__ variable as argument {:d} when calling function '{:s}' at line {:d}, but passed non __crust_t__ variable", pos+1, statement.name, statement.line)
self._add_error(thread["thread_status"], self.MSG_CRITICAL, "Expected a __crust__ variable as argument {:d} when calling function '{:s}' at line {:d}, but passed non __crust__ variable", pos+1, statement.name, statement.line)
error_found = True
continue
else:
if passed_is_crust:
if variable_parameters:
self._add_error(thread["thread_status"], self.MSG_CRITICAL, "Passed a __crust_t__ variable as argument {:d} when calling function '{:s}' at line {:d}, but __crust_t__ variables are not allowed for optional arguments in functions with variable number of arguments", pos+1, statement.name, statement.line)
self._add_error(thread["thread_status"], self.MSG_CRITICAL, "Passed a __crust__ variable as argument {:d} when calling function '{:s}' at line {:d}, but __crust__ variables are not allowed for optional arguments in functions with variable number of arguments", pos+1, statement.name, statement.line)
else:
self._add_error(thread["thread_status"], self.MSG_CRITICAL, "Expected a non __crust_t__ variable as argument {:d} when calling function '{:s}' at line {:d}, but passed a __crust_t__ variable", pos+1, statement.name, statement.line)
self._add_error(thread["thread_status"], self.MSG_CRITICAL, "Expected a non __crust__ variable as argument {:d} when calling function '{:s}' at line {:d}, but passed a __crust__ variable", pos+1, statement.name, statement.line)
error_found = True
continue
......@@ -1110,14 +1110,14 @@ class crust(object):
if node.pointer == 0:
if is_parameter:
if node.name is None:
self._add_error(thread_status, self.MSG_CRITICAL, "An argument is defined as __crust_t__ type at line {:d}, but it is not a pointer", node.line)
self._add_error(thread_status, self.MSG_CRITICAL, "An argument is defined as __crust__ type at line {:d}, but it is not a pointer", node.line)
else:
self._add_error(thread_status, self.MSG_CRITICAL, "Argument '{:s}' defined as __crust_t__ type at line {:d}, but it is not a pointer", node.name, node.line)
self._add_error(thread_status, self.MSG_CRITICAL, "Argument '{:s}' defined as __crust__ type at line {:d}, but it is not a pointer", node.name, node.line)
else:
if retval_from_function is not None:
self._add_error(thread_status, self.MSG_CRITICAL, "Return value for function '{:s}', defined at line {:d}, is defined as __crust_t__ type, but it is not a pointer", retval_from_function, node.line)
self._add_error(thread_status, self.MSG_CRITICAL, "Return value for function '{:s}', defined at line {:d}, is defined as __crust__ type, but it is not a pointer", retval_from_function, node.line)
else:
self._add_error(thread_status, self.MSG_CRITICAL, "Variable '{:s}' is defined as __crust_t__ type at line {:d}, but it is not a pointer", node.name, node.line)
self._add_error(thread_status, self.MSG_CRITICAL, "Variable '{:s}' is defined as __crust__ type at line {:d}, but it is not a pointer", node.name, node.line)
elif node.pointer == 1:
retval["crust"] = True
else:
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment