Files
swift-mirror/include/swift/Basic/DemangleWrappers.h
Dan Raviv 29d76f3b68 Canonize swift header files headers and footers
- Added missing ifdef guard in PointerIntEnum header
- Consistent naming convention for ifdef guards
- Consistent 'end namespace swift'
- Consistent single EOL at end of header files
2016-03-23 09:04:12 +02:00

61 lines
1.8 KiB
C++

//===--- DemangleWrappers.h -------------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
///
/// \file
/// This file defines wrappers for the Swift demangler that use LLVM data
/// types.
///
//===----------------------------------------------------------------------===//
#ifndef SWIFT_BASIC_DEMANGLEWRAPPERS_H
#define SWIFT_BASIC_DEMANGLEWRAPPERS_H
#include "swift/Basic/Demangle.h"
#include "swift/Basic/LLVM.h"
#include "llvm/ADT/StringRef.h"
namespace swift {
namespace demangle_wrappers {
using swift::Demangle::Node;
using swift::Demangle::NodePointer;
using swift::Demangle::DemangleOptions;
class NodeDumper {
NodePointer Root;
public:
NodeDumper(NodePointer Root): Root(std::move(Root)) {}
void dump() const;
void print(llvm::raw_ostream &Out) const;
};
NodePointer
demangleSymbolAsNode(StringRef MangledName,
const DemangleOptions &Options = DemangleOptions());
std::string nodeToString(NodePointer Root,
const DemangleOptions &Options = DemangleOptions());
std::string
demangleSymbolAsString(StringRef MangledName,
const DemangleOptions &Options = DemangleOptions());
std::string
demangleTypeAsString(StringRef MangledTypeName,
const DemangleOptions &Options = DemangleOptions());
} // end namespace demangle_wrappers
} // end namespace swift
#endif // SWIFT_BASIC_DEMANGLEWRAPPERS_H