gecko-dev/build/build-clang/return-empty-string-non-mangled.patch
Mike Hommey 3cf7cce79c Bug 1262781 - Update to clang 3.8 final. r=froydnj
Ideally, we'd use the tarballs from
http://llvm.org/releases/download.html but I didn't feel like modifying
the script more than I already did to make it work at all (bug 1262735).

The new tarball for Linux was built on
https://tools.taskcluster.net/task-inspector/#LCUn8aEgTBeRJ11a3qTlDQ/0

The new tarball for Mac was built on a loaner, after installing cmake
and ninja, as well as building ld64 127.2 from source because the
installed version would assert while building clang. The latter required
manually adding some missing headers to /usr/include. TSAN was also
disabled because it requires APIs that are not available on the OSX
version on the build slaves (e.g. pthread_introspection_hook_install).
Building clang also required using a mac clang from tooltool, the system
one lacking support for atomics.
2016-04-13 06:54:22 +09:00

20 lines
659 B
Diff

Author: Michael Wu <mwu@mozilla.com>
Date: Thu Sep 24 11:36:08 2015 -0400
Return an empty string when a symbol isn't mangled
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -3990,6 +3990,10 @@
ASTContext &Ctx = ND->getASTContext();
std::unique_ptr<MangleContext> MC(Ctx.createMangleContext());
+ // Don't mangle if we don't need to.
+ if (!MC->shouldMangleCXXName(ND))
+ return cxstring::createEmpty();
+
std::string FrontendBuf;
llvm::raw_string_ostream FrontendBufOS(FrontendBuf);
if (MC->shouldMangleDeclName(ND)) {