diff options
Diffstat (limited to 'lib/AST/ItaniumMangle.cpp')
-rw-r--r-- | lib/AST/ItaniumMangle.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 1f95a2fee0..d427b082a4 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -373,8 +373,8 @@ bool ItaniumMangleContext::shouldMangleDeclName(const NamedDecl *D) { if (FD->hasAttr<OverloadableAttr>()) return true; - // C functions and "main" are not mangled. - if (FD->isMain() || L == CLanguageLinkage) + // "main" is not mangled. + if (FD->isMain()) return false; // C++ functions and those whose names are not a simple identifier need @@ -382,6 +382,10 @@ bool ItaniumMangleContext::shouldMangleDeclName(const NamedDecl *D) { if (!FD->getDeclName().isIdentifier() || L == CXXLanguageLinkage) return true; + // 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 |