aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/Mangle.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-02-20 23:09:27 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-02-20 23:09:27 +0000
commit524ed953823ee605793c93452a2f86e4a7c4a2fe (patch)
treecf986e4e374838f577de6764b22dd62a6a3ab2a0 /lib/CodeGen/Mangle.cpp
parentccef371a67756233aa97770e4fccdfa868b3e2d0 (diff)
We must always mangle attribute overloadable functions; even if in a
system header. - Prevents a codegen crash when anything used anything in tgmath! :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65200 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/Mangle.cpp')
-rw-r--r--lib/CodeGen/Mangle.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/Mangle.cpp b/lib/CodeGen/Mangle.cpp
index f007539714..f310e989b5 100644
--- a/lib/CodeGen/Mangle.cpp
+++ b/lib/CodeGen/Mangle.cpp
@@ -62,14 +62,14 @@ bool CXXNameMangler::mangle(const NamedDecl *D) {
// FIXME: Actually use a visitor to decode these?
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
bool RequiresMangling = false;
- // No mangled in an "implicit extern C" header.
- if (Context.getSourceManager().getFileCharacteristic(FD->getLocation())
- == SrcMgr::C_ExternCSystem)
- RequiresMangling = false;
// Clang's "overloadable" attribute extension to C/C++ implies
// name mangling (always).
- else if (FD->getAttr<OverloadableAttr>())
+ if (FD->getAttr<OverloadableAttr>())
RequiresMangling = true;
+ // No mangled in an "implicit extern C" header.
+ else if (Context.getSourceManager().getFileCharacteristic(FD->getLocation())
+ == SrcMgr::C_ExternCSystem)
+ RequiresMangling = false;
else if (Context.getLangOptions().CPlusPlus) {
// C++ requires name mangling, unless we're in a C linkage
// specification.