diff options
| author | Daniel Dunbar <daniel@zuster.org> | 2009-02-20 23:09:27 +0000 |
|---|---|---|
| committer | Daniel Dunbar <daniel@zuster.org> | 2009-02-20 23:09:27 +0000 |
| commit | 0c4eda59238fcf858acabe0b9be70d503e79ac33 (patch) | |
| tree | 02a63134ce7435b119dc11d378241070e9dac97f /clang/lib/CodeGen | |
| parent | 9e6fb740275364b38848db4f452f4c57869c353d (diff) | |
| download | bcm5719-llvm-0c4eda59238fcf858acabe0b9be70d503e79ac33.tar.gz bcm5719-llvm-0c4eda59238fcf858acabe0b9be70d503e79ac33.zip | |
We must always mangle attribute overloadable functions; even if in a
system header.
- Prevents a codegen crash when anything used anything in tgmath! :)
llvm-svn: 65200
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/Mangle.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/Mangle.cpp b/clang/lib/CodeGen/Mangle.cpp index f007539714c..f310e989b51 100644 --- a/clang/lib/CodeGen/Mangle.cpp +++ b/clang/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. |

