LLVM  6.0.0svn
Enumerations | Functions
ItaniumDemangle.cpp File Reference
#include "llvm/Demangle/Demangle.h"
#include <algorithm>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <string>
#include <vector>
Include dependency graph for ItaniumDemangle.cpp:

Go to the source code of this file.

Enumerations

enum  {
  unknown_error = -4, invalid_args = -3, invalid_mangled_name, memory_alloc_failure,
  success
}
 
enum  { CV_const = (1 << 0), CV_volatile = (1 << 1), CV_restrict = (1 << 2) }
 

Functions

template<class C >
static const charparse_type (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_encoding (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_name (const char *first, const char *last, C &db, bool *ends_with_template_args=0)
 
template<class C >
static const charparse_expression (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_template_args (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_operator_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_unqualified_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_decltype (const char *first, const char *last, C &db)
 
static const charparse_number (const char *first, const char *last)
 
template<class Float , class C >
static const charparse_floating_number (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_source_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_substitution (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_builtin_type (const char *first, const char *last, C &db)
 
static const charparse_cv_qualifiers (const char *first, const char *last, unsigned &cv)
 
template<class C >
static const charparse_template_param (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_const_cast_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_dynamic_cast_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_reinterpret_cast_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_static_cast_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_pack_expansion (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_sizeof_type_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_sizeof_expr_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_sizeof_param_pack_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_function_param (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_sizeof_function_param_pack_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_typeid_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_throw_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_dot_star_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_simple_id (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_unresolved_type (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_destructor_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_base_unresolved_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_unresolved_qualifier_level (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_unresolved_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_dot_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_call_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_new_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_conversion_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_arrow_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_function_type (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_pointer_to_member_type (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_array_type (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_vector_type (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_integer_literal (const char *first, const char *last, const std::string &lit, C &db)
 
template<class C >
static const charparse_expr_primary (const char *first, const char *last, C &db)
 
static std::string base_name (std::string &s)
 
template<class C >
static const charparse_ctor_dtor_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_unnamed_type_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_unscoped_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_alignof_type (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_alignof_expr (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_noexcept_expression (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_prefix_expression (const char *first, const char *last, const std::string &op, C &db)
 
template<class C >
static const charparse_binary_expression (const char *first, const char *last, const std::string &op, C &db)
 
template<class C >
static const charparse_template_arg (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_nested_name (const char *first, const char *last, C &db, bool *ends_with_template_args)
 
static const charparse_discriminator (const char *first, const char *last)
 
template<class C >
static const charparse_local_name (const char *first, const char *last, C &db, bool *ends_with_template_args)
 
static const charparse_call_offset (const char *first, const char *last)
 
template<class C >
static const charparse_special_name (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_block_invoke (const char *first, const char *last, C &db)
 
template<class C >
static const charparse_dot_suffix (const char *first, const char *last, C &db)
 
template<class C >
static void demangle (const char *first, const char *last, C &db, int &status)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
unknown_error 
invalid_args 
invalid_mangled_name 
memory_alloc_failure 
success 

Definition at line 31 of file ItaniumDemangle.cpp.

◆ anonymous enum

anonymous enum
Enumerator
CV_const 
CV_volatile 
CV_restrict 

Definition at line 39 of file ItaniumDemangle.cpp.

Function Documentation

◆ base_name()

static std::string base_name ( std::string &  s)
static

Definition at line 2484 of file ItaniumDemangle.cpp.

Referenced by parse_ctor_dtor_name().

◆ demangle()

template<class C >
static void demangle ( const char first,
const char last,
C db,
int &  status 
)
static

◆ parse_alignof_expr()

template<class C >
static const char* parse_alignof_expr ( const char first,
const char last,
C db 
)
static

Definition at line 2785 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_alignof_type()

template<class C >
static const char* parse_alignof_type ( const char first,
const char last,
C db 
)
static

Definition at line 2767 of file ItaniumDemangle.cpp.

References first, and parse_type().

Referenced by parse_expression().

◆ parse_array_type()

template<class C >
static const char* parse_array_type ( const char first,
const char last,
C db 
)
static

Definition at line 1496 of file ItaniumDemangle.cpp.

References first, parse_expression(), parse_number(), and parse_type().

Referenced by parse_type().

◆ parse_arrow_expr()

template<class C >
static const char* parse_arrow_expr ( const char first,
const char last,
C db 
)
static

Definition at line 1362 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_base_unresolved_name()

template<class C >
static const char* parse_base_unresolved_name ( const char first,
const char last,
C db 
)
static

◆ parse_binary_expression()

template<class C >
static const char* parse_binary_expression ( const char first,
const char last,
const std::string &  op,
C db 
)
static

Definition at line 2827 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_block_invoke()

template<class C >
static const char* parse_block_invoke ( const char first,
const char last,
C db 
)
static

Definition at line 4148 of file ItaniumDemangle.cpp.

References first.

Referenced by demangle().

◆ parse_builtin_type()

template<class C >
static const char* parse_builtin_type ( const char first,
const char last,
C db 
)
static

Definition at line 298 of file ItaniumDemangle.cpp.

References first, and parse_source_name().

Referenced by parse_type().

◆ parse_call_expr()

template<class C >
static const char* parse_call_expr ( const char first,
const char last,
C db 
)
static

Definition at line 1144 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_call_offset()

static const char* parse_call_offset ( const char first,
const char last 
)
static

Definition at line 3814 of file ItaniumDemangle.cpp.

References first, and parse_number().

Referenced by parse_special_name().

◆ parse_const_cast_expr()

template<class C >
static const char* parse_const_cast_expr ( const char first,
const char last,
C db 
)
static

Definition at line 509 of file ItaniumDemangle.cpp.

References first, parse_expression(), and parse_type().

Referenced by parse_expression().

◆ parse_conversion_expr()

template<class C >
static const char* parse_conversion_expr ( const char first,
const char last,
C db 
)
static

Definition at line 1305 of file ItaniumDemangle.cpp.

References first, parse_expression(), and parse_type().

Referenced by parse_expression().

◆ parse_ctor_dtor_name()

template<class C >
static const char* parse_ctor_dtor_name ( const char first,
const char last,
C db 
)
static

Definition at line 2545 of file ItaniumDemangle.cpp.

References base_name(), and first.

Referenced by parse_unqualified_name().

◆ parse_cv_qualifiers()

static const char* parse_cv_qualifiers ( const char first,
const char last,
unsigned cv 
)
static

Definition at line 440 of file ItaniumDemangle.cpp.

References CV_const, CV_restrict, CV_volatile, and first.

Referenced by parse_function_param(), parse_nested_name(), and parse_type().

◆ parse_decltype()

template<class C >
static const char * parse_decltype ( const char first,
const char last,
C db 
)
static

Definition at line 1551 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_nested_name(), parse_type(), and parse_unresolved_type().

◆ parse_destructor_name()

template<class C >
static const char* parse_destructor_name ( const char first,
const char last,
C db 
)
static

Definition at line 885 of file ItaniumDemangle.cpp.

References first, parse_simple_id(), and parse_unresolved_type().

Referenced by parse_base_unresolved_name().

◆ parse_discriminator()

static const char* parse_discriminator ( const char first,
const char last 
)
static

Definition at line 3638 of file ItaniumDemangle.cpp.

References first.

Referenced by parse_local_name().

◆ parse_dot_expr()

template<class C >
static const char* parse_dot_expr ( const char first,
const char last,
C db 
)
static

Definition at line 1121 of file ItaniumDemangle.cpp.

References first, name, parse_expression(), and parse_unresolved_name().

Referenced by parse_expression().

◆ parse_dot_star_expr()

template<class C >
static const char* parse_dot_star_expr ( const char first,
const char last,
C db 
)
static

Definition at line 784 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_dot_suffix()

template<class C >
static const char* parse_dot_suffix ( const char first,
const char last,
C db 
)
static

Definition at line 4180 of file ItaniumDemangle.cpp.

References first.

Referenced by demangle().

◆ parse_dynamic_cast_expr()

template<class C >
static const char* parse_dynamic_cast_expr ( const char first,
const char last,
C db 
)
static

Definition at line 535 of file ItaniumDemangle.cpp.

References first, parse_expression(), and parse_type().

Referenced by parse_expression().

◆ parse_encoding()

template<class C >
static const char * parse_encoding ( const char first,
const char last,
C db 
)
static

◆ parse_expr_primary()

template<class C >
static const char* parse_expr_primary ( const char first,
const char last,
C db 
)
static

◆ parse_expression()

template<class C >
static const char * parse_expression ( const char first,
const char last,
C db 
)
static

◆ parse_floating_number()

template<class Float , class C >
static const char* parse_floating_number ( const char first,
const char last,
C db 
)
static

Definition at line 122 of file ItaniumDemangle.cpp.

References first, llvm::NVPTX::PTXLdStInstCode::Float, N, and llvm::reverse().

◆ parse_function_param()

template<class C >
static const char* parse_function_param ( const char first,
const char last,
C db 
)
static

◆ parse_function_type()

template<class C >
static const char* parse_function_type ( const char first,
const char last,
C db 
)
static

Definition at line 1388 of file ItaniumDemangle.cpp.

References first, llvm::hashing::detail::k0, llvm::hashing::detail::k1, and parse_type().

Referenced by parse_type().

◆ parse_integer_literal()

template<class C >
static const char* parse_integer_literal ( const char first,
const char last,
const std::string &  lit,
C db 
)
static

Definition at line 2306 of file ItaniumDemangle.cpp.

References first, and parse_number().

Referenced by parse_expr_primary().

◆ parse_local_name()

template<class C >
static const char* parse_local_name ( const char first,
const char last,
C db,
bool ends_with_template_args 
)
static

Definition at line 3670 of file ItaniumDemangle.cpp.

References first, name, parse_discriminator(), parse_encoding(), parse_name(), and parse_number().

Referenced by parse_name().

◆ parse_name()

template<class C >
static const char * parse_name ( const char first,
const char last,
C db,
bool ends_with_template_args = 0 
)
static

◆ parse_nested_name()

template<class C >
static const char* parse_nested_name ( const char first,
const char last,
C db,
bool ends_with_template_args 
)
static

◆ parse_new_expr()

template<class C >
static const char* parse_new_expr ( const char first,
const char last,
C db 
)
static

Definition at line 1195 of file ItaniumDemangle.cpp.

References first, parse_expression(), and parse_type().

Referenced by parse_expression().

◆ parse_noexcept_expression()

template<class C >
static const char* parse_noexcept_expression ( const char first,
const char last,
C db 
)
static

Definition at line 2800 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_number()

static const char* parse_number ( const char first,
const char last 
)
static

◆ parse_operator_name()

template<class C >
static const char * parse_operator_name ( const char first,
const char last,
C db 
)
static

Definition at line 2030 of file ItaniumDemangle.cpp.

References first, parse_source_name(), and parse_type().

Referenced by parse_base_unresolved_name(), and parse_unqualified_name().

◆ parse_pack_expansion()

template<class C >
static const char* parse_pack_expansion ( const char first,
const char last,
C db 
)
static

Definition at line 610 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_pointer_to_member_type()

template<class C >
static const char* parse_pointer_to_member_type ( const char first,
const char last,
C db 
)
static

Definition at line 1464 of file ItaniumDemangle.cpp.

References first, and parse_type().

Referenced by parse_type().

◆ parse_prefix_expression()

template<class C >
static const char* parse_prefix_expression ( const char first,
const char last,
const std::string &  op,
C db 
)
static

Definition at line 2813 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_reinterpret_cast_expr()

template<class C >
static const char* parse_reinterpret_cast_expr ( const char first,
const char last,
C db 
)
static

Definition at line 561 of file ItaniumDemangle.cpp.

References first, parse_expression(), and parse_type().

Referenced by parse_expression().

◆ parse_simple_id()

template<class C >
static const char* parse_simple_id ( const char first,
const char last,
C db 
)
static

◆ parse_sizeof_expr_expr()

template<class C >
static const char* parse_sizeof_expr_expr ( const char first,
const char last,
C db 
)
static

Definition at line 640 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_sizeof_function_param_pack_expr()

template<class C >
static const char* parse_sizeof_function_param_pack_expr ( const char first,
const char last,
C db 
)
static

Definition at line 725 of file ItaniumDemangle.cpp.

References first, and parse_function_param().

Referenced by parse_expression().

◆ parse_sizeof_param_pack_expr()

template<class C >
static const char* parse_sizeof_param_pack_expr ( const char first,
const char last,
C db 
)
static

◆ parse_sizeof_type_expr()

template<class C >
static const char* parse_sizeof_type_expr ( const char first,
const char last,
C db 
)
static

Definition at line 623 of file ItaniumDemangle.cpp.

References first, and parse_type().

Referenced by parse_expression().

◆ parse_source_name()

template<class C >
static const char* parse_source_name ( const char first,
const char last,
C db 
)
static

◆ parse_special_name()

template<class C >
static const char* parse_special_name ( const char first,
const char last,
C db 
)
static

◆ parse_static_cast_expr()

template<class C >
static const char* parse_static_cast_expr ( const char first,
const char last,
C db 
)
static

Definition at line 587 of file ItaniumDemangle.cpp.

References first, parse_expression(), and parse_type().

Referenced by parse_expression().

◆ parse_substitution()

template<class C >
static const char* parse_substitution ( const char first,
const char last,
C db 
)
static

Definition at line 198 of file ItaniumDemangle.cpp.

References first, and llvm::ARM_AM::sub.

Referenced by parse_name(), parse_nested_name(), parse_type(), and parse_unresolved_type().

◆ parse_template_arg()

template<class C >
static const char* parse_template_arg ( const char first,
const char last,
C db 
)
static

◆ parse_template_args()

template<class C >
static const char * parse_template_args ( const char first,
const char last,
C db 
)
static

◆ parse_template_param()

template<class C >
static const char* parse_template_param ( const char first,
const char last,
C db 
)
static

◆ parse_throw_expr()

template<class C >
static const char* parse_throw_expr ( const char first,
const char last,
C db 
)
static

Definition at line 767 of file ItaniumDemangle.cpp.

References first, and parse_expression().

Referenced by parse_expression().

◆ parse_type()

template<class C >
static const char * parse_type ( const char first,
const char last,
C db 
)
static

◆ parse_typeid_expr()

template<class C >
static const char* parse_typeid_expr ( const char first,
const char last,
C db 
)
static

Definition at line 745 of file ItaniumDemangle.cpp.

References first, parse_expression(), and parse_type().

Referenced by parse_expression().

◆ parse_unnamed_type_name()

template<class C >
static const char* parse_unnamed_type_name ( const char first,
const char last,
C db 
)
static

◆ parse_unqualified_name()

template<class C >
static const char * parse_unqualified_name ( const char first,
const char last,
C db 
)
static

◆ parse_unresolved_name()

template<class C >
static const char* parse_unresolved_name ( const char first,
const char last,
C db 
)
static

◆ parse_unresolved_qualifier_level()

template<class C >
static const char* parse_unresolved_qualifier_level ( const char first,
const char last,
C db 
)
static

Definition at line 964 of file ItaniumDemangle.cpp.

References parse_simple_id().

Referenced by parse_unresolved_name().

◆ parse_unresolved_type()

template<class C >
static const char* parse_unresolved_type ( const char first,
const char last,
C db 
)
static

◆ parse_unscoped_name()

template<class C >
static const char* parse_unscoped_name ( const char first,
const char last,
C db 
)
static

Definition at line 2740 of file ItaniumDemangle.cpp.

References first, and parse_unqualified_name().

Referenced by parse_name().

◆ parse_vector_type()

template<class C >
static const char* parse_vector_type ( const char first,
const char last,
C db 
)
static

Definition at line 1577 of file ItaniumDemangle.cpp.

References first, parse_expression(), parse_number(), and parse_type().

Referenced by parse_type().