Skip to content
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

enhance type-prettification #104

Merged
merged 71 commits into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
465afd2
test: extend type-prettification post-processing cases
DNKpp Mar 4, 2025
927772c
chore: re-define target anon-ns symbol to `{anon-ns}`
DNKpp Mar 4, 2025
fd85fbe
chore: wrap function symbol into {}
DNKpp Mar 4, 2025
9ac4d7e
fix: enhance type-prettification
DNKpp Mar 4, 2025
0f700a3
fix: check last string element with ends_with instead of .back
DNKpp Mar 4, 2025
916ec80
refactor: apply smaller cleanup
DNKpp Mar 7, 2025
750e930
fix: use MIMICPP_ASSERT instead of DEBUG_ASSERT
DNKpp Mar 7, 2025
d2aecac
refactor: extract handle_identifier function
DNKpp Mar 7, 2025
83544da
test: extend prettification cases
DNKpp Mar 7, 2025
a3d71c5
refactor: start reworking type-prettification
DNKpp Mar 7, 2025
da19e86
chore: unify ` and ' on msvc
aunovis-koepke Mar 7, 2025
b08dee3
fix: correct several test-cases for msvc
aunovis-koepke Mar 8, 2025
713bcec
chore: enhance cmake generator-expression
aunovis-koepke Mar 8, 2025
132ee07
fix: correct post-processing on msvc
aunovis-koepke Mar 8, 2025
522afdc
refactor: simplify post-processing
DNKpp Mar 8, 2025
8d23eb4
fix: mark parameter as maybe_unused
DNKpp Mar 8, 2025
6238a82
fix: apply new post-processing on msvc
aunovis-koepke Mar 8, 2025
4f927a2
cleanup: remove obsolete post-processing functions
DNKpp Mar 8, 2025
18d1ed4
fix: make special type-info detection more efficient
DNKpp Mar 8, 2025
52d995f
refactor: perform lambda simplification during general-step on gcc an…
DNKpp Mar 8, 2025
c32644b
fix: template type handling
DNKpp Mar 8, 2025
4a5a827
fix: prevent copies during return-type and arg-list prettification
DNKpp Mar 8, 2025
f6f11fd
cleanup: remove obsolete symbols
DNKpp Mar 8, 2025
37e42f8
chore: apply code style
DNKpp Mar 8, 2025
c7fdca6
chore: enhance PostProcessing.hpp
DNKpp Mar 8, 2025
0b9b32b
chore: enable explicit void check for args only on msvc and clang-cl
DNKpp Mar 8, 2025
da6282a
chore: terse statement
DNKpp Mar 10, 2025
fe9beca
test: add source_location::function_name prettification tests
DNKpp Mar 10, 2025
85455d9
fix: use auto if no function-return type is given
DNKpp Mar 10, 2025
82cae66
fix: transform (anonymous class|struct) to {anon-class|struct} on clang
DNKpp Mar 10, 2025
f9c86f6
test: add anon-type prettification tests
DNKpp Mar 10, 2025
18c4348
fix: correct anon-type handling on clang and gcc
DNKpp Mar 10, 2025
e276b11
chore: treat `<...>` not as templates and `(...)` not as function
DNKpp Mar 10, 2025
4c02a85
test: correct std::source_location::function_name prettification tests
DNKpp Mar 10, 2025
ca07dbe
fix: correct lambda handling on libstdc++
DNKpp Mar 10, 2025
e527d5a
test: make topLevelLambdaPattern and lambdaScopePattern more permissive
DNKpp Mar 10, 2025
89750c4
fix: correct lambda handling on libc++
DNKpp Mar 10, 2025
839d494
test: overhaul lambda related prettification tests
DNKpp Mar 10, 2025
ad2c201
fix: correct template handling for names received from std::source_lo…
DNKpp Mar 10, 2025
4d21699
fix: remove constexpr keyword from names
DNKpp Mar 10, 2025
387eaa6
test: correct some lambda related test for gcc
DNKpp Mar 10, 2025
afbad87
feat: detail::ScopeVisitor
DNKpp Mar 11, 2025
de90d89
fix: util::find_next_unwrapped_token correctly counts wraps, if token…
DNKpp Mar 11, 2025
84cfef2
chore: utilize SopeIterator in prettify_identifier
DNKpp Mar 13, 2025
9d2c83a
fix: correct string_view arithmetic on msvc
aunovis-koepke Mar 13, 2025
c9b7233
fix: correct several prettifications on msvc
aunovis-koepke Mar 13, 2025
be76b71
fix: disable TypeScopeIterator tests when MIMICPP_CONFIG_MINIMAL_PRET…
aunovis-koepke Mar 13, 2025
4bd8925
test: overhaul TypeScopeIterator.cpp
aunovis-koepke Mar 14, 2025
e0dd733
fix: detect_template_scope_info correctly rejects non-templates
aunovis-koepke Mar 14, 2025
b2fdcb7
fix: accept msvc's unon-type placeholders
aunovis-koepke Mar 14, 2025
fff96af
feat: prettify_specs
aunovis-koepke Mar 14, 2025
b5ead0e
test: correct cases for msvc
aunovis-koepke Mar 14, 2025
a2e6b5b
fix: correct test case
DNKpp Mar 14, 2025
04ef664
fix: please clang-16
DNKpp Mar 14, 2025
d2206da
cleanup: remove obsolete functions
DNKpp Mar 14, 2025
d028ed6
feat: type-prettification supports ordering-operators
DNKpp Mar 14, 2025
734163a
refactor: remove omit_set and handle the existing entries within deta…
DNKpp Mar 15, 2025
a9331cf
refactor: extract similar parts of detect_template_scope_info and det…
DNKpp Mar 15, 2025
3ebadf4
fix: correct template and function detection with placeholder-like names
DNKpp Mar 15, 2025
2dca0d8
chore: do not actually prettify any specs
DNKpp Mar 15, 2025
86f61c5
test: add case for `(void)` function-arg handling
DNKpp Mar 15, 2025
e531842
fix: correct operator() handling
DNKpp Mar 15, 2025
6134b91
feat: correct std::source_location::function_name prettification on c…
DNKpp Mar 15, 2025
bc95391
fix: correct std::source_location::function_name handling on msvc
aunovis-koepke Mar 15, 2025
151394f
test: add stacktrace prettification cases
DNKpp Mar 15, 2025
da09451
fix: unwrap scopes in `...' on msvc
aunovis-koepke Mar 15, 2025
9b8b89e
fix: correct prettification tests on msvc
aunovis-koepke Mar 15, 2025
b4b749f
fix: correct prettification tests for clang-cl
aunovis-koepke Mar 15, 2025
4309cdd
fix: correct prettification test on clang with libc++
DNKpp Mar 15, 2025
5e856e5
chore: utilize printing::type::prettify_identifier in stacktrace::det…
DNKpp Mar 15, 2025
642fe01
feat: utilize printing::type::prettify_identifier when printing std::…
DNKpp Mar 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions cmake/EnableWarnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ if (NOT TARGET enable-warnings)

set(WARNING_FLAGS /W4 -Wextra -Wpedantic -Werror -Wno-unknown-attributes)
else()
set(WARNING_FLAGS
$<IF:$<CXX_COMPILER_ID:MSVC>,
/W4 /WX,
-Wall -Wextra -Wpedantic -Werror>
string(CONCAT WARNING_FLAGS
"$<IF:"
"$<CXX_COMPILER_ID:MSVC>,"
"/W4;/WX,"
"-Wall;-Wextra;-Wpedantic;-Werror"
">"
)
endif()

target_compile_options(
enable-warnings
target_compile_options(enable-warnings
INTERFACE
${WARNING_FLAGS}
)
Expand Down
4 changes: 1 addition & 3 deletions include/mimic++/Sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,7 @@ namespace mimicpp::sequence::detail
if (const auto iter = std::ranges::find(rhs, lhsTag, &rating::tag);
iter != std::ranges::end(rhs))
{
rating += lhsPriority < iter->priority
? -1
: 1;
rating += lhsPriority < iter->priority ? -1 : 1;
}
else
{
Expand Down
8 changes: 5 additions & 3 deletions include/mimic++/Stacktrace.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "mimic++/config/Config.hpp"
#include "mimic++/printing/PathPrinter.hpp"
#include "mimic++/printing/StatePrinter.hpp"
#include "mimic++/printing/TypePrinter.hpp"
#include "mimic++/utilities/AlwaysFalse.hpp"
#include "mimic++/utilities/PriorityTag.hpp"

Expand Down Expand Up @@ -388,9 +389,10 @@ namespace mimicpp::stacktrace::detail
out = format::format_to(std::move(out), "`");
out = format::format_to(
std::move(out),
"#L{}, `{}`",
stacktrace.source_line(index),
stacktrace.description(index));
"#L{}, `",
stacktrace.source_line(index));
out = printing::type::prettify_identifier(std::move(out), stacktrace.description(index));
out = format::format_to(std::move(out), "`");

return out;
}
Expand Down
18 changes: 12 additions & 6 deletions include/mimic++/printing/state/CommonTypes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "mimic++/printing/Fwd.hpp"
#include "mimic++/printing/PathPrinter.hpp"
#include "mimic++/printing/state/Print.hpp"
#include "mimic++/printing/type/PostProcessing.hpp"
#include "mimic++/utilities/C++23Backports.hpp" // unreachable

#include <algorithm>
Expand All @@ -40,11 +41,14 @@ namespace mimicpp::printing::detail::state
out = print_path(std::move(out), loc.file_name());
out = format::format_to(std::move(out), "`");

return format::format_to(
out = format::format_to(
std::move(out),
"#L{}, `{}`",
loc.line(),
loc.function_name());
"#L{}, `",
loc.line());
out = type::prettify_identifier(std::move(out), loc.function_name());
out = format::format_to(std::move(out), "`");

return out;
}
};

Expand Down Expand Up @@ -210,7 +214,8 @@ namespace mimicpp::printing::detail::state
{
case ValueCategory::lvalue: return {"lvalue"};
case ValueCategory::rvalue: return {"rvalue"};
case ValueCategory::any: return {"any"};
case ValueCategory::any:
return {"any"};
// GCOVR_EXCL_START
default:
util::unreachable();
Expand All @@ -233,7 +238,8 @@ namespace mimicpp::printing::detail::state
{
case Constness::non_const: return {"mutable"};
case Constness::as_const: return {"const"};
case Constness::any: return {"any"};
case Constness::any:
return {"any"};
// GCOVR_EXCL_START
default:
util::unreachable();
Expand Down
Loading
Loading