Skip to content
Open
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
8 changes: 8 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,14 @@ jobs:
build-dir: build
github-token: ${{ secrets.GITHUB_TOKEN }}

# The extracted LLVM source tree ships its own .profraw test fixtures,
# in an older raw-profile version that llvm-profdata rejects. They are
# not ours, so drop them before the coverage step globs build/ for
# *.profraw.
- name: Prune third-party profraw
if: matrix.coverage
run: find build/third-party -name '*.profraw' -delete

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What’s this profraw issue? The explanation is more descriptive than explanatory of the motivation of the command. It seems to me like if this is happening and coverage is globing the wrong directory, that’s what should be fixed instead of a second workaround to accommodate the first mistake.


- name: Process Coverage
id: process-coverage
if: matrix.coverage
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/ci-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,16 @@ jobs:
standards: '23'
main-entry-factors: |
clang Coverage
# MSan builds an instrumented libc++ from the pinned LLVM sources,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t like some of the excessive comments that likely come from using AI. The thing with AI is that it doesn’t know how to not say things. For instance, you tell AI to not say “X” and very often it gives you text like “I’m not even going to bring up X”.

Because it’s a text-generating machine. It has no button for not generating text.

For instance, in this particular PR, it’s obvious AI was moving MSan to latest-factors and felt like it just to justify this in a comment. The comment is coherent with what it had in its context but it’s not coherent with the rest of the code. After this is merged, a person reading this file doesn’t know this context. This looks like it’s documentation for latest-factors and makes no sense there. The user wouldn’t even know this option was not in latest-factors before. The user won’t understand why msan and not latest-factors is explained here. They won’t understand why this is the only factor singled-out and so on.

# which only a recent Clang can compile, so keep it on the latest
# Clang; an older one (such as 20) fails to build it. ASan does not
# build libc++ (bootstrap builds it for MSan only), so it can stay
# distributed.
latest-factors: |
clang UBSan
clang UBSan MSan
factors: |
gcc UBSan
clang ASan MSan
clang ASan
apple-clang UBSan ASan
build-types: |
gcc: Release
Expand Down Expand Up @@ -75,14 +80,8 @@ jobs:
append-common-cxxflags: |
clang: -gz=zstd
extra-values: |
# libc++ runtimes: clang + (ASan or MSan) needs instrumented libc++

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these gone? Weren't they being used? Interesting. I thought we used the custom libc++ whenever we had msan or asan. It it because the logic for this necessity is now being checked in the bootstrap script?

# built separately from the main LLVM build
use-libcxx: {{and (ieq compiler 'clang') (or msan asan)}}
libcxx-runtimes: {{select (ne compiler 'msvc') "libcxx;libcxxabi" "libcxx"}}
llvm-runtimes: {{{select (ine use-libcxx 'true') libcxx-runtimes ""}}}

# LLVM build configuration
llvm-hash: dc4cef81d47c7bc4a3c4d58fbacf8a6359683fae
llvm-hash: 77e43ec11cd8fbe1de491118b54de9bba94510a8
llvm-short-hash: {{{substr llvm-hash 0 7}}}
llvm-preset-build-type: {{{lowercase build-type}}}
llvm-preset-os: {{select (ieq os 'windows') "win" "unix"}}
Expand Down
24 changes: 1 addition & 23 deletions share/mrdocs/headers/libc-stubs/new.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,7 @@
#define MRDOCS_SHARE_HEADERS_LIBC_STUBS_NEW_H

#if defined(_LIBCPP_ABI_VCRUNTIME)
namespace std {
enum class align_val_t : size_t {};
struct nothrow_t { explicit nothrow_t() = default; };
extern const std::nothrow_t nothrow;
}

// Replaceable allocation functions
void* operator new ( std::size_t count );
void* operator new[]( std::size_t count );
void* operator new ( std::size_t count, std::align_val_t al );
void* operator new[]( std::size_t count, std::align_val_t al );

// Replaceable non-throwing allocation functions
void* operator new ( std::size_t count, const std::nothrow_t& tag );
void* operator new[]( std::size_t count, const std::nothrow_t& tag );
void* operator new ( std::size_t count, std::align_val_t al,
const std::nothrow_t& tag ) noexcept;
void* operator new[]( std::size_t count, std::align_val_t al,
const std::nothrow_t& tag ) noexcept;

// Non-allocating placement allocation functions
void* operator new ( std::size_t count, void* ptr );
void* operator new[]( std::size_t count, void* ptr );
#include <vcruntime_new.h>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Is this something being fixed in passing or do we have something about the new version that interacts with the libc stubs? In fact, I would have this question about all other changes to the libc stubs. It's unexpected to me that they interacted in an LLVM bump.

#endif

#endif // MRDOCS_SHARE_HEADERS_LIBC_STUBS_NEW_H
5 changes: 4 additions & 1 deletion share/mrdocs/headers/libc-stubs/stdalign.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
#ifndef MRDOCS_SHARE_HEADERS_LIBC_STUBS_STDALIGN_H
#define MRDOCS_SHARE_HEADERS_LIBC_STUBS_STDALIGN_H

// Convenience macros for alignment
// Convenience macros for alignment. In C++ alignas/alignof are keywords (and
// _Alignas/_Alignof are not valid), so only define them when compiling as C.
#ifndef __cplusplus
#define alignas _Alignas
#define alignof _Alignof
#endif

// Macro constants indicating the presence of alignment features
#define __alignas_is_defined 1
Expand Down
5 changes: 4 additions & 1 deletion share/mrdocs/headers/libc-stubs/stdbool.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@
#ifndef MRDOCS_SHARE_HEADERS_LIBC_STUBS_STDBOOL_H
#define MRDOCS_SHARE_HEADERS_LIBC_STUBS_STDBOOL_H

// Convenience macros for boolean values
// Convenience macros for boolean values. In C++ these are keywords (and
// _Bool is not a type), so only define them when compiling as C.
#ifndef __cplusplus
#define bool _Bool
#define true 1
#define false 0
#endif

// Macro constant indicating the presence of boolean features
#define __bool_true_false_are_defined 1
Expand Down
5 changes: 4 additions & 1 deletion share/mrdocs/headers/libc-stubs/threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,11 @@ int cnd_wait(cnd_t *cond, mtx_t *mtx);
int cnd_timedwait(cnd_t *cond, mtx_t *mtx, const struct timespec *ts);
void cnd_destroy(cnd_t *cond);

// Thread-local storage
// Thread-local storage. In C++ thread_local is a keyword (and _Thread_local
// is not valid), so only define it when compiling as C.
#ifndef __cplusplus
#define thread_local _Thread_local
#endif

typedef void (*tss_dtor_t)(void *);
typedef struct {
Expand Down
41 changes: 41 additions & 0 deletions share/mrdocs/headers/libc-stubs/vcruntime_new.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// Copyright (c) 2024 Alan de Freitas (alandefreitas@gmail.com)
//
// Official repository: https://github.com/cppalliance/mrdocs
//

#ifndef MRDOCS_SHARE_HEADERS_LIBC_STUBS_VCRUNTIME_NEW_H
#define MRDOCS_SHARE_HEADERS_LIBC_STUBS_VCRUNTIME_NEW_H

// libc++ includes this Microsoft runtime header (through <__new/align_val_t.h>)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole comment, especially "Provide just enough of it for parsing." seems redundant because this is true for all stubs by definition. They're headers libc++ includes for its own functionality and we provide only enough for parsing.

// when built for the vcruntime ABI, so that std::align_val_t is layout-compatible
// with the platform. Provide just enough of it for parsing.
namespace std {
enum class align_val_t : size_t {};
struct nothrow_t { explicit nothrow_t() = default; };
extern const std::nothrow_t nothrow;
}

// Replaceable allocation functions
void* operator new ( std::size_t count );
void* operator new[]( std::size_t count );
void* operator new ( std::size_t count, std::align_val_t al );
void* operator new[]( std::size_t count, std::align_val_t al );

// Replaceable non-throwing allocation functions
void* operator new ( std::size_t count, const std::nothrow_t& tag );
void* operator new[]( std::size_t count, const std::nothrow_t& tag );
void* operator new ( std::size_t count, std::align_val_t al,
const std::nothrow_t& tag ) noexcept;
void* operator new[]( std::size_t count, std::align_val_t al,
const std::nothrow_t& tag ) noexcept;

// Non-allocating placement allocation functions
void* operator new ( std::size_t count, void* ptr );
void* operator new[]( std::size_t count, void* ptr );

#endif // MRDOCS_SHARE_HEADERS_LIBC_STUBS_VCRUNTIME_NEW_H
2 changes: 1 addition & 1 deletion src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
#include <clang/AST/RawCommentList.h>
#include <clang/AST/TypeVisitor.h>
#include <clang/Frontend/CompilerInstance.h>
#include <clang/Index/USRGeneration.h>
#include <clang/Lex/Lexer.h>
#include <clang/Sema/Lookup.h>
#include <clang/Sema/Sema.h>
#include <clang/Sema/Template.h>
#include <clang/UnifiedSymbolResolution/USRGeneration.h>
#include <llvm/ADT/StringExtras.h>
#include <llvm/Support/Error.h>
#include <llvm/Support/Process.h>
Expand Down
Loading
Loading