]> granicus.if.org Git - clang/commitdiff
Don't turn off mangling in implicitly extern "C" system headers. GCC
authorDouglas Gregor <dgregor@apple.com>
Sun, 7 Mar 2010 05:10:40 +0000 (05:10 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sun, 7 Mar 2010 05:10:40 +0000 (05:10 +0000)
doesn't do this on any of the major platforms, and we don't really
support any of the platforms that do (nor will we actually handle
those headers well). Fixes PR6217; see PR6530 for details on what we
would need to do to support these platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97899 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/Mangle.cpp
test/CodeGenCXX/mangle-system-header.cpp

index 20d54b34105dddad9cc9dac651794cd744cefaea..2e0580f5e79b2a170e08d56214be7bfae94ef270 100644 (file)
@@ -214,12 +214,6 @@ bool MangleContext::shouldMangleDeclName(const NamedDecl *D) {
   if (!getASTContext().getLangOptions().CPlusPlus)
     return false;
 
-  // No mangling in an "implicit extern C" header.
-  if (D->getLocation().isValid() &&
-      getASTContext().getSourceManager().
-      isInExternCSystemHeader(D->getLocation()))
-    return false;
-
   // Variables at global scope with non-internal linkage are not mangled
   if (!FD) {
     const DeclContext *DC = D->getDeclContext();
index cb68bc197600aac76222705262250ff633949470..6716b58926d722556b630f8485518d1c52598aa1 100644 (file)
@@ -5,3 +5,7 @@
 # 1 "fake_system_header.h" 1 3 4
 // CHECK: define void @_ZdlPvS_(
 void operator delete (void*, void*) {}
+
+// PR6217
+// CHECK: define void @_Z3barv() 
+void bar() { }