1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00
llvm-mirror/tools/llvm-cxxfilt/llvm-cxxfilt.cpp
Davide Italiano 5a9b476c7e [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.

llvm-svn: 282523
2016-09-27 18:50:30 +00:00

27 lines
758 B
C++

//===-- llvm-c++filt.cpp --------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
#include "llvm/Demangle/Demangle.h"
#include "llvm/Support/raw_ostream.h"
#include <stdlib.h>
using namespace llvm;
int main(int argc, char **argv) {
for (int I = 1; I < argc; ++I) {
const char *Mangled = argv[I];
int Status;
char *Demangled = itaniumDemangle(Mangled, nullptr, nullptr, &Status);
llvm::outs() << (Demangled ? Demangled : Mangled) << '\n';
free(Demangled);
}
return 0;
}