Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
8aeeb9f
[AArch64] Don't call fma/fmaf for @llvm.fmuladd.f64/f32 in softfp (#2…
statham-arm Jun 25, 2026
a85dcb8
[libc] fix oob and overflow bugs in wcslcat and wcsncat (#203697)
hardikxk Jun 25, 2026
8cd49c6
[Flang][MLIR][OpenMP] Explicitly represent omp.target kernel types (#…
skatrak Jun 25, 2026
3e4c108
[MLIR][OpenMP] Explicit tagging of combined constructs (#198782)
skatrak Jun 25, 2026
e8cca37
[Flang][OpenMP] Add combined construct information (#198783)
skatrak Jun 25, 2026
fdb2f1b
[X86] Fold splat XOR on VGF2P8AFFINEQB source (#204508)
WalterKruger Jun 25, 2026
236a0d1
[libsycl] add UT for kernel submission (#203931)
KseniyaTikhomirova Jun 25, 2026
4b85f3c
[X86] Select BLSMSK for i8 operands (#205093)
ChiragPatel8 Jun 25, 2026
47caa5d
[mlir][SPIR-V] Convert math.atan2 to GL atan2 (#201928)
aobolensk Jun 25, 2026
2c1d884
Reapply "[InstCombine] Merge consecutive assumes", round 2 (#205773)
philnik777 Jun 25, 2026
3ff82c7
[Support][CHERI] Refactor CHERICapabilityFormatBase to embrace CRTP (…
jrtc27 Jun 25, 2026
d9e53b2
clang: Move __builtin_amdgcn_processor_is diagnostic test to sema (#2…
arsenm Jun 25, 2026
5314be5
[MLIR][WASM] Re-Introduce the RaiseWasmMLIRPass to convert WasmSSA ML…
flemairen6 Jun 25, 2026
94ae3dd
[clangd] Fix unknown doxygen command parsing in parameter documentati…
tcottin Jun 25, 2026
c07bc29
[Attr] Add `noipa` function attribute (#203304)
jryans Jun 25, 2026
1f84b4a
[TySan] Remove incorrect memcpy shadow memory tracking (#199958)
gbMattN Jun 25, 2026
07097a5
[VPlan] Allow VPValue in match_fn without needing explicit template a…
lukel97 Jun 25, 2026
3dc2e17
[ComplexDeinterleaving] Add test for duplicate reassoc addends (NFC) …
igogo-x86 Jun 25, 2026
75a2567
[LifetimeSafety] Gate annotation suggestions behind `SuggestAnnotatio…
usx95 Jun 25, 2026
0c540b9
[analyzer] Fix unjustified early return in processCallExit (#205656)
NagyDonat Jun 25, 2026
87f7884
[NaryReassociate] Fix divide by zero crash in NaryReassociatePass (#2…
t-demchuk Jun 25, 2026
e098135
[clang][dataflow] Move expensive solver asserts under EXPENSIVE_CHECK…
zeyi2 Jun 25, 2026
5fdc948
[Offload][OpenMP][Flang] Update no-loop test (#205803)
skatrak Jun 25, 2026
87c11c9
[libc] Add libgen.h to target public headers (#205804)
kaladron Jun 25, 2026
c834d1a
[clang][bytecode] Fix `evaluateDestruction()` (#205778)
tbaederr Jun 25, 2026
630125a
Revert "Reapply "[InstCombine] Merge consecutive assumes", round 2" (…
philnik777 Jun 25, 2026
4d4c865
[mlir][vector] add consistent stride verification to `masked load/sto…
FedericoBruzzone Jun 25, 2026
647c298
[AArch64] Correct A510 scheduling information for LDn instructions (#…
john-brawn-arm Jun 25, 2026
ec574cf
[Bazel] Fixes 5314be5 (#205818)
ingomueller-net Jun 25, 2026
bef95e5
[libc][stdlib] Add unsetenv (#202422)
kaladron Jun 25, 2026
755bc5c
[libc++] Add missing attribute usages to `<__memory/shared_ptr.h>` (#…
frederick-vs-ja Jun 25, 2026
7b54691
clang/HIP: Remove some unused ocml function declarations (#204735)
arsenm Jun 25, 2026
f36745e
[libc][math][c23] Add tanbf16 math function (#185100)
Sukumarsawant Jun 25, 2026
acff1e5
[lldb] Don't fail scripted frame construction on WebAssembly (#205692)
JDevlieghere Jun 25, 2026
b45bb83
[LV] Regen runtime-checks-hoist.ll with newer UTC. NFC (#205831)
lukel97 Jun 25, 2026
28475c2
[RISCV][P-ext] Select signed widening add/sub accumulate to wadda/wsu…
sihuan Jun 25, 2026
84c42fe
[clang][opencl][sycl] Deprecate opencl_global_device and opencl_globa…
elizabethandrews Jun 25, 2026
0bb2b00
[libsycl] add operators to sycl::range and sycl::id (#203572)
KseniyaTikhomirova Jun 25, 2026
213c7b7
[CIR][OpenMP] Initial implementation of target region support (#195452)
jsjodin Jun 25, 2026
c1869ff
[flang-rt][CMake] Avoid 'use, intrinsic ::' (#205634)
Meinersbur Jun 25, 2026
ec6eed0
[libc++] Remove __broadcast simd function (#205559)
philnik777 Jun 25, 2026
17d49bc
[lldb][Linux][AArch64] Get NT_ARM_ constants from llvm's ELF header (…
DavidSpickett Jun 25, 2026
383f858
[AArch64] Preserve SDNode flags when lowering fixed vectors to scalab…
Harry-Ramsey Jun 25, 2026
ff066c7
[IR] Don't match icmp+select as min/max (#205595)
aengelke Jun 25, 2026
77b0b29
[lldb] Return an empty extractor for unmappable subset requests (#205…
JDevlieghere Jun 25, 2026
003a760
clang/AMDGPU: Remove gizcl triples from tests (#205811)
arsenm Jun 25, 2026
0351190
[docs] Enforce unambiguous toctree in llvm/docs (#203967)
slinder1 Jun 25, 2026
94c1a8b
[NVPTX] Fold symbol addresses into memory operands (#202379)
maleadt Jun 25, 2026
30b88eb
[LLVM][Intrinsics] Fix `llvm_anyptr_ty` to disallow vector of pointer…
jurahul Jun 25, 2026
bb620ab
Revert "[mlir][vector] add consistent stride verification to `masked …
ingomueller-net Jun 25, 2026
9dee94a
[ComplexDeinterleaving] Preserve duplicate reassoc addends in identif…
igogo-x86 Jun 25, 2026
4feb14a
[Bazel] Fixes f36745e (#205837)
forking-google-bazel-bot[bot] Jun 25, 2026
76ddb39
[flang][acc] Avoid assert for assumed-size arrays without a descripto…
khaki3 Jun 25, 2026
e74b6bc
[mlir][acc] Run acc-specialize-for-host rewrite to convergence (#205727)
khaki3 Jun 25, 2026
df49da3
[flang][OpenMP] Decompose combined construct selectors in variant mat…
abidh Jun 25, 2026
0e84786
[CIR] Zero-init array-new with trivial ctor (#205611)
adams381 Jun 25, 2026
d3c00bf
Bazel driver-tools build-setting simplification (#205846)
dzbarsky Jun 25, 2026
fcc105f
[clang-tidy] Move isStdInitializerList to utils::type_traits and add …
grigorypas Jun 25, 2026
78247bf
[SROA] Adjust struct layout requirements for struct to vector canonic…
YonahGoldberg Jun 25, 2026
d4148a8
[libc][docs] add `builtin_compatibility` (#200539)
hulxv Jun 25, 2026
4f638ff
[mlir][acc] Drop redundant `acc.terminator` erase that broke atomic c…
khaki3 Jun 25, 2026
04450c8
[mlir][SPIR-V] Add CL copysign, fdim, fmod and hypot ops (#203880)
aobolensk Jun 25, 2026
d0373ba
[mlir][SPIR-V] Add GL NMin, NMax and NClamp ops (#203878)
aobolensk Jun 25, 2026
4c20398
[SLP] Add pre-commit tests for zero-tested OR/UMax reductions (NFC) (…
ParkHanbum Jun 25, 2026
6d64753
[clang][bytecode] Don't ignore discarded `DeclRefExpr`s (#204165)
tbaederr Jun 25, 2026
cf223eb
[OpenACC] Add pass `ACCEmitRemarksPrivate`. (#205824)
moazin Jun 25, 2026
5e85dbc
[lldb] Use the source name when the linkage name is not mangled (#205…
JDevlieghere Jun 25, 2026
d5d0858
merge main into amd-staging
ronlieb Jun 25, 2026
7da470f
[intrinsics] add back some intrinsics needed by hipamd
ronlieb Jun 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 2 additions & 22 deletions clang-tools-extra/clang-tidy/misc/ExplicitConstructorCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#include "ExplicitConstructorCheck.h"
#include "../utils/LexerUtils.h"
#include "../utils/TypeTraits.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/ASTMatchers/ASTMatchers.h"
Expand All @@ -31,27 +32,6 @@ void ExplicitConstructorCheck::registerMatchers(MatchFinder *Finder) {
this);
}

static bool declIsStdInitializerList(const NamedDecl *D) {
// First use the fast getName() method to avoid unnecessary calls to the
// slow getQualifiedNameAsString().
return D->getName() == "initializer_list" &&
D->getQualifiedNameAsString() == "std::initializer_list";
}

static bool isStdInitializerList(QualType Type) {
Type = Type.getCanonicalType();
if (const auto *TS = Type->getAs<TemplateSpecializationType>()) {
if (const TemplateDecl *TD = TS->getTemplateName().getAsTemplateDecl())
return declIsStdInitializerList(TD);
}
if (const auto *RT = Type->getAs<RecordType>()) {
if (const auto *Specialization =
dyn_cast<ClassTemplateSpecializationDecl>(RT->getDecl()))
return declIsStdInitializerList(Specialization->getSpecializedTemplate());
}
return false;
}

void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) {
constexpr char NoExpressionWarningMessage[] =
"%0 must be marked explicit to avoid unintentional implicit conversions";
Expand Down Expand Up @@ -79,7 +59,7 @@ void ExplicitConstructorCheck::check(const MatchFinder::MatchResult &Result) {

const ExplicitSpecifier ExplicitSpec = Ctor->getExplicitSpecifier();

const bool TakesInitializerList = isStdInitializerList(
const bool TakesInitializerList = utils::type_traits::isStdInitializerList(
Ctor->getParamDecl(0)->getType().getNonReferenceType());
if (ExplicitSpec.isExplicit() &&
(Ctor->isCopyOrMoveConstructor() || TakesInitializerList)) {
Expand Down
19 changes: 19 additions & 0 deletions clang-tools-extra/clang-tidy/utils/TypeTraits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "TypeTraits.h"
#include "clang/AST/ASTContext.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
#include <optional>

namespace clang::tidy::utils::type_traits {
Expand Down Expand Up @@ -146,4 +147,22 @@ bool hasNonTrivialMoveAssignment(QualType Type) {
Record->hasNonTrivialMoveAssignment();
}

static bool declIsStdInitializerList(const NamedDecl *D) {
return D->isInStdNamespace() && D->getName() == "initializer_list";
}

bool isStdInitializerList(QualType Type) {
Type = Type.getCanonicalType();
if (const auto *TS = Type->getAs<TemplateSpecializationType>()) {
if (const TemplateDecl *TD = TS->getTemplateName().getAsTemplateDecl())
return declIsStdInitializerList(TD);
}
if (const auto *RT = Type->getAs<RecordType>()) {
if (const auto *Specialization =
dyn_cast_if_present<ClassTemplateSpecializationDecl>(RT->getDecl()))
return declIsStdInitializerList(Specialization->getSpecializedTemplate());
}
return false;
}

} // namespace clang::tidy::utils::type_traits
3 changes: 3 additions & 0 deletions clang-tools-extra/clang-tidy/utils/TypeTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ bool hasNonTrivialMoveConstructor(QualType Type);
/// Return true if `Type` has a non-trivial move assignment operator.
bool hasNonTrivialMoveAssignment(QualType Type);

/// Returns `true` if `Type` is a `std::initializer_list<...>` specialization.
bool isStdInitializerList(QualType Type);

} // namespace clang::tidy::utils::type_traits

#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
7 changes: 4 additions & 3 deletions clang-tools-extra/clangd/CodeCompletionStrings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,12 @@ std::string getDeclComment(const ASTContext &Ctx, const NamedDecl &Decl) {
// not write them into PCH, because they are racy and slow to load.
assert(!Ctx.getSourceManager().isLoadedSourceLocation(RC->getBeginLoc()));

comments::FullComment *FC = RC->parse(Ctx, /*PP=*/nullptr, ND);
if (!FC)
std::string DeclDoc =
RC->getFormattedText(Ctx.getSourceManager(), Ctx.getDiagnostics());
if (!looksLikeDocComment(DeclDoc))
return "";

SymbolDocCommentVisitor V(FC, Ctx.getLangOpts().CommentOpts);
SymbolDocCommentVisitor V(DeclDoc, Ctx.getLangOpts().CommentOpts);
std::string RawDoc;
llvm::raw_string_ostream OS(RawDoc);

Expand Down
18 changes: 10 additions & 8 deletions clang-tools-extra/clangd/SymbolDocumentation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ void commandToMarkup(markup::Paragraph &Out, StringRef Command,
comments::CommandMarkerKind CommandMarker,
StringRef Args) {
Out.appendBoldText(commandMarkerAsString(CommandMarker) + Command.str());
Out.appendSpace();
if (!Args.empty())
if (!Args.empty()) {
Out.appendSpace();
Out.appendCode(Args.str());
}
}

template <typename T> std::string getArgText(const T *Command) {
Expand Down Expand Up @@ -108,6 +109,7 @@ class ParagraphToMarkupDocument

commandToMarkup(Out, C->getCommandName(Traits), C->getCommandMarker(),
"");
LastChunkEndsWithNewline = false;
}
}

Expand Down Expand Up @@ -159,15 +161,18 @@ class ParagraphToString
}
}

void visitTextComment(const comments::TextComment *C) { Out << C->getText(); }
void visitTextComment(const comments::TextComment *C) {
Out << C->getText();
if (C->hasTrailingNewline())
Out << "\n";
}

void visitInlineCommandComment(const comments::InlineCommandComment *C) {
Out << commandMarkerAsString(C->getCommandMarker());
Out << C->getCommandName(Traits);
std::string ArgText = getArgText(C);
if (!ArgText.empty())
Out << " " << ArgText;
Out << " ";
}

void visitHTMLStartTagComment(const comments::HTMLStartTagComment *STC) {
Expand Down Expand Up @@ -251,10 +256,7 @@ class BlockCommentToMarkupDocument
commandToMarkup(P, B->getCommandName(Traits), B->getCommandMarker(),
ArgText);
if (B->getParagraph() && !B->getParagraph()->isWhitespace()) {
// For commands with arguments, the paragraph starts after the first
// space. Therefore we need to append a space manually in this case.
if (!ArgText.empty())
P.appendSpace();
P.appendSpace();
ParagraphToMarkupDocument(P, Traits).visit(B->getParagraph());
}
}
Expand Down
11 changes: 0 additions & 11 deletions clang-tools-extra/clangd/SymbolDocumentation.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,6 @@ namespace clangd {
class SymbolDocCommentVisitor
: public comments::ConstCommentVisitor<SymbolDocCommentVisitor> {
public:
SymbolDocCommentVisitor(comments::FullComment *FC,
const CommentOptions &CommentOpts)
: Traits(Allocator, CommentOpts), Allocator() {
if (!FC)
return;

for (auto *Block : FC->getBlocks()) {
visit(Block);
}
}

SymbolDocCommentVisitor(llvm::StringRef Documentation,
const CommentOptions &CommentOpts)
: Traits(Allocator, CommentOpts), Allocator() {
Expand Down
12 changes: 12 additions & 0 deletions clang-tools-extra/clangd/support/Markup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,16 +537,28 @@ void Paragraph::renderEscapedMarkdown(llvm::raw_ostream &OS) const {
void Paragraph::renderMarkdown(llvm::raw_ostream &OS) const {
bool NeedsSpace = false;
bool HasChunks = false;
bool TextEndsWithNewline = false;
std::string ParagraphText;
ParagraphText.reserve(EstimatedStringSize);
llvm::raw_string_ostream ParagraphTextOS(ParagraphText);
for (auto &C : Chunks) {

if (TextEndsWithNewline) {
ParagraphTextOS << "\n";
TextEndsWithNewline = false;
}

if (C.SpaceBefore || NeedsSpace)
ParagraphTextOS << " ";

switch (C.Kind) {
case ChunkKind::PlainText:
ParagraphTextOS << renderText(C.Contents, !HasChunks,
/*EscapeMarkdown=*/false);
// renderText removes trailing newlines, but in case there are additional
// chunks to process, we need to keep track of the trailing newline and
// add it in the next iteration.
TextEndsWithNewline = llvm::StringRef(C.Contents).ends_with("\n");
break;
case ChunkKind::InlineCode:
ParagraphTextOS << renderInlineBlock(C.Contents);
Expand Down
54 changes: 54 additions & 0 deletions clang-tools-extra/clangd/unittests/CodeCompletionStringsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//

#include "CodeCompletionStrings.h"
#include "Config.h"
#include "TestTU.h"
#include "clang/Sema/CodeCompleteConsumer.h"
#include "gmock/gmock.h"
Expand Down Expand Up @@ -69,6 +70,59 @@ TEST_F(CompletionStringTest, GetDeclCommentBadUTF8) {
getDeclComment(AST.getASTContext(), findDecl(AST, "X")));
}

TEST_F(CompletionStringTest, GetDeclCommentForParam) {
auto TU =
TestTU::withCode("/** @param a this is param a */\nvoid func(int a);");
auto AST = TU.build();
Config Cfg;
Cfg.Documentation.CommentFormat = Config::CommentFormatPolicy::Doxygen;
WithContextValue WithCfg(Config::Key, std::move(Cfg));
const auto &FD = llvm::cast<FunctionDecl>(findDecl(AST, "func"));
EXPECT_EQ(FD.getNumParams(), 1UL);
EXPECT_EQ("this is param a",
getDeclComment(AST.getASTContext(), *FD.parameters()[0]));
}

TEST_F(CompletionStringTest, GetDeclCommentForMultipleParams) {
auto TU = TestTU::withCode("/** @param a this is param a\n * @param b this "
"is param b\n */\nvoid func(int a, int b);");
auto AST = TU.build();
Config Cfg;
Cfg.Documentation.CommentFormat = Config::CommentFormatPolicy::Doxygen;
WithContextValue WithCfg(Config::Key, std::move(Cfg));
const auto &FD = llvm::cast<FunctionDecl>(findDecl(AST, "func"));
EXPECT_EQ(FD.getNumParams(), 2UL);
EXPECT_EQ("this is param a",
getDeclComment(AST.getASTContext(), *FD.parameters()[0]));
EXPECT_EQ("this is param b",
getDeclComment(AST.getASTContext(), *FD.parameters()[1]));
}

TEST_F(CompletionStringTest, GetDeclCommentForUndocumentedParam) {
auto TU =
TestTU::withCode("/** @param c this is param c */\nvoid func(int a);");
auto AST = TU.build();
Config Cfg;
Cfg.Documentation.CommentFormat = Config::CommentFormatPolicy::Doxygen;
WithContextValue WithCfg(Config::Key, std::move(Cfg));
const auto &FD = llvm::cast<FunctionDecl>(findDecl(AST, "func"));
EXPECT_EQ(FD.getNumParams(), 1UL);
EXPECT_EQ("", getDeclComment(AST.getASTContext(), *FD.parameters()[0]));
}

TEST_F(CompletionStringTest, GetDeclCommentForParamWithUnknownDoxygenCommand) {
auto TU = TestTU::withCode("/** @param a this is param a and an\n * @unknown "
"command\n */\nvoid func(int a);");
auto AST = TU.build();
Config Cfg;
Cfg.Documentation.CommentFormat = Config::CommentFormatPolicy::Doxygen;
WithContextValue WithCfg(Config::Key, std::move(Cfg));
const auto &FD = llvm::cast<FunctionDecl>(findDecl(AST, "func"));
EXPECT_EQ(FD.getNumParams(), 1UL);
EXPECT_EQ("this is param a and an\n@unknown command",
getDeclComment(AST.getASTContext(), *FD.parameters()[0]));
}

TEST_F(CompletionStringTest, MultipleAnnotations) {
Builder.AddAnnotation("Ano1");
Builder.AddAnnotation("Ano2");
Expand Down
66 changes: 66 additions & 0 deletions clang-tools-extra/clangd/unittests/HoverTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4431,6 +4431,56 @@ brief doc
### Details

longer doc)"},
{[](HoverInfo &HI) {
HI.Kind = index::SymbolKind::Function;
HI.Documentation = "@brief brief doc\n"
"@unknown command is treated as an inline command";
HI.Definition = "int foo(int a)";
HI.ReturnType = "int";
HI.Name = "foo";
HI.Parameters.emplace();
HI.Parameters->emplace_back();
HI.Parameters->back().Type = "int";
HI.Parameters->back().Name = "a";
},
R"(### function `foo`

---
→ `int`

Parameters:

- `int a`

@brief brief doc
@unknown command is treated as an inline command

---
```cpp
int foo(int a)
```)",
R"(### function

---
```cpp
int foo(int a)
```

---
### Brief

brief doc
**@unknown** command is treated as an inline command

---
### Parameters

- `int a`

---
### Returns

`int`)"},
};

for (const auto &C : Cases) {
Expand Down Expand Up @@ -5203,6 +5253,22 @@ TEST(Hover, FunctionParameters) {
"### param\n\n---\n```cpp\n// In foo\nint b\n```\n\n---\nthis is "
"\\<b>doc\\</b> \\<html-tag attribute/> \\<another-html-tag "
"attribute=\"value\">for\\</another-html-tag> `b`\n\n---\nType: `int`"},
{R"cpp(/// Function doc
/// @param a the next command is an
/// @unknown command.
void foo(int [[^a]]);
)cpp",
[](HoverInfo &HI) {
HI.Name = "a";
HI.Kind = index::SymbolKind::Parameter;
HI.NamespaceScope = "";
HI.LocalScope = "foo::";
HI.Type = "int";
HI.Definition = "int a";
HI.Documentation = "the next command is an\n @unknown command.";
},
"### param\n\n---\n```cpp\n// In foo\nint a\n```\n\n---\nthe next "
"command is an\n**@unknown** command.\n\n---\nType: `int`"},
};

// Create a tiny index, so tests above can verify documentation is fetched.
Expand Down
Loading
Loading