Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
ddbdc9a
[AMDGPU] Add baseline test to show spilling of wmma scale. NFC (#168163)
rampitec Nov 19, 2025
98b1708
[MLIR][NVVM] Doc fixes (#168716)
grypp Nov 19, 2025
1f34550
[gn] port 2675dcd72d02ee1ac (lldb-server PlatformOptions.inc)
nico Nov 19, 2025
bc5f3d2
[gn] port 0ae2bccde45 (arm SDNodeInfo)
nico Nov 19, 2025
3adcfd2
[gn] port e47e9f3b7b136 (nvptx SDNodeInfo)
nico Nov 19, 2025
d2c7c60
[InstSimplify] Add whitespace to struct declarations in vector-calls.…
topperc Nov 19, 2025
1233c4b
Minor fix of reproducer in #165572 (#168751)
googlewalt Nov 19, 2025
a757c4e
CodeGen: Add subtarget to TargetLoweringBase constructor (#168620)
arsenm Nov 19, 2025
36f9d5a
[ASan] Document define to disable container overflow checks at compil…
padriff Nov 19, 2025
fc95558
[TableGen] Use size_t for SubRegIndicesSize (NFC) (#168728)
kazutakahirata Nov 19, 2025
06f0d30
[gn] port 0ae2bccde45 more
nico Nov 19, 2025
fb8155c
[gn build] Port 8fce476c8122
llvmgnsyncbot Nov 19, 2025
60a2795
[Clang][CodeGen] Use EmitLoadOfLValue instead of EmitLoadOfScalar to …
BStott6 Nov 19, 2025
13e09eb
ELF: Add support for relocating R_AARCH64_FUNCINIT64.
pcc Nov 19, 2025
5611268
[CIR] Handle default arguments in ctors (#168649)
andykaylor Nov 19, 2025
afcb953
[bazel] Fix bzlmod reference to @vulkan_sdk (#168767)
rupprecht Nov 19, 2025
e148d2d
[LV] Simplify existing load/store sink/hoisting tests, extend coverage.
fhahn Nov 19, 2025
12131d5
[SLPVectorizer] Widen constant strided loads. (#162324)
mgudim Nov 19, 2025
df58c38
[RISCV][DAGCombiner] Fix potential missed combine in VL->VW extension…
OMG-link Nov 19, 2025
e00314b
workflows/libclang-abi-tests: Remove use of install-ninja action (#16…
tstellar Nov 19, 2025
2f9f492
workflows/hlsl-test-all: Drop use of setup-windows action (#167437)
tstellar Nov 19, 2025
f859427
[CIR] Upstream CIR codegen for mxcsr x86 builtins (#167948)
Thibault-Monnier Nov 19, 2025
c34927a
commit-access-review.py: Remove new contributor check (#168629)
tstellar Nov 19, 2025
11dff3a
[clang-doc][NFC] Lift Mustache template generation from HTML (#167815)
evelez7 Nov 19, 2025
c9f5734
[Analysis] Move TargetLibraryInfo data to TableGen (#165009)
redstar Nov 19, 2025
2b16ae0
[RISCV] Fix CFI Multiple Locations Test (#168772)
lenary Nov 19, 2025
609c88a
[Clang][Sema] Fix __builtin_infer_alloc_token() return type (#168773)
melver Nov 19, 2025
e0c265d
[clang-doc] Fix whitespace issues in Mustache basic test (#168491)
evelez7 Nov 19, 2025
12d7205
[lldb][test] Correctly skip a test on a 32-bit target (#168631)
igorkudrin Nov 19, 2025
253ed52
DAG: Use poison for some vector result widening (#168290)
arsenm Nov 19, 2025
eea6215
[Offload] Make the RPC thread sleep briefly when idle (#168596)
jhuber6 Nov 19, 2025
5c43385
[CIR] Upstream CIR await op (#168133)
Andres-Salamanca Nov 19, 2025
040d9c9
[VPlan] Collect FMFs for in-loop reduction chain in VPlan. (NFC)
fhahn Nov 19, 2025
3b49c92
Fix build breakage from: #167948 (#168781)
erichkeane Nov 19, 2025
f2c9c7d
[OpenACC][CIR] Fix atomic-capture single-line-postfix (#168717)
erichkeane Nov 19, 2025
90ea49a
[ConstantFolding] Generalize constant folding for vector_deinterleave…
topperc Nov 19, 2025
3f55f8b
[CIR] Handle non-empty null base class initialization (#168646)
andykaylor Nov 19, 2025
308185e
[NFC][TableGen] Use `IfGuardEmitter` in CallingConvEmitter (#168763)
jurahul Nov 19, 2025
9b7fd00
[OpenACC] Fix crash when checking an section in a 'link' clause (#168…
erichkeane Nov 19, 2025
19fe9b4
[HLSL][TableGen] Add `__hlsl_resource_t` to known built-in function t…
hekota Nov 19, 2025
e99c83f
[llvm][DebugInfo] Add support for _BitInt in DWARFTypePrinter (#168382)
Michael137 Nov 19, 2025
3f6cbde
[lit] Add LIT_CURRENT_TESTCASE environment variable when running test…
ndrewh Nov 19, 2025
7e85b79
[SystemZ] Fix linux s390x main can't bootstrap itself on SanitizerSpe…
anoopkg6 Nov 19, 2025
be955e5
[OpenACC] Make sure 'link' gets the right node in the AST with ASE
erichkeane Nov 19, 2025
db1e73e
[clang][DebugInfo] Mark _BitInt's as reconstitutable when emitting -g…
Michael137 Nov 19, 2025
8830525
[ConstantFolding] Add constant folding for scalable vector interleave…
topperc Nov 19, 2025
2aa2290
[clang-tidy] Add `IgnoredFilesList` option to `readability-duplicate-…
zeyi2 Nov 19, 2025
1278d47
[CIR] Upstream isfpclass op (#166037)
badumbatish Nov 19, 2025
6a3d6db
merge main into amd-staging
z1-cciauto Nov 19, 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
81 changes: 0 additions & 81 deletions .github/workflows/commit-access-review.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,80 +170,6 @@ def get_num_commits(gh: github.Github, user: str, start_date: datetime.datetime)
return count


def is_new_committer_query_repo(
gh: github.Github, user: str, start_date: datetime.datetime
) -> bool:
"""
Determine if ``user`` is a new committer. A new committer can keep their
commit access even if they don't meet the criteria.
"""
variables = {
"user": user,
}

user_query = """
query ($user: String!) {
user(login: $user) {
id
}
}
"""

res_header, res_data = gh._Github__requester.graphql_query(
query=user_query, variables=variables
)
data = res_data["data"]
variables["owner"] = "llvm"
variables["user_id"] = data["user"]["id"]
variables["start_date"] = start_date.strftime("%Y-%m-%dT%H:%M:%S")

query = """
query ($owner: String!, $user_id: ID!){
organization(login: $owner) {
repository(name: "llvm-project") {
ref(qualifiedName: "main") {
target {
... on Commit {
history(author: {id: $user_id }, first: 5) {
nodes {
committedDate
}
}
}
}
}
}
}
}
"""

res_header, res_data = gh._Github__requester.graphql_query(
query=query, variables=variables
)
data = res_data["data"]
repo = data["organization"]["repository"]
commits = repo["ref"]["target"]["history"]["nodes"]
if len(commits) == 0:
return True
committed_date = commits[-1]["committedDate"]
if datetime.datetime.strptime(committed_date, "%Y-%m-%dT%H:%M:%SZ") < start_date:
return False
return True


def is_new_committer(
gh: github.Github, user: str, start_date: datetime.datetime
) -> bool:
"""
Wrapper around is_new_commiter_query_repo to handle exceptions.
"""
try:
return is_new_committer_query_repo(gh, user, start_date)
except:
pass
return True


def get_review_count(
gh: github.Github, user: str, start_date: datetime.datetime
) -> int:
Expand Down Expand Up @@ -383,13 +309,6 @@ def main():

print("After Commits:", len(triage_list), "triagers")

# Step 4 check for new committers
for user in list(triage_list.keys()):
print("Checking", user)
if is_new_committer(gh, user, one_year_ago):
print("Removing new committer: ", user)
del triage_list[user]

print("Complete:", len(triage_list), "triagers")

with open("triagers.log", "w") as triagers_log:
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/hlsl-test-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ jobs:
repository: llvm/offload-golden-images
ref: main
path: golden-images
- name: Setup Windows
if: runner.os == 'Windows'
uses: llvm/actions/setup-windows@5dd955034a6742a2e21d82bf165fcb1050ae7b49 # main
with:
arch: amd64
- name: Build DXC
run: |
cd DXC
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/libclang-abi-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,6 @@ jobs:
ref: ${{ github.sha }}
repo: ${{ github.repository }}
steps:
- name: Install Ninja
uses: llvm/actions/install-ninja@5dd955034a6742a2e21d82bf165fcb1050ae7b49 # main
- name: Download source code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
Expand Down
136 changes: 136 additions & 0 deletions clang-tools-extra/clang-doc/Generators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@
//===----------------------------------------------------------------------===//

#include "Generators.h"
#include "support/File.h"
#include "llvm/Support/TimeProfiler.h"

LLVM_INSTANTIATE_REGISTRY(clang::doc::GeneratorRegistry)

using namespace llvm;
using namespace llvm::json;
using namespace llvm::mustache;

namespace clang {
namespace doc {

Expand Down Expand Up @@ -42,6 +48,136 @@ std::string getTagType(TagTypeKind AS) {
llvm_unreachable("Unknown TagTypeKind");
}

Error createFileOpenError(StringRef FileName, std::error_code EC) {
return createFileError("cannot open file " + FileName, EC);
}

Error MustacheGenerator::setupTemplate(
std::unique_ptr<MustacheTemplateFile> &Template, StringRef TemplatePath,
std::vector<std::pair<StringRef, StringRef>> Partials) {
auto T = MustacheTemplateFile::createMustacheFile(TemplatePath);
if (Error Err = T.takeError())
return Err;
Template = std::move(T.get());
for (const auto &[Name, FileName] : Partials)
if (auto Err = Template->registerPartialFile(Name, FileName))
return Err;
return Error::success();
}

Error MustacheGenerator::generateDocumentation(
StringRef RootDir, StringMap<std::unique_ptr<doc::Info>> Infos,
const clang::doc::ClangDocContext &CDCtx, std::string DirName) {
{
llvm::TimeTraceScope TS("Setup Templates");
if (auto Err = setupTemplateFiles(CDCtx))
return Err;
}

{
llvm::TimeTraceScope TS("Generate JSON for Mustache");
if (auto JSONGenerator = findGeneratorByName("json")) {
if (Error Err = JSONGenerator.get()->generateDocumentation(
RootDir, std::move(Infos), CDCtx))
return Err;
} else
return JSONGenerator.takeError();
}

SmallString<128> JSONPath;
sys::path::native(RootDir.str() + "/json", JSONPath);

{
llvm::TimeTraceScope TS("Iterate JSON files");
std::error_code EC;
sys::fs::recursive_directory_iterator JSONIter(JSONPath, EC);
std::vector<json::Value> JSONFiles;
JSONFiles.reserve(Infos.size());
if (EC)
return createStringError("Failed to create directory iterator.");

SmallString<128> DocsDirPath(RootDir.str() + '/' + DirName);
sys::path::native(DocsDirPath);
if (auto EC = sys::fs::create_directories(DocsDirPath))
return createFileError(DocsDirPath, EC);
while (JSONIter != sys::fs::recursive_directory_iterator()) {
// create the same directory structure in the docs format dir
if (JSONIter->type() == sys::fs::file_type::directory_file) {
SmallString<128> DocsClonedPath(JSONIter->path());
sys::path::replace_path_prefix(DocsClonedPath, JSONPath, DocsDirPath);
if (auto EC = sys::fs::create_directories(DocsClonedPath)) {
return createFileError(DocsClonedPath, EC);
}
}

if (EC)
return createFileError("Failed to iterate: " + JSONIter->path(), EC);

auto Path = StringRef(JSONIter->path());
if (!Path.ends_with(".json")) {
JSONIter.increment(EC);
continue;
}

auto File = MemoryBuffer::getFile(Path);
if (EC = File.getError(); EC) {
// TODO: Buffer errors to report later, look into using Clang
// diagnostics.
llvm::errs() << "Failed to open file: " << Path << " " << EC.message()
<< '\n';
}

auto Parsed = json::parse((*File)->getBuffer());
if (!Parsed)
return Parsed.takeError();
auto ValidJSON = Parsed.get();

std::error_code FileErr;
SmallString<128> DocsFilePath(JSONIter->path());
sys::path::replace_path_prefix(DocsFilePath, JSONPath, DocsDirPath);
sys::path::replace_extension(DocsFilePath, DirName);
raw_fd_ostream InfoOS(DocsFilePath, FileErr, sys::fs::OF_None);
if (FileErr)
return createFileOpenError(Path, FileErr);

auto RelativeRootPath = getRelativePathToRoot(DocsFilePath, DocsDirPath);
auto InfoTypeStr =
getInfoTypeStr(Parsed->getAsObject(), sys::path::stem(DocsFilePath));
if (!InfoTypeStr)
return InfoTypeStr.takeError();
if (Error Err = generateDocForJSON(*Parsed, InfoOS, CDCtx,
InfoTypeStr.get(), RelativeRootPath))
return Err;
JSONIter.increment(EC);
}
}

return Error::success();
}

Expected<std::string> MustacheGenerator::getInfoTypeStr(Object *Info,
StringRef Filename) {
auto StrValue = (*Info)["InfoType"];
if (StrValue.kind() != json::Value::Kind::String)
return createStringError("JSON file '%s' does not contain key: 'InfoType'.",
Filename.str().c_str());
auto ObjTypeStr = StrValue.getAsString();
if (!ObjTypeStr.has_value())
return createStringError(
"JSON file '%s' does not contain 'InfoType' field as a string.",
Filename.str().c_str());
return ObjTypeStr.value().str();
}

SmallString<128>
MustacheGenerator::getRelativePathToRoot(StringRef PathToFile,
StringRef DocsRootPath) {
SmallString<128> PathVec(PathToFile);
// Remove filename, or else the relative path will have an extra "../"
sys::path::remove_filename(PathVec);
return computeRelativePath(DocsRootPath, PathVec);
}

llvm::Error Generator::createResources(ClangDocContext &CDCtx) {
return llvm::Error::success();
}
Expand Down
88 changes: 84 additions & 4 deletions clang-tools-extra/clang-doc/Generators.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

#include "Representation.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/JSON.h"
#include "llvm/Support/Mustache.h"
#include "llvm/Support/Registry.h"

namespace clang {
Expand All @@ -27,10 +29,9 @@ class Generator {

// Write out the decl info for the objects in the given map in the specified
// format.
virtual llvm::Error
generateDocs(StringRef RootDir,
llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
const ClangDocContext &CDCtx) = 0;
virtual llvm::Error generateDocumentation(
StringRef RootDir, llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
const ClangDocContext &CDCtx, std::string DirName = "") = 0;

// This function writes a file with the index previously constructed.
// It can be overwritten by any of the inherited generators.
Expand All @@ -52,6 +53,85 @@ findGeneratorByName(llvm::StringRef Format);

std::string getTagType(TagTypeKind AS);

llvm::Error createFileOpenError(StringRef FileName, std::error_code EC);

class MustacheTemplateFile {
llvm::BumpPtrAllocator Allocator;
llvm::StringSaver Saver;
llvm::mustache::MustacheContext Ctx;
llvm::mustache::Template T;
std::unique_ptr<llvm::MemoryBuffer> Buffer;

public:
static Expected<std::unique_ptr<MustacheTemplateFile>>
createMustacheFile(StringRef FileName) {
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> BufferOrError =
llvm::MemoryBuffer::getFile(FileName);
if (auto EC = BufferOrError.getError())
return createFileOpenError(FileName, EC);
return std::make_unique<MustacheTemplateFile>(
std::move(BufferOrError.get()));
}

llvm::Error registerPartialFile(StringRef Name, StringRef FileName) {
llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> BufferOrError =
llvm::MemoryBuffer::getFile(FileName);
if (auto EC = BufferOrError.getError())
return createFileOpenError(FileName, EC);

std::unique_ptr<llvm::MemoryBuffer> Buffer = std::move(BufferOrError.get());
StringRef FileContent = Buffer->getBuffer();
T.registerPartial(Name.str(), FileContent.str());
return llvm::Error::success();
}

void render(llvm::json::Value &V, raw_ostream &OS) { T.render(V, OS); }

MustacheTemplateFile(std::unique_ptr<llvm::MemoryBuffer> &&B)
: Saver(Allocator), Ctx(Allocator, Saver), T(B->getBuffer(), Ctx),
Buffer(std::move(B)) {}
};

struct MustacheGenerator : public Generator {
Expected<std::string> getInfoTypeStr(llvm::json::Object *Info,
StringRef Filename);

/// Used to find the relative path from the file to the format's docs root.
/// Mainly used for the HTML resource paths.
SmallString<128> getRelativePathToRoot(StringRef PathToFile,
StringRef DocsRootPath);
virtual ~MustacheGenerator() = default;

/// Initializes the template files from disk and calls setupTemplate to
/// register partials
virtual llvm::Error setupTemplateFiles(const ClangDocContext &CDCtx) = 0;

/// Populates templates with data from JSON and calls any specifics for the
/// format. For example, for HTML it will render the paths for CSS and JS.
virtual llvm::Error generateDocForJSON(llvm::json::Value &JSON,
llvm::raw_fd_ostream &OS,
const ClangDocContext &CDCtx,
StringRef ObjectTypeStr,
StringRef RelativeRootPath) = 0;

/// Registers partials to templates.
llvm::Error
setupTemplate(std::unique_ptr<MustacheTemplateFile> &Template,
StringRef TemplatePath,
std::vector<std::pair<StringRef, StringRef>> Partials);

/// \brief The main orchestrator for Mustache-based documentation.
///
/// 1. Initializes templates files from disk by calling setupTemplateFiles.
/// 2. Calls the JSON generator to write JSON to disk.
/// 3. Iterates over the JSON files, recreates the directory structure from
/// JSON, and calls generateDocForJSON for each file.
/// 4. A file of the desired format is created.
llvm::Error generateDocumentation(
StringRef RootDir, llvm::StringMap<std::unique_ptr<doc::Info>> Infos,
const clang::doc::ClangDocContext &CDCtx, std::string DirName) override;
};

// This anchor is used to force the linker to link in the generated object file
// and thus register the generators.
extern volatile int YAMLGeneratorAnchorSource;
Expand Down
Loading