X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=include%2Flibfirm%2Ftyperep.h;h=e2bc6b243880406aa17c202591cf8e15e8925e10;hb=2c7e601484413ad272d685f9f0cb3ecc27b251f7;hp=55e4f8ab3df7295f4c6709383de5f953dd2c1838;hpb=1d523ad26cd541494c1e6cd8dc4b0736f0adc2cf;p=libfirm diff --git a/include/libfirm/typerep.h b/include/libfirm/typerep.h index 55e4f8ab3..e2bc6b243 100644 --- a/include/libfirm/typerep.h +++ b/include/libfirm/typerep.h @@ -91,10 +91,13 @@ */ typedef enum { /** - * The entity is visible outside the compilation unit, but it is defined - * here. + * The entity is visible across compilation units. It might have an + * initializer/graph. + * Note that entities with visibility_external without initializer are + * assumed to be defined in another compilation unit (not like C variables + * which are considered 'uninitialized' in this case). */ - ir_visibility_default, + ir_visibility_external, /** * The entity is local to the compilation unit. * A local entity is not visible in other compilation units. @@ -103,18 +106,13 @@ typedef enum { */ ir_visibility_local, /** - * The entity is defined outside the compilation unit but potentially used - * here. - */ - ir_visibility_external, - /** - * This has the same semantic as visibility_local. Additionally the symbol is - * completely hidden from the linker (it only appears in the assembly). + * This has the same semantic as visibility_local. Additionally the symbol + * is completely hidden from the linker (it only appears in the assembly). * While visibility_local is probably still visible to debuggers, * visibility_private symbols aren't and probably won't appear in the object * files */ - ir_visibility_private + ir_visibility_private, } ir_visibility; /** @@ -157,7 +155,15 @@ typedef enum ir_linkage { * read/write behaviour to global variables or changing calling conventions * from cdecl to fastcall. */ - IR_LINKAGE_HIDDEN_USER = 1 << 4 + IR_LINKAGE_HIDDEN_USER = 1 << 4, + /** + * Do not generate code even if the entity has a graph attached. The graph + * is only used for inlining. Otherwise the entity is regarded as a + * declaration of an externally defined entity. + * This linkage flag can be used to implement C99 "inline" or GNU89 + * "extern inline". + */ + IR_LINKAGE_NO_CODEGEN = 1 << 5, } ir_linkage; ENUM_BITSET(ir_linkage) @@ -183,7 +189,8 @@ FIRM_API int entity_is_externally_visible(const ir_entity *entity); /** * Returns 1 if the entity has a definition (initializer) in the current - * compilation unit + * compilation unit. Note that this function returns false if + * IR_LINKAGE_NO_CODEGEN is set even if a graph is present. */ FIRM_API int entity_has_definition(const ir_entity *entity);