From 16c8cf0e11dd7f53d3a50609d5821f56e6b52c1a Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sat, 23 Feb 2013 00:26:28 +0000 Subject: Remove the hack that avoided mangling static functions in extern C contexts. Weather we should give C language linkage to functions and variables with internal linkage probably depends on how much code assumes it. The standard says they should have no language linkage, but gcc and msvc assign them C language linkage. This commit removes the hack that was preventing the mangling on static functions declare in extern C contexts. It is an experiment to see if we can implement the rules in the standard. If it turns out that many users depend on these functions and variables having C language linkage, we should change isExternC instead and try to convince the CWG to change the standard. llvm-svn: 175937 --- clang/lib/AST/ItaniumMangle.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'clang/lib/AST/ItaniumMangle.cpp') diff --git a/clang/lib/AST/ItaniumMangle.cpp b/clang/lib/AST/ItaniumMangle.cpp index d427b082a43..21c499317f5 100644 --- a/clang/lib/AST/ItaniumMangle.cpp +++ b/clang/lib/AST/ItaniumMangle.cpp @@ -385,15 +385,6 @@ bool ItaniumMangleContext::shouldMangleDeclName(const NamedDecl *D) { // C functions are not mangled. if (L == CLanguageLinkage) return false; - - // FIXME: Users assume they know the mangling of static functions - // declared in extern "C" contexts, so we cannot always mangle them. - // As an improvement, maybe we could mangle them only if they are actually - // overloaded. - const DeclContext *DC = FD->getDeclContext(); - if (!DC->isRecord() && - FD->getFirstDeclaration()->getDeclContext()->isExternCContext()) - return false; } // Otherwise, no mangling is done outside C++ mode. -- cgit v1.2.3