LLVM  5.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
}
 
enum  { CV_const = (1 << 0), CV_volatile = (1 << 1), CV_restrict = (1 << 2) }
 

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.

anonymous enum
Enumerator
CV_const 
CV_volatile 
CV_restrict 

Definition at line 39 of file ItaniumDemangle.cpp.

Function Documentation

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

Definition at line 2484 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 2785 of file ItaniumDemangle.cpp.

References first, 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 2767 of file ItaniumDemangle.cpp.

References first, 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 1496 of file ItaniumDemangle.cpp.

References first, 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 1362 of file ItaniumDemangle.cpp.

References first, 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 2827 of file ItaniumDemangle.cpp.

References first, and 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 4148 of file ItaniumDemangle.cpp.

References first, 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 298 of file ItaniumDemangle.cpp.

References first, 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 1144 of file ItaniumDemangle.cpp.

References first, parse_expression(), and t.

Referenced by parse_expression().

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

Definition at line 3814 of file ItaniumDemangle.cpp.

References first, 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 509 of file ItaniumDemangle.cpp.

References first, 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 1305 of file ItaniumDemangle.cpp.

References first, 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 2545 of file ItaniumDemangle.cpp.

References base_name(), and first.

Referenced by parse_unqualified_name().

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().

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

References first, 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 3638 of file ItaniumDemangle.cpp.

References first.

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

References first, 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 784 of file ItaniumDemangle.cpp.

References first, 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 4180 of file ItaniumDemangle.cpp.

References first.

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

References first, 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 122 of file ItaniumDemangle.cpp.

References first, 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 1388 of file ItaniumDemangle.cpp.

References first, 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 2306 of file ItaniumDemangle.cpp.

References first, 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 3670 of file ItaniumDemangle.cpp.

References first, 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 1195 of file ItaniumDemangle.cpp.

References first, 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 2800 of file ItaniumDemangle.cpp.

References first, and 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 2030 of file ItaniumDemangle.cpp.

References first, 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 610 of file ItaniumDemangle.cpp.

References first, 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 1464 of file ItaniumDemangle.cpp.

References first, 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 2813 of file ItaniumDemangle.cpp.

References first, and 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 561 of file ItaniumDemangle.cpp.

References first, 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 640 of file ItaniumDemangle.cpp.

References first, 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 725 of file ItaniumDemangle.cpp.

References first, 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 623 of file ItaniumDemangle.cpp.

References first, 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 587 of file ItaniumDemangle.cpp.

References first, 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 198 of file ItaniumDemangle.cpp.

References first, llvm::ARM_AM::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 767 of file ItaniumDemangle.cpp.

References first, 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 745 of file ItaniumDemangle.cpp.

References first, 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
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 964 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 2740 of file ItaniumDemangle.cpp.

References first, 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 1577 of file ItaniumDemangle.cpp.

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

Referenced by parse_type().