LLVM  4.0.0
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
}
 

Functions

template<class C >
static const char * parse_type (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_encoding (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_name (const char *first, const char *last, C &db, bool *ends_with_template_args=0)
 
template<class C >
static const char * parse_expression (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_template_args (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_operator_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_unqualified_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_decltype (const char *first, const char *last, C &db)
 
static const char * parse_number (const char *first, const char *last)
 
template<class Float , class C >
static const char * parse_floating_number (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_source_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_substitution (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_builtin_type (const char *first, const char *last, C &db)
 
static const char * parse_cv_qualifiers (const char *first, const char *last, unsigned &cv)
 
template<class C >
static const char * parse_template_param (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_const_cast_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_dynamic_cast_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_reinterpret_cast_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_static_cast_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_pack_expansion (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_sizeof_type_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_sizeof_expr_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_sizeof_param_pack_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_function_param (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_sizeof_function_param_pack_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_typeid_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_throw_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_dot_star_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_simple_id (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_unresolved_type (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_destructor_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_base_unresolved_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_unresolved_qualifier_level (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_unresolved_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_dot_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_call_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_new_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_conversion_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_arrow_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_function_type (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_pointer_to_member_type (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_array_type (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_vector_type (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_integer_literal (const char *first, const char *last, const std::string &lit, C &db)
 
template<class C >
static const char * parse_expr_primary (const char *first, const char *last, C &db)
 
static std::string base_name (std::string &s)
 
template<class C >
static const char * parse_ctor_dtor_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_unnamed_type_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_unscoped_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_alignof_type (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_alignof_expr (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_noexcept_expression (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_prefix_expression (const char *first, const char *last, const std::string &op, C &db)
 
template<class C >
static const char * parse_binary_expression (const char *first, const char *last, const std::string &op, C &db)
 
template<class C >
static const char * parse_template_arg (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_nested_name (const char *first, const char *last, C &db, bool *ends_with_template_args)
 
static const char * parse_discriminator (const char *first, const char *last)
 
template<class C >
static const char * parse_local_name (const char *first, const char *last, C &db, bool *ends_with_template_args)
 
static const char * parse_call_offset (const char *first, const char *last)
 
template<class C >
static const char * parse_special_name (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_block_invoke (const char *first, const char *last, C &db)
 
template<class C >
static const char * parse_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
Enumerator
unknown_error 
invalid_args 
invalid_mangled_name 
memory_alloc_failure 
success 

Definition at line 31 of file ItaniumDemangle.cpp.

Function Documentation

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

Definition at line 2474 of file ItaniumDemangle.cpp.

Referenced by parse_ctor_dtor_name().

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

Definition at line 2766 of file ItaniumDemangle.cpp.

References parse_expression(), and t.

Referenced by parse_expression().

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

Definition at line 2748 of file ItaniumDemangle.cpp.

References parse_type(), and t.

Referenced by parse_expression().

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

Definition at line 1489 of file ItaniumDemangle.cpp.

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

Referenced by parse_type().

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

Definition at line 1356 of file ItaniumDemangle.cpp.

References parse_expression(), and t.

Referenced by parse_expression().

template<class C >
static const char* parse_base_unresolved_name ( const char *  first,
const char *  last,
C db 
)
static
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 2808 of file ItaniumDemangle.cpp.

References parse_expression().

Referenced by parse_expression().

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

Definition at line 4104 of file ItaniumDemangle.cpp.

References i, and t.

Referenced by demangle().

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

Definition at line 292 of file ItaniumDemangle.cpp.

References parse_source_name(), and t.

Referenced by parse_type().

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

Definition at line 1138 of file ItaniumDemangle.cpp.

References parse_expression(), and t.

Referenced by parse_expression().

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

Definition at line 3795 of file ItaniumDemangle.cpp.

References parse_number(), and t.

Referenced by parse_special_name().

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

Definition at line 503 of file ItaniumDemangle.cpp.

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

Referenced by parse_expression().

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

Definition at line 1299 of file ItaniumDemangle.cpp.

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

Referenced by parse_expression().

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

Definition at line 2532 of file ItaniumDemangle.cpp.

References base_name().

Referenced by parse_unqualified_name().

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

Definition at line 434 of file ItaniumDemangle.cpp.

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

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

Definition at line 1544 of file ItaniumDemangle.cpp.

References parse_expression(), and t.

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

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

Definition at line 879 of file ItaniumDemangle.cpp.

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

Referenced by parse_base_unresolved_name().

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

Definition at line 3619 of file ItaniumDemangle.cpp.

Referenced by parse_local_name().

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

Definition at line 1115 of file ItaniumDemangle.cpp.

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

Referenced by parse_expression().

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

Definition at line 778 of file ItaniumDemangle.cpp.

References parse_expression(), and t.

Referenced by parse_expression().

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

Definition at line 4136 of file ItaniumDemangle.cpp.

Referenced by demangle().

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

Definition at line 529 of file ItaniumDemangle.cpp.

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

Referenced by parse_expression().

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

Definition at line 116 of file ItaniumDemangle.cpp.

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

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

Definition at line 1382 of file ItaniumDemangle.cpp.

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

Referenced by parse_type().

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 2296 of file ItaniumDemangle.cpp.

References parse_number(), and t.

Referenced by parse_expr_primary().

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 3651 of file ItaniumDemangle.cpp.

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

Referenced by 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
template<class C >
static const char* parse_nested_name ( const char *  first,
const char *  last,
C db,
bool ends_with_template_args 
)
static
template<class C >
static const char* parse_new_expr ( const char *  first,
const char *  last,
C db 
)
static

Definition at line 1189 of file ItaniumDemangle.cpp.

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

Referenced by parse_expression().

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

Definition at line 2781 of file ItaniumDemangle.cpp.

References parse_expression().

Referenced by parse_expression().

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

Definition at line 2020 of file ItaniumDemangle.cpp.

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

Referenced by parse_base_unresolved_name(), and parse_unqualified_name().

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

Definition at line 604 of file ItaniumDemangle.cpp.

References parse_expression(), and t.

Referenced by parse_expression().

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

Definition at line 1457 of file ItaniumDemangle.cpp.

References parse_type(), and t.

Referenced by parse_type().

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 2794 of file ItaniumDemangle.cpp.

References parse_expression().

Referenced by parse_expression().

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

Definition at line 555 of file ItaniumDemangle.cpp.

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

Referenced by parse_expression().

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

Definition at line 634 of file ItaniumDemangle.cpp.

References parse_expression(), and t.

Referenced by parse_expression().

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

Definition at line 719 of file ItaniumDemangle.cpp.

References parse_function_param(), and t.

Referenced by parse_expression().

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

Definition at line 617 of file ItaniumDemangle.cpp.

References parse_type(), and t.

Referenced by parse_expression().

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

Definition at line 581 of file ItaniumDemangle.cpp.

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

Referenced by parse_expression().

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

Definition at line 192 of file ItaniumDemangle.cpp.

References sub(), and t.

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

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

Definition at line 761 of file ItaniumDemangle.cpp.

References parse_expression(), and t.

Referenced by parse_expression().

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

Definition at line 739 of file ItaniumDemangle.cpp.

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

Referenced by parse_expression().

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

Definition at line 2578 of file ItaniumDemangle.cpp.

References parse_type(), and t0.

Referenced by parse_unqualified_name().

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

Definition at line 958 of file ItaniumDemangle.cpp.

References parse_simple_id().

Referenced by parse_unresolved_name().

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

Definition at line 2721 of file ItaniumDemangle.cpp.

References parse_unqualified_name(), and t0.

Referenced by parse_name().

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

Definition at line 1570 of file ItaniumDemangle.cpp.

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

Referenced by parse_type().