projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f0570c5
)
add notes about const/pure properties and inifite loops
author
Matthias Braun
<matze@braunis.de>
Tue, 12 Apr 2011 11:03:49 +0000
(13:03 +0200)
committer
Matthias Braun
<matze@braunis.de>
Wed, 13 Apr 2011 10:26:31 +0000
(12:26 +0200)
include/libfirm/firm_types.h
patch
|
blob
|
history
diff --git
a/include/libfirm/firm_types.h
b/include/libfirm/firm_types.h
index
cbd7826
..
3c3657e
100644
(file)
--- a/
include/libfirm/firm_types.h
+++ b/
include/libfirm/firm_types.h
@@
-179,10
+179,17
@@
typedef enum mtp_additional_properties {
mtp_no_property = 0x00000000, /**< no additional properties, default */
mtp_property_const = 0x00000001, /**< This method did not access memory and calculates
its return values solely from its parameters.
mtp_no_property = 0x00000000, /**< no additional properties, default */
mtp_property_const = 0x00000001, /**< This method did not access memory and calculates
its return values solely from its parameters.
+ The only observable effect of a const function must be its
+ return value. So they must not exhibit infinite loops or wait
+ for user input. The return value must not depend on any
+ global variables/state.
GCC: __attribute__((const)). */
mtp_property_pure = 0x00000002, /**< This method did NOT write to memory and calculates
its return values solely from its parameters and
the memory they points to (or global vars).
GCC: __attribute__((const)). */
mtp_property_pure = 0x00000002, /**< This method did NOT write to memory and calculates
its return values solely from its parameters and
the memory they points to (or global vars).
+ The only observable effect of a const function must be its
+ return value. So they must not exhibit infinite loops or wait
+ for user input.
GCC: __attribute__((pure)). */
mtp_property_noreturn = 0x00000004, /**< This method did not return due to an aborting system
call.
GCC: __attribute__((pure)). */
mtp_property_noreturn = 0x00000004, /**< This method did not return due to an aborting system
call.