[llvm-cxxfilt] Use llvm::outs(). Simplify.

This adds a dependency on Support/. As llvm-cxxfilt will grow
support for options this will be needed anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282523 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Davide Italiano 2016-09-27 18:50:30 +00:00
parent 93aa89c478
commit d370d4d137
2 changed files with 3 additions and 5 deletions

View File

@ -1,5 +1,6 @@
set(LLVM_LINK_COMPONENTS
Demangle
Support
)
add_llvm_tool(llvm-cxxfilt

View File

@ -8,8 +8,8 @@
//===----------------------------------------------------------------------===//
#include "llvm/Demangle/Demangle.h"
#include "llvm/Support/raw_ostream.h"
#include <stdio.h>
#include <stdlib.h>
using namespace llvm;
@ -19,10 +19,7 @@ int main(int argc, char **argv) {
const char *Mangled = argv[I];
int Status;
char *Demangled = itaniumDemangle(Mangled, nullptr, nullptr, &Status);
if (Demangled)
printf("%s\n", Demangled);
else
printf("%s\n", Mangled);
llvm::outs() << (Demangled ? Demangled : Mangled) << '\n';
free(Demangled);
}
return 0;