summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Demangle/MicrosoftDemangle.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2018-11-11 10:04:00 +0000
committerNico Weber <nicolasweber@gmx.de>2018-11-11 10:04:00 +0000
commit6808bc0f45579c454e9699f6e8ee097d51bbdfe9 (patch)
tree9410c24060ddcd0dfc75435b1e5f9b154957d6da /llvm/lib/Demangle/MicrosoftDemangle.cpp
parent2eab39f77b7c7a51d2623176e602b5b8b9e05272 (diff)
downloadbcm5719-llvm-6808bc0f45579c454e9699f6e8ee097d51bbdfe9.tar.gz
bcm5719-llvm-6808bc0f45579c454e9699f6e8ee097d51bbdfe9.zip
Make initializeOutputStream() return false on error and true on success.
As discussed in https://reviews.llvm.org/D52104 Differential Revision: https://reviews.llvm.org/D52143 llvm-svn: 346606
Diffstat (limited to 'llvm/lib/Demangle/MicrosoftDemangle.cpp')
-rw-r--r--llvm/lib/Demangle/MicrosoftDemangle.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/lib/Demangle/MicrosoftDemangle.cpp b/llvm/lib/Demangle/MicrosoftDemangle.cpp
index 882e4a57845..4a45bfa8b32 100644
--- a/llvm/lib/Demangle/MicrosoftDemangle.cpp
+++ b/llvm/lib/Demangle/MicrosoftDemangle.cpp
@@ -874,7 +874,7 @@ void Demangler::memorizeIdentifier(IdentifierNode *Identifier) {
// Render this class template name into a string buffer so that we can
// memorize it for the purpose of back-referencing.
OutputStream OS;
- if (initializeOutputStream(nullptr, nullptr, OS, 1024))
+ if (!initializeOutputStream(nullptr, nullptr, OS, 1024))
// FIXME: Propagate out-of-memory as an error?
std::terminate();
Identifier->output(OS, OF_Default);
@@ -1207,7 +1207,7 @@ Demangler::demangleStringLiteral(StringView &MangledName) {
if (MangledName.empty())
goto StringLiteralError;
- if (initializeOutputStream(nullptr, nullptr, OS, 1024))
+ if (!initializeOutputStream(nullptr, nullptr, OS, 1024))
// FIXME: Propagate out-of-memory as an error?
std::terminate();
if (IsWcharT) {
@@ -1330,7 +1330,7 @@ Demangler::demangleLocallyScopedNamePiece(StringView &MangledName) {
// Render the parent symbol's name into a buffer.
OutputStream OS;
- if (initializeOutputStream(nullptr, nullptr, OS, 1024))
+ if (!initializeOutputStream(nullptr, nullptr, OS, 1024))
// FIXME: Propagate out-of-memory as an error?
std::terminate();
OS << '`';
@@ -2156,7 +2156,7 @@ void Demangler::dumpBackReferences() {
// Create an output stream so we can render each type.
OutputStream OS;
- if (initializeOutputStream(nullptr, nullptr, OS, 1024))
+ if (!initializeOutputStream(nullptr, nullptr, OS, 1024))
std::terminate();
for (size_t I = 0; I < Backrefs.FunctionParamCount; ++I) {
OS.setCurrentPosition(0);
@@ -2194,7 +2194,7 @@ char *llvm::microsoftDemangle(const char *MangledName, char *Buf, size_t *N,
if (D.Error)
InternalStatus = demangle_invalid_mangled_name;
- else if (initializeOutputStream(Buf, N, S, 1024))
+ else if (!initializeOutputStream(Buf, N, S, 1024))
InternalStatus = demangle_memory_alloc_failure;
else {
AST->output(S, OF_Default);
OpenPOWER on IntegriCloud