summaryrefslogtreecommitdiffstats
path: root/libcxxabi
diff options
context:
space:
mode:
authorEd Schouten <ed@nuxi.nl>2015-03-19 09:17:21 +0000
committerEd Schouten <ed@nuxi.nl>2015-03-19 09:17:21 +0000
commitd0c480b04c60d0288a44f56aa0d4e48d6bccf63f (patch)
treea8834407fa1bf844f0cd65de05dfbd2bb48bd249 /libcxxabi
parentaa27aadb14065375446299f34f7e86ceb5fddf5e (diff)
downloadbcm5719-llvm-d0c480b04c60d0288a44f56aa0d4e48d6bccf63f.tar.gz
bcm5719-llvm-d0c480b04c60d0288a44f56aa0d4e48d6bccf63f.zip
Don't print debugging messages to stdout.
There is some debugging code in cxa_demangle.cpp that prints messages on stdout. In general this is not safe, as the program itself may use stdout to write its output. Change this code to write to stderr. Differential Revision: http://reviews.llvm.org/D8167 llvm-svn: 232716
Diffstat (limited to 'libcxxabi')
-rw-r--r--libcxxabi/src/cxa_demangle.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/libcxxabi/src/cxa_demangle.cpp b/libcxxabi/src/cxa_demangle.cpp
index 1344f439f6a..789d57731be 100644
--- a/libcxxabi/src/cxa_demangle.cpp
+++ b/libcxxabi/src/cxa_demangle.cpp
@@ -55,51 +55,51 @@ template <class C>
void
print_stack(const C& db)
{
- printf("---------\n");
- printf("names:\n");
+ fprintf(stderr, "---------\n");
+ fprintf(stderr, "names:\n");
for (auto& s : db.names)
- printf("{%s#%s}\n", s.first.c_str(), s.second.c_str());
+ fprintf(stderr, "{%s#%s}\n", s.first.c_str(), s.second.c_str());
int i = -1;
- printf("subs:\n");
+ fprintf(stderr, "subs:\n");
for (auto& v : db.subs)
{
if (i >= 0)
- printf("S%i_ = {", i);
+ fprintf(stderr, "S%i_ = {", i);
else
- printf("S_ = {");
+ fprintf(stderr, "S_ = {");
for (auto& s : v)
- printf("{%s#%s}", s.first.c_str(), s.second.c_str());
- printf("}\n");
+ fprintf(stderr, "{%s#%s}", s.first.c_str(), s.second.c_str());
+ fprintf(stderr, "}\n");
++i;
}
- printf("template_param:\n");
+ fprintf(stderr, "template_param:\n");
for (auto& t : db.template_param)
{
- printf("--\n");
+ fprintf(stderr, "--\n");
i = -1;
for (auto& v : t)
{
if (i >= 0)
- printf("T%i_ = {", i);
+ fprintf(stderr, "T%i_ = {", i);
else
- printf("T_ = {");
+ fprintf(stderr, "T_ = {");
for (auto& s : v)
- printf("{%s#%s}", s.first.c_str(), s.second.c_str());
- printf("}\n");
+ fprintf(stderr, "{%s#%s}", s.first.c_str(), s.second.c_str());
+ fprintf(stderr, "}\n");
++i;
}
}
- printf("---------\n\n");
+ fprintf(stderr, "---------\n\n");
}
template <class C>
void
print_state(const char* msg, const char* first, const char* last, const C& db)
{
- printf("%s: ", msg);
+ fprintf(stderr, "%s: ", msg);
for (; first != last; ++first)
- printf("%c", *first);
- printf("\n");
+ fprintf(stderr, "%c", *first);
+ fprintf(stderr, "\n");
print_stack(db);
}
OpenPOWER on IntegriCloud