OLD | NEW |
---|---|
(Empty) | |
1 // 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 | |
5 #include <unistd.h> | |
6 | |
7 // LLVM's demangler is large, and we have no need of it. Overriding it with | |
8 // our own stub version here stops a lot of code being pulled in from libc++. | |
9 // More here: | |
10 // https://llvm.org/svn/llvm-project/libcxxabi/trunk/src/cxa_demangle.cpp | |
11 extern "C" char* __cxa_demangle(const char* mangled_name, | |
12 char* buf, | |
13 size_t* n, | |
14 int* status) { | |
15 static const int kMemoryAllocFailure = -1; // LLVM's memory_alloc_failure. | |
rmcilroy
2015/06/26 12:43:49
Can we just do a CHECK(false) here instead? This w
simonb (inactive)
2015/06/26 15:00:09
I'm pretty sure we don't want to CHECK(false) here
rmcilroy
2015/06/29 09:24:18
Ok sounds good, thanks for the explanation.
| |
16 if (status) | |
17 *status = kMemoryAllocFailure; | |
18 return nullptr; | |
19 } | |
OLD | NEW |