Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions src/lib/AST/ClangHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,17 +985,17 @@ namespace detail {
template <class T>
requires (!std::is_pointer_v<T>)
void
printTraceName(T const& D, ASTContext const& C, SmallString<256>& symbol_name);
printTraceName(T const& D, ASTContext const& C, std::string& symbol_name);

template <class T>
void
printTraceName(T const* D, ASTContext const& C, SmallString<256>& symbol_name)
printTraceName(T const* D, ASTContext const& C, std::string& symbol_name)
{
if (!D)
{
return;
}
llvm::raw_svector_ostream os(symbol_name);
llvm::raw_string_ostream os(symbol_name);
if constexpr (std::derived_from<T, Decl>)
{
if (NamedDecl const* ND = dyn_cast<NamedDecl>(D))
Expand Down Expand Up @@ -1052,14 +1052,14 @@ namespace detail {
template <class T>
requires (!std::is_pointer_v<T>)
void
printTraceName(T const& D, ASTContext const& C, SmallString<256>& symbol_name)
printTraceName(T const& D, ASTContext const& C, std::string& symbol_name)
{
printTraceName(&D, C, symbol_name);
}

template <class T>
void
printTraceName(std::optional<T> const& D, ASTContext const& C, SmallString<256>& symbol_name)
printTraceName(std::optional<T> const& D, ASTContext const& C, std::string& symbol_name)
{
if (D)
{
Expand All @@ -1076,9 +1076,9 @@ namespace detail {
# define MRDOCS_SYMBOL_TRACE_LABEL_(a) MRDOCS_SYMBOL_TRACE_MERGE_(symbol_name_, a)
# define MRDOCS_SYMBOL_TRACE_UNIQUE_NAME MRDOCS_SYMBOL_TRACE_LABEL_(__LINE__)
#define MRDOCS_SYMBOL_TRACE(D, C) \
SmallString<256> MRDOCS_SYMBOL_TRACE_UNIQUE_NAME; \
std::string MRDOCS_SYMBOL_TRACE_UNIQUE_NAME; \
detail::printTraceName(D, C, MRDOCS_SYMBOL_TRACE_UNIQUE_NAME); \
report::trace("{}", std::string_view(MRDOCS_SYMBOL_TRACE_UNIQUE_NAME.str()))
report::trace("{}", MRDOCS_SYMBOL_TRACE_UNIQUE_NAME)
#endif

} // clang::mrdocs
Expand Down
12 changes: 4 additions & 8 deletions test-files/golden-tests/remove_bad_files.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
#!/bin/bash
# This script finds and deletes all files with the extension ".bad.*" in the current directory and its subdirectories.
# It is useful for cleaning up unwanted or temporary files generated during testing or development.

# Use the find command to locate all files with the ".bad.*" extension and store them in an array.
# The -name option specifies the pattern to match.
# The -type f option ensures that only files are matched.
mapfile -t files < <(find . -name "*.bad.*" -type f)
files=()
while IFS= read -r -d $'\0' file; do
files+=("$file")
done < <(find . -name "*.bad.*" -type f -print0)

# Count the number of files found.
file_count=${#files[@]}

# Delete the files.
for file in "${files[@]}"; do
rm "$file"
done

# Print the number of files deleted.
echo "Deleted $file_count files."
Loading