[cfe-commits] r97899 - in /cfe/trunk: lib/CodeGen/Mangle.cpp test/CodeGenCXX/mangle-system-header.cpp

Douglas Gregor dgregor at apple.com
Sat Mar 6 21:10:40 PST 2010


Author: dgregor
Date: Sat Mar  6 23:10:40 2010
New Revision: 97899

URL: http://llvm.org/viewvc/llvm-project?rev=97899&view=rev
Log:
Don't turn off mangling in implicitly extern "C" system headers. GCC
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.

Modified:
    cfe/trunk/lib/CodeGen/Mangle.cpp
    cfe/trunk/test/CodeGenCXX/mangle-system-header.cpp

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=97899&r1=97898&r2=97899&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Sat Mar  6 23:10:40 2010
@@ -214,12 +214,6 @@
   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();

Modified: cfe/trunk/test/CodeGenCXX/mangle-system-header.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/mangle-system-header.cpp?rev=97899&r1=97898&r2=97899&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/mangle-system-header.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/mangle-system-header.cpp Sat Mar  6 23:10:40 2010
@@ -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() { }





More information about the cfe-commits mailing list