Bugzilla – Bug 85
[llvmg++] Methods and functions in anonymous namespaces don't get internal linkage
Last modified: 2003-12-06 14:47:07
You need to log in before you can comment on or make changes to this bug.
The C++ front-end is horribly mangling the names of functions and methods in anonymous namespaces, but it doesn't actually get around to marking them internal. This prevents the optimizer from doing lots of neat things, and _explodes_ the size of some symbols. This is a "feature" of the G++ side of things. ugh. -Chris
I'm escalating this, because it prevents the LLVM optimizer from doing significant things at compile time.
This is finally fixed. The patch is monsterous and noone cares, so I'm not including it. -Chris
I applied this patch as well to reduce the size of identifiers in anonymous namespaces: $ diff -u decl.c~ decl.c --- decl.c~ 2003-08-27 16:55:52.000000000 -0500 +++ decl.c 2003-12-06 14:40:07.000000000 -0600 @@ -2053,7 +2086,12 @@ /* The name of anonymous namespace is unique for the translation unit. */ if (!anonymous_namespace_name) + if (!EMIT_LLVM) { anonymous_namespace_name = get_file_function_name ('N'); + } else { + anonymous_namespace_name = get_identifier ("_GLOBAL__N_"); + } + name = anonymous_namespace_name; d = IDENTIFIER_NAMESPACE_VALUE (name); if (d)