1 // Copyright 2018 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include <stddef.h> 6 7 #include <__cxxabi_config.h> 8 9 extern "C" 10 // LLVM's demangler is large, and we have no need of it. Overriding it with 11 // our own stub version here stops a lot of code being pulled in from libc++. 12 // More here: 13 // https://llvm.org/svn/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp 14 _LIBCXXABI_FUNC_VIS 15 // This is a weak symbol to let android_crazy_linker override it in 16 // //base/android/linker:chromium_android_linker. __cxa_demangle(const char * mangled_name,char * buf,size_t * n,int * status)17_LIBCXXABI_WEAK char* __cxa_demangle(const char* mangled_name, 18 char* buf, 19 size_t* n, 20 int* status) { 21 static const int kMemoryAllocFailure = -1; // LLVM's memory_alloc_failure. 22 if (status) 23 *status = kMemoryAllocFailure; 24 return nullptr; 25 } 26