From: Matthias Braun Date: Tue, 12 Apr 2011 11:03:49 +0000 (+0200) Subject: add notes about const/pure properties and inifite loops X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=7872ad07aaad9c53b8655e3d8947065557e0cbc0;p=libfirm add notes about const/pure properties and inifite loops --- diff --git a/include/libfirm/firm_types.h b/include/libfirm/firm_types.h index cbd78261f..3c3657e46 100644 --- 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. + 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). + 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.