blob: 18297284373b75c59e72c21625e955b5dd9cac1c [file] [log] [blame]
simonb0e736a82015-06-30 11:34:311// Copyright 2015 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
avib30f2402015-12-24 03:43:285#include <stddef.h>
simonb0e736a82015-06-30 11:34:316#include <unistd.h>
7
8// LLVM's demangler is large, and we have no need of it. Overriding it with
9// our own stub version here stops a lot of code being pulled in from libc++.
10// More here:
11// https://llvm.org/svn/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp
12extern "C" char* __cxa_demangle(const char* mangled_name,
13 char* buf,
14 size_t* n,
15 int* status) {
16 static const int kMemoryAllocFailure = -1; // LLVM's memory_alloc_failure.
17 if (status)
18 *status = kMemoryAllocFailure;
19 return nullptr;
20}