-
-
Notifications
You must be signed in to change notification settings - Fork 9
C++ Demangler Rewrite #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
b1llow
wants to merge
275
commits into
main
Choose a base branch
from
update-cpp-demangle
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
275 commits
Select commit
Hold shift + click to select a range
723ceb6
feat: add AST node structure and associated functions for demangling
b1llow 654d844
refactor: update match rules to use DemAstNode and return boolean values
b1llow a8fa2af
feat: enhance demangling rules with new AST node handling and improve…
b1llow d3dfd18
fix: ensure proper deinitialization of DemAstNode children in destructor
b1llow decfef0
fix: correct deinitialization calls and enhance rule definitions in d…
b1llow 38fd3dd
feat: improve nested name handling and streamline rule matching in de…
b1llow fe85a74
fix: improve DemAstNode handling and ensure proper deinitialization i…
b1llow 215bc1f
fix: enhance memory management and deinitialization in meta handling
b1llow 5078ea2
fix: streamline meta handling and improve memory management in tempor…
b1llow 555c466
stage
b1llow 0215bb7
feat: add unit tests for vector implementation and memory management
b1llow bf67f94
fix: enhance memory management and ownership transfer in DemAstNode o…
b1llow 5d28d0f
fix: improve memory management and deinitialization in meta handling
b1llow 8d08259
fix: ensure proper deinitialization of class names and custom name st…
b1llow d3b8311
fix: refactor meta handling functions for improved memory management …
b1llow e07c355
refactor: remove unused function extract_last_unqualified_name for cl…
b1llow 25db9d8
fix: correct formatting of cv qualifiers and improve output order in …
b1llow 785c9eb
fix: update expected output for demangle_rule tests to reflect correc…
b1llow bf3dd2c
fix: enhance type handling in rule_type and rule_prefix_start for imp…
b1llow 8f6a5e8
fix: enhance constructor and destructor name handling by appending la…
b1llow 973826c
fix: improve formatting and readability of macros and rules in demang…
b1llow aa3a5a6
fix: add comments to clarify handling of AST nodes in name and prefix…
b1llow 24e5e31
fix: add handling for substitutable function types in rule_function_type
b1llow 8033ba3
fix: enhance rule_type to include AST_APPEND_TYPE for improved type h…
b1llow ab363f7
fix: enhance rule_nested_name to improve handling of template types a…
b1llow 71b1b06
fix: add helper function to manage spacing for nested template closures
b1llow c37a4a9
fix: enhance template parameter handling and improve substitution logic
b1llow b370cfe
fix: update type appending logic to support multiple occurrences in s…
b1llow 1e65518
fix: enhance meta handling by adding prefix_base_idx and current_pref…
b1llow 7cdb63b
Align test data to llvm-cxxfilt
b1llow 1a89035
fix: enhance function type handling to support void parameters and im…
b1llow b3496b4
apply `DEFN_RULE` macro for debug
b1llow 83ae902
fix: improve function type handling by merging AST nodes and preservi…
b1llow c80cc3a
fix: enhance debug logging in append_type and refactor local name rul…
b1llow 9fb946b
remove src/cplusplus/.clang-format and reformat
b1llow 81b21d4
(void) -> ()
b1llow 65b5271
Refactor code structure for improved readability and maintainability
b1llow d8976e3
fix: add AST_ macro for improved node access and refactor MATCH state…
b1llow 697829c
feat: add DemAstNode_is_empty function and related macros for improve…
b1llow 3bb987a
refactor: enhance function type handling and improve debug logging in…
b1llow b853a01
style: add clang-format rules for braces and function separation
b1llow ed90f6e
"> >" -> ">>"
b1llow 4e863b9
fix: correct formatting of std::basic_string and improve lambda rule …
b1llow 3d0880f
feat: add string comparison functions for improved string handling
b1llow 77d2d88
fix: update function pointer handling to avoid pointer invalidation a…
b1llow 8a5c5fc
fix: improve function pointer handling to prevent pointer invalidatio…
b1llow b4d2b9d
Refactor C++ demangling implementation in v2.c, v3.c, ast.c, meta.c, …
b1llow dd1a5dd
Fix C++ demangler type substitution and prefix handling
b1llow ab7d48d
fix: update type handling in rule_type and related functions for impr…
b1llow a45ead2
fix: enhance function pointer handling to support qualified types and…
b1llow 679337c
fix: reorder template substitution logic for improved clarity and cor…
b1llow 122382c
fix: improve template name substitution and meta state handling in ru…
b1llow 0e99386
fix: streamline function pointer handling and improve qualified prefi…
b1llow 3d8619b
fix: add AST_MATCH2 macro for improved function pointer handling and …
b1llow fa32172
fix: enhance mangled name matching and improve template detection logic
b1llow 3188339
fix: enhance DemAstNode handling and improve function pointer extract…
b1llow a953a88
fix: simplify function pointer handling by consolidating type checks …
b1llow 992f6d3
fix: improve formatting and streamline AST handling in demangling rules
b1llow ef0bbf1
fix: enhance function pointer handling by adding validation checks an…
b1llow b5c8122
fix: add subtag handling in DemAstNode and introduce QUALIFIED_TYPE enum
b1llow b1491e3
fix: refactor function pointer handling and improve type extraction l…
b1llow c99fd2c
fix: streamline type appending by removing redundant force append logic
b1llow bd349b0
fix: refactor DemAstNode constructor for improved initialization and …
b1llow dd25406
fix: improve nested name parsing and enhance template argument handling
b1llow 0ead19e
refactor: simplifying the C++ name demangling parser by:
b1llow 7dbd023
fix: enhance DemAstNode structure by adding parent linkage and improv…
b1llow 082c44b
fix: add outer_template_params to Meta structure and update related f…
b1llow 0389f0d
fix: enhance template argument handling by adding tag template detect…
b1llow 17284aa
fix: simplify expression matching by introducing RULE_X macro for imp…
b1llow 1d33084
fix: streamline C++ name demangling by replacing MATCH_AND_DO with MA…
b1llow 5551cfd
fix: refactor Meta structure by replacing outer_template_params with …
b1llow 81e5fa9
fix: refactor Meta structure by replacing outer_template_params with …
b1llow 00ea023
fix: improve C++ name demangling by conditionally appending "::" for …
b1llow b77a653
fix: enhance error handling in rule_source_name and rule_nested_name …
b1llow b172a4e
fix: add detailed tracing for memory management and node deinitializa…
b1llow ceaa0d7
Fix std::function and std::char_traits template parsing
b1llow ea4b1d1
fix: enhance C++ demangling with substitution table support and add c…
b1llow 129af22
fix: remove unnecessary tracing logs from DemAstNode and Meta structures
b1llow 11de7c3
fix: set parent for node_template_args in rule_template_args function
b1llow 95c357d
fix: streamline rule handling and enhance tracing for detected substi…
b1llow 953a997
fix: correct dem_string_non_empty argument in function name check
b1llow c7c2c71
fix: simplify nv_offset rule by replacing manual digit parsing with d…
b1llow 5b4d7b4
test: 'uint64_t' -> 'unsigned long long'
b1llow 112295a
test: 'int64_t' -> 'long long'
b1llow 35e5727
fix: add :: separators in srN scope resolution expressions
b1llow c31cd6c
fix: refactor context save and restore macros for improved clarity an…
b1llow 15f5365
fix: remove unused macros and introduce MUST_MATCH for better error h…
b1llow 62d98f6
fix: streamline demangling rules by removing commented code and enfor…
b1llow 9d32a75
fix: enhance demangling rules by introducing CTX_MUST_MATCH for impro…
b1llow 85546ce
fix: enhance function pointer handling and append qualifiers in encod…
b1llow 05337d4
refactor: macros.h
b1llow d6ce800
fix: refactor rule_extended_qualifier and handle qualified type for i…
b1llow c75c387
fix: update RULE_X macro to use RULE_CALL_DEFER for improved function…
b1llow 6615c64
fix: enhance demangling rules for unresolved names and operator handling
b1llow 711c6be
fix: enhance handling of function pointer modifiers and qualified types
b1llow 918e4bb
fix: improve array type handling and expression parsing in demangling
b1llow e59f28b
fix: implement array type formatting in demangling
b1llow 2126e6c
fix: add handling for 'LZ' encoding in demangling process
b1llow 6ca78f7
fix: improve handling of 'L' encoding and value number processing in …
b1llow 804dab7
fix: enhance context handling and improve rule matching in demangling
b1llow 623cd26
fix: improve handling of qualifiers and context management in demangling
b1llow 9ba3754
fix: update context restoration logic in demangling process
b1llow cb460b5
fix: update matching macros to use RULE_CALL_DEFER for improved conte…
b1llow 924ab52
fix: refactor base36 parsing and improve substitution rule matching
b1llow 3814920
fix: optimize std identifier detection in substitution parsing
b1llow 4254e25
fix: correct boundary checks in NodeList_make and enhance error handl…
b1llow c90530b
fix: enhance demangling output by adding space before cv-qualifiers a…
b1llow 0dea830
fix: remove unused first rule parameter from rule macros for improved…
b1llow e87ab59
fix: refactor rule_name function to improve template argument handlin…
b1llow 013bb98
fix: improve error handling in function pointer and qualified type pr…
b1llow 278e175
Fix C++ demangler: array pointers, void return type placement
b1llow 4a25a76
fix: implement unary NOT operator (nt) in C++ expression parser
b1llow 6786ace
fix: add support for user-defined literals, ABI tags, and pack expansion
b1llow ef3602a
fix: add support for construction vtable (TC) special name
b1llow 0ea4dc9
fix: enhance C++ demangler for pointer-to-member types
b1llow aeeeca8
fix: refactor type handling in C++ demangler for improved clarity and…
b1llow 56c6d4f
fix: improve readability and logic in macros for rule matching
b1llow fe4f302
fix: add support for forward template references in C++ demangler
b1llow ca8f10c
fix: update context macros to handle multiple instances in C++ demangler
b1llow 27243e4
fix: enhance C++ demangler to support conversion operators and improv…
b1llow 5f6119a
fix: simplify context handling in C++ demangler for improved clarity
b1llow 9fd6f76
fix: update forward template reference resolution in C++ demangler
b1llow be6c988
fix: remove unused macro and enhance vector iteration macro in C++ de…
b1llow 9239b5d
fix: enhance qualified type handling and add pack expansion support i…
b1llow cf78cf1
fix: remove incorrect TRACE_RETURN_SUCCESS in qualified type handling
b1llow 7cb701e
[skip ci] refactor: huge refactor
b1llow bc71d67
fix: refactor DemNode handling and improve primitive type creation
b1llow be825f5
fix: improve child node handling and remove unnecessary checks in Dem…
b1llow 6e28b0e
fix: enhance primitive type handling and add utility function for tem…
b1llow e95056c
fix: mark unused variables and functions to avoid compiler warnings
b1llow 52e5643
fix: update DemNode handling to improve error tracing and memory mana…
b1llow 3cd2a79
fix: rename macro functions for clarity and enhance template paramete…
b1llow f9224cb
fix: refactor nested name handling and introduce NestedName struct fo…
b1llow 578b4a6
fix: improve string comparison for global namespace detection
b1llow a3dcab0
fix: replace PASSTHRU_RULE with CALL_RULE for improved rule handling
b1llow 286959a
fix: introduce parse_discriminator function and replace rule_discrimi…
b1llow 23ca401
fix: enhance node type handling with additional types and improved la…
b1llow 004d66e
fix: update AST_APPEND_TYPE1 to use result for improved type handling
b1llow f0d387c
fix: rename is_conversion_operator to is_conversion_ctor_dtor for cla…
b1llow 74a4c98
fix: refactor constructor/destructor handling and introduce qualifier…
b1llow d0fecfd
fix: enhance handling of constructor/destructor names with new struct…
b1llow f0f5d41
fix: add break statement to improve control flow in node handling
b1llow f485cc9
fix: introduce OK_OR_FAIL macro for improved error handling and refac…
b1llow 96c7571
fix: add is_end_of_encoding function to optimize parsing logic in rul…
b1llow b4eb32e
fix: refactor error handling macros and improve parsing logic in rule…
b1llow 18c999e
fix: update string comparison to use correct size for global namespac…
b1llow 7b1ce74
fix: refactor rule_special_name for improved parsing and control flow
b1llow e56fb07
fix: refactor READ_STR macro for improved readability and error handling
b1llow 7cdd37a
fix: add extract_base_class_name function to simplify base class extr…
b1llow 05b5734
fix: enhance forward template reference handling and improve function…
b1llow 1caf5fd
fix: refactor base class name extraction and function pointer handlin…
b1llow 36dfd17
fix: refactor context save/restore macros and improve function type h…
b1llow 7d19542
fix: refactor context save/restore macros for improved clarity and fu…
b1llow f401c9d
fix: enhance array type handling and improve integer literal formatti…
b1llow 9a8cce2
fix: refine pointer/reference to array handling and enhance non-virtu…
b1llow 9d2d2a4
fix: enhance type and number formatting in demangler for improved cla…
b1llow 3b6b7a5
fix: improve number formatting and enhance unresolved type handling i…
b1llow 4b74028
fix: add conversion operator type handling and improve forward refere…
b1llow f2181f8
fix: simplify CV qualifier parsing and improve function parameter han…
b1llow 0714112
fix: add operator symbol retrieval and improve prefix expression hand…
b1llow 5fbb159
fix: streamline number parsing in demangler for improved readability
b1llow 03a7800
fix: enhance unresolved name parsing and streamline rule handling in …
b1llow 4cb7e23
fix: enhance demangler by introducing NameState for improved state ma…
b1llow 3d206e1
fix: add support for template parameter packs and parameter pack expa…
b1llow 44b2b04
fix: add handling for conversion operator types and parameter pack ex…
b1llow 22d2f12
fix: implement pack expansion extraction and enhance type qualifier h…
b1llow 3bcf704
Fix forward template reference resolution in C++ demangler
b1llow e6aa6c4
Fix binary operator rendering in expressions
b1llow 8508e5e
fix: simplify argument handling in expression rules
b1llow b9a555f
fix: enhance pack expansion handling and improve operator symbol retr…
b1llow b064bf7
fix: improve operator handling by appending source name in expression…
b1llow 35bde70
fix: refactor ABI tag handling and improve type node processing
b1llow 0ac5990
fix: add handling for ABI tag type in demangling process
b1llow 07beb43
fix: improve handling of forward template references in resolution pr…
b1llow 6878ada
fix: update wrapper pointer for forward template references in demang…
b1llow 6af3ef3
fix: enhance decltype handling and update nullptr representation in d…
b1llow 08aa543
fix: add special substitution handling for demangling process
b1llow 505501a
fix: '> >' -> '>>'
b1llow 6256b8c
fix: refactor array type handling in demangling process
b1llow f299350
fix: improve array parts initialization and adjust node handling in d…
b1llow ee204ca
fix: add parentheses around member expression in demangling
b1llow 6c53fa9
fix: add array type handling and improve type printing functions
b1llow 72a54b2
fix: add handling for array type destruction and cloning in demangling
b1llow d740b9b
fix: update handling of short and unsigned short types in demangling
b1llow d45364d
fix: enhance expression parsing and function parameter handling in de…
b1llow 92dd527
fix: simplify parser rule signatures by removing parent node parameter
b1llow bb6b31f
fix: remove unused qualifier cases and streamline type handling in de…
b1llow 40c408b
fix: add handling for new demangling type kinds and enhance AST trave…
b1llow badfbce
fix: add member expression handling and enhance AST traversal in dema…
b1llow c545fc9
fix: improve demangling output formatting and streamline expression h…
b1llow a84e3c8
fix: update demangling test cases for improved output consistency and…
b1llow f5dd436
fix: refactor demangling helper functions for improved clarity and co…
b1llow d93f78c
fix: add support for thread-local wrapper and initialization in deman…
b1llow 2181d8e
fix: simplify string reading macro by introducing a dedicated parsing…
b1llow ceba565
fix: enhance match_many and match_many1 macros to support stop character
b1llow 95ea759
fix: add error handling for 'E' character in parsing logic
b1llow 5adf799
fix: add support for vector type in demangling and parsing logic
b1llow b53105e
fix: refactor cv and ref qualifiers handling in NameState
b1llow d22d7ef
fix: enhance qualified type handling for arrays and function references
b1llow f0a65c9
fix: add parentheses around rule expressions in parsing logic
b1llow 1aef27b
fix: add support for fold expressions in demangling and parsing logic
b1llow ab6555b
fix: add support for braced and braced range expressions in AST trave…
b1llow 752641a
fix: add support for init list expressions in AST traversal and deman…
b1llow adf8320
fix: enforce matching rule for unresolved names in demangling logic
b1llow 7f4587e
fix: add support for binary and prefix expressions in AST traversal a…
b1llow 9631f09
fix: add parentheses handling for binary expressions in demangling logic
b1llow a4b4a1f
fix: rename function for clarity and update calls to new name
b1llow 4285bb6
fix: enhance pretty-printing with context tracking for parentheses an…
b1llow 7b28be0
fix: add handling for new expressions in AST traversal and destruction
b1llow e4d0f4d
fix: refactor label creation in DOT graph generation to use DemString…
b1llow ab3be1a
fix: add precision handling in AST node copying for improved accuracy
b1llow 6e0daed
fix: remove unused GPL handling from test script and CI configuration
b1llow 43966d0
fix: improve memory management by freeing unused nodes and refactorin…
b1llow 81a648c
fix: simplify forward template reference handling and improve memory …
b1llow 970460d
fix: ensure type index comparisons use consistent unsigned type for i…
b1llow d52cfac
fix: suppress and restore GCC-specific warnings for improved compatib…
b1llow adca0fa
fix: replace CTX_MUST_MATCH macro with MUST_MATCH for improved clarit…
b1llow e90fe10
feat: add AppVeyor configuration for CI builds and testing
b1llow dfb3d98
fix: reuse dep5
b1llow 56155d4
fix: replace PFMT64 macros with PRIu64 for improved portability and c…
b1llow c572a7b
fix: add MSVC compatibility for __attribute__ to improve cross-platfo…
b1llow ad4867f
fix: add MSVC-compatible macro workarounds for statement expressions
b1llow 252fd92
feat: implement context saving and restoring for parser state
b1llow c408ccf
fix: ensure proper deinitialization in CALL_RULE macros for stability
b1llow 390fc71
fix: disable broken demangle tests for Borland, Objective-C, and Swift
b1llow 0acec7e
fix: update type for length variables to size_t for consistency
b1llow 2d1105c
fix: enable strict error handling in Meson build commands
b1llow 3fee495
Fix GCC -Werror=unused-value and MSVC type mismatch in CALL_RULE macros
b1llow 4a577a5
Fix meson build: properly handle both_libraries with default_library …
b1llow e9e473b
Rename CLI tool to rz-demangle to fix MSVC linking conflict
b1llow ae33e64
fix: update CLI tool name in AppVeyor configuration to rz-demangle
b1llow 9d53e79
Simplify dot to SVG conversion using -O flag
b1llow 684bc62
refactor: reorganize C++ demangler into v2/ and v3/ subdirectories
b1llow 46311fa
fix: simplify dem_string_append logic and improve buffer handling
b1llow 54d310c
fix: update dem_str_ndup to use size_t for length parameter and impro…
b1llow 0ad3966
Use snprintf return value and precision specifiers for filename lengt…
b1llow 7951b71
Fix SIGABRT when DEMANGLE_TRACE=1 encounters forward template refs
b1llow d2f15c8
Fix memory leak in resolve_forward_template_refs when tracing enabled
b1llow 30c052c
Fix DOT graph handling of forward template references
b1llow bc7e69b
Add CI job to test DEMANGLE_TRACE mode with ASAN and SVG generation
b1llow 2f80c4b
Refactor AST pretty-printing to use a context structure for formattin…
b1llow 25990a7
Enhance pretty-printing functions to utilize context for qualifier ha…
b1llow be3edcc
Refactor DemParser to include options parameter for enhanced configur…
b1llow a125ece
Remove placeholder output for simple demangling in v3.c
b1llow ed0dbf0
Implement demangling simplification and enhance type handling in v3.c
b1llow 8a58a2e
Add parse_string function for improved string parsing in demangler
b1llow a2a211a
Refactor demangling logic to utilize parse_string for GLOBAL_$ patter…
b1llow fc4ce73
Fix MSVC compilation issues in C++ v2 demangler
b1llow 3faa5a8
Add MSVC 2017 support to AppVeyor CI
b1llow 8b04bec
Update Python path in AppVeyor configuration for VS2017 builds
b1llow File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,7 @@ | ||
| build*/ | ||
| .cache/ | ||
| debug_demangler | ||
| debug_demangler.c | ||
| debug_demangler.dSYM/ | ||
| compile_commands.json | ||
| steps-grammars |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,8 +5,15 @@ cc = meson.get_compiler('c') | |
| common_c_args = [] | ||
| libdemangle_c_args = [] | ||
| libdemangle_src = [ | ||
| 'src' / 'cxx' / 'borland.c', | ||
| 'src' / 'borland.c', | ||
| 'src' / 'cxx.c', | ||
|
|
||
| 'src' / 'cplusplus' / 'demangle.c', | ||
| 'src' / 'cplusplus' / 'common.c', | ||
| 'src' / 'cplusplus' / 'param.c', | ||
| 'src' / 'cplusplus' / 'v2.c', | ||
| 'src' / 'cplusplus' / 'v3.c', | ||
|
|
||
| 'src' / 'demangler.c', | ||
| 'src' / 'demangler_util.c', | ||
| 'src' / 'java.c', | ||
|
|
@@ -27,16 +34,38 @@ tests = [ | |
| 'objc', | ||
| 'pascal', | ||
| 'rust', | ||
| ] | ||
|
|
||
| if get_option('use_gpl') | ||
| libdemangle_src += 'src' / 'cxx' / 'cp-demangle.c' | ||
| libdemangle_src += 'src' / 'gnu_v2' / 'cplus-dem.c' | ||
| common_c_args += '-DWITH_GPL=1' | ||
| tests += 'cxx' | ||
| tests += 'cxx_base' | ||
| tests += 'cxx_gnu_v2' | ||
| endif | ||
| 'cxx.00', | ||
| 'cxx.01', | ||
| 'cxx.02', | ||
| 'cxx.03', | ||
| 'cxx.04', | ||
| 'cxx.05', | ||
| 'cxx.06', | ||
| 'cxx.07', | ||
| 'cxx.08', | ||
| 'cxx.09', | ||
| 'cxx.10', | ||
| 'cxx.11', | ||
| 'cxx.12', | ||
| 'cxx.13', | ||
| 'cxx.14', | ||
| 'cxx.15', | ||
| 'cxx.16', | ||
| 'cxx.17', | ||
| 'cxx.18', | ||
| 'cxx.19', | ||
| 'cxx.20', | ||
| 'cxx.21', | ||
| 'cxx.22', | ||
| 'cxx.23', | ||
| 'cxx.24', | ||
| 'cxx.25', | ||
| 'cxx.26', | ||
|
|
||
| 'cxx_base', | ||
| 'cxx_gnu_v2', | ||
| ] | ||
|
|
||
| if get_option('use_swift_demangler') | ||
| libdemangle_src += 'src' / 'swift.c' | ||
|
|
@@ -56,25 +85,30 @@ elif cc.has_argument('--std=c99') | |
| add_project_arguments('--std=c99', language: 'c') | ||
| endif | ||
|
|
||
| libdemangle = library('demangle', libdemangle_src, | ||
| c_args : common_c_args + libdemangle_c_args, | ||
| dependencies: [], | ||
| implicit_include_directories: false, | ||
| install: get_option('install_lib'), | ||
| include_directories: include_directories(['include', 'src'])) | ||
| libdemangle = library( | ||
| 'demangle', | ||
| libdemangle_src, | ||
| c_args: common_c_args + libdemangle_c_args, | ||
| dependencies: [], | ||
| implicit_include_directories: false, | ||
| install: get_option('install_lib'), | ||
| include_directories: include_directories(['include', 'src']), | ||
| ) | ||
|
|
||
| libdemangle_dep = declare_dependency( | ||
| link_with: libdemangle, | ||
| dependencies: [], | ||
| include_directories: include_directories('include'), | ||
| link_with: libdemangle, | ||
| dependencies: [], | ||
| include_directories: include_directories('include'), | ||
| ) | ||
|
|
||
| if get_option('enable_cli') | ||
| bin_demangle = [ | ||
| 'bin' / 'demangle.c', | ||
| ] | ||
| executable('demangle', bin_demangle, | ||
| c_args : common_c_args, | ||
| executable( | ||
| 'demangle', | ||
| bin_demangle, | ||
| c_args: common_c_args, | ||
| dependencies: [libdemangle_dep], | ||
| include_directories: include_directories(['include', 'src']), | ||
| implicit_include_directories: false, | ||
|
|
@@ -91,13 +125,15 @@ if get_option('enable_tests') and not meson.is_subproject() | |
| test_dependencies += cc.find_library('ubsan') | ||
| endif | ||
| foreach test : tests | ||
| exe = executable('test_@0@'.format(test), 'test/test_@[email protected]'.format(test), | ||
| exe = executable( | ||
| 'test_@0@'.format(test), | ||
| 'test/test_@[email protected]'.format(test), | ||
| include_directories: include_directories(['include', 'test']), | ||
| dependencies: test_dependencies, | ||
| c_args : common_c_args, | ||
| c_args: common_c_args, | ||
| install: false, | ||
| install_rpath: '', | ||
| implicit_include_directories: false | ||
| implicit_include_directories: false, | ||
| ) | ||
| test(test, exe) | ||
| endforeach | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| option('use_gpl', type: 'boolean', value: true, description: 'Set to false when you want to disable gpl code') | ||
| option('use_swift_demangler', type: 'boolean', value: true, description: 'If false, disables the swift demangler') | ||
| option('install_lib', type: 'boolean', value: false, description: 'install libdemangle in the specified prefix path.') | ||
| option('enable_cli', type: 'boolean', value: false, description: 'install a cli to demangle symbols.') | ||
| option('enable_tests', type: 'boolean', value: true, description: 'Build unit tests in test/') | ||
| option('enable_tests', type: 'boolean', value: true, description: 'Build unit tests in test/') |
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| --- | ||
| BasedOnStyle: Google | ||
| AlignConsecutiveBitFields: | ||
| Enabled: true | ||
| AcrossEmptyLines: false | ||
| AcrossComments: false | ||
| AlignCompound: true | ||
| PadOperators: true | ||
| AlignAfterOpenBracket: BlockIndent | ||
| AlignArrayOfStructures: Right | ||
| AlignConsecutiveAssignments: | ||
| Enabled: true | ||
| AcrossEmptyLines: false | ||
| AcrossComments: false | ||
| PadOperators: true | ||
| AlignCompound: true | ||
| AlignConsecutiveDeclarations: | ||
| Enabled: true | ||
| AcrossEmptyLines: false | ||
| AcrossComments: false | ||
| AlignCompound: true | ||
| PadOperators: true | ||
| AlignOperands: AlignAfterOperator | ||
| AlignEscapedNewlines: Right | ||
| AlignConsecutiveMacros: | ||
| Enabled: true | ||
| AcrossEmptyLines: false | ||
| AcrossComments: false | ||
| AlignCompound: true | ||
| PadOperators: true | ||
| AlignConsecutiveShortCaseStatements: | ||
| Enabled: true | ||
| AcrossEmptyLines: false | ||
| AcrossComments: false | ||
| AlignCaseColons: true | ||
| AlignTrailingComments: | ||
| Kind: Always | ||
| OverEmptyLines: 2 | ||
| AllowAllArgumentsOnNextLine: false | ||
| AllowAllParametersOfDeclarationOnNextLine: false | ||
| AllowShortBlocksOnASingleLine: Empty | ||
| AllowShortFunctionsOnASingleLine: Empty | ||
| AllowShortCaseLabelsOnASingleLine: false | ||
| AllowShortEnumsOnASingleLine: false | ||
| AllowShortIfStatementsOnASingleLine: Never | ||
| AllowShortLoopsOnASingleLine: false | ||
| AlwaysBreakAfterReturnType: None | ||
| AlwaysBreakBeforeMultilineStrings: true | ||
| AttributeMacros: | ||
| - FORCE_INLINE | ||
| - PACKED | ||
| BinPackArguments: false | ||
| BinPackParameters: false | ||
| BraceWrapping: | ||
| AfterCaseLabel: false | ||
| AfterClass: false | ||
| AfterControlStatement: Never | ||
| AfterEnum: false | ||
| AfterFunction: false | ||
| AfterNamespace: false | ||
| AfterObjCDeclaration: false | ||
| AfterStruct: false | ||
| AfterUnion: false | ||
| AfterExternBlock: false | ||
| BeforeElse: false | ||
| BeforeWhile: false | ||
| IndentBraces: true | ||
| BracedInitializerIndentWidth: 4 | ||
| BreakArrays: false | ||
| BreakBeforeBinaryOperators: None | ||
| BreakBeforeBraces: Attach | ||
| BreakBeforeInlineASMColon: Always | ||
| BreakBeforeTernaryOperators: false | ||
| BreakStringLiterals: true | ||
| ColumnLimit: 100 | ||
| ContinuationIndentWidth: 4 | ||
| IncludeBlocks: Regroup | ||
| IndentCaseBlocks: false | ||
| IndentCaseLabels: true | ||
| IndentExternBlock: Indent | ||
| IndentGotoLabels: false | ||
| IndentPPDirectives: AfterHash | ||
| IndentWidth: 4 | ||
| IndentWrappedFunctionNames: true | ||
| InsertBraces: false | ||
| KeepEmptyLinesAtEOF: false | ||
| KeepEmptyLinesAtTheStartOfBlocks: false | ||
| LineEnding: CRLF | ||
| Macros: | ||
| - ALLOCATE(type, n) (type*)calloc(sizeof(type), n) | ||
| - FREE(x) free((void*)x) | ||
| - REALLOCATE(oldptr, type, n) (type*)realloc(oldptr, sizeof(type)*n) | ||
| MaxEmptyLinesToKeep: 4 | ||
| PPIndentWidth: 4 | ||
| PointerAlignment: Right | ||
| QualifierAlignment: Leave | ||
| ReferenceAlignment: Right | ||
| ReflowComments: true | ||
| RemoveParentheses: Leave | ||
| SortIncludes: CaseSensitive | ||
| SpaceAfterCStyleCast: false | ||
| SpaceAfterLogicalNot: false | ||
| SpaceAroundPointerQualifiers: Default | ||
| SpaceBeforeAssignmentOperators: true | ||
| SpaceBeforeCaseColon: true | ||
| SpaceBeforeCpp11BracedList: true | ||
| SpaceBeforeParens: NonEmptyParentheses | ||
| SpaceBeforeParensOptions: | ||
| AfterControlStatements: true | ||
| AfterForeachMacros: true | ||
| AfterFunctionDeclarationName: true | ||
| AfterFunctionDefinitionName: true | ||
| AfterIfMacros: true | ||
| SpaceBeforeSquareBrackets: false | ||
| SpaceInEmptyBlock: false | ||
| SpacesBeforeTrailingComments: 1 | ||
| UseTab: Never | ||
| TabWidth: 4 | ||
| Standard: Latest | ||
| SpacesInContainerLiterals: true | ||
| SpacesInLineCommentPrefix: | ||
| Maximum: -1 | ||
| Minimum: 1 | ||
| SpacesInParens: Never | ||
| SpacesInSquareBrackets: false | ||
| StatementAttributeLikeMacros: | ||
| - PACKED | ||
| - FORCE_INLINE | ||
| TypeNames: | ||
| - Char | ||
| - ZString | ||
| - U1 | ||
| - U2 | ||
| - U4 | ||
| - U8 | ||
| - I1 | ||
| - I2 | ||
| - I4 | ||
| - I8 | ||
| - Size | ||
| - Size32 | ||
| - Size64 | ||
| - Off4 | ||
| - Off8 | ||
| - Addr4 | ||
| - Addr8 | ||
| - UintPtr | ||
| CommentPragmas: .* | ||
| Cpp11BracedListStyle: true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #include "cplusplus/common.h" | ||
|
|
||
| CpDem* cpdem_init (CpDem* dem, const char* mangled, CpDemOptions opts) { | ||
| if (!dem || !mangled) { | ||
| return NULL; | ||
| } | ||
|
|
||
| memset (dem, 0, sizeof (CpDem)); | ||
| dem->original = | ||
| ((StrIter) {.beg = mangled, .end = mangled + strlen (mangled) + 1, .cur = mangled}); | ||
| dem->opts = opts; | ||
| dem_string_init (&dem->base_name); | ||
| dem_string_init (&dem->suffix); | ||
| dem_string_init (&dem->prefix); | ||
| param_vec_init (&dem->func_params); | ||
| return dem; | ||
| } | ||
|
|
||
| void cpdem_fini (CpDem* dem) { | ||
| if (!dem) { | ||
| return; | ||
| } | ||
|
|
||
| /* free all demstring and deinit qualifiers vector */ | ||
| vec_foreach_ptr (&dem->qualifiers, q, { dem_string_deinit (q); }); | ||
| vec_deinit (&dem->qualifiers); | ||
|
|
||
| // deinit all func params first | ||
| param_vec_deinit (&dem->func_params); | ||
|
|
||
| dem_string_deinit (&dem->base_name); | ||
| dem_string_deinit (&dem->prefix); | ||
| dem_string_deinit (&dem->suffix); | ||
| dem_string_deinit (&dem->custom_operator); | ||
|
|
||
| memset (dem, 0, sizeof (CpDem)); | ||
| return; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.