Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
d28a4f1
[mlir][affine]introducing new symbol rules that the result of a `Pure…
linuxlonelyeagle Jan 17, 2025
f597d34
[clang][Sema] Move computing best enum types to a separate function (…
kuilpd Jan 17, 2025
6dcb2a0
[MLIR][NVVM] Add Float to TF32 conversion Op (#123199)
durga4github Jan 17, 2025
361f363
[clang-tidy]fix incorrect fix-it for the string contains a user-defin…
HerrCai0907 Jan 17, 2025
48d0ef1
[clang-tidy][NFC] refactor modernize-raw-string-literal fix hint (#12…
HerrCai0907 Jan 17, 2025
7629e01
[InstCombine,PhaseOrder] Add additional tests with align assumptions.
fhahn Jan 17, 2025
dc1ef2c
[lldb][DWARFASTParserClang] Don't overwrite DW_AT_object_pointer of d…
Michael137 Jan 17, 2025
eb7dea8
[mutation analyzer] enhance stability for `hasAnyInit` matcher (#122915)
HerrCai0907 Jan 17, 2025
0171e56
[clang][bytecode] Fix rejecting invalid sizeof expressions (#123332)
tbaederr Jan 17, 2025
baa5b76
[C++20] [Modules] Make module local decls visible to language linkage…
ChuanqiXu9 Jan 17, 2025
48803bc
[X86][AMX-AVX512][NFC] Remove P from intrinsic and instruction name (…
phoebewang Jan 17, 2025
8688a31
[libc++] Allow passing arguments to GoogleBenchmark's compare.py tool
ldionne Jan 17, 2025
703e9e9
[AMDGPU][True16][CodeGen] true16 codegen for bswap (#122849)
broxigarchen Jan 17, 2025
a18f4bd
[AMDGPU][True16][MC] true16 for v_cmpx_lt_f16 (#122936)
broxigarchen Jan 17, 2025
8ae1cb2
add power function to APInt (#122788)
ImanHosseini Jan 17, 2025
7656902
[X86] Fold (v4i32 (scalar_to_vector (i32 (anyext (bitcast (f16)))))) …
RKSimon Jan 17, 2025
a4d45fe
[lldb][DWARF] Change GetAttributes parameter from SmallVector to Smal…
Michael137 Jan 17, 2025
edf3a55
[LoopVectorize][NFC] Centralize the setting of CostKind (#121937)
john-brawn-arm Jan 17, 2025
2f853d8
[X86] Regenerate VMOVSH assembly comments. NFC.
RKSimon Jan 17, 2025
123b24f
[X86] avx512fp16-arith.ll - regenerate VPTERNLOG comments
RKSimon Jan 17, 2025
8abbd76
[X86] Regenerate VFPCLASS assembly comments. NFC.
RKSimon Jan 17, 2025
0417cd1
[Clang] FunctionEffects: Correctly navigate through array types in Fu…
dougsonos Jan 17, 2025
63b0ab8
remove extra ; (#123352)
ImanHosseini Jan 17, 2025
ba44d7b
[MLIR][test] Fixup for checking for ml_dtypes (#123240)
kwk Jan 17, 2025
7c72941
[llvm][DebugInfo] Attach object-pointer to DISubprogram declarations …
Michael137 Jan 17, 2025
c9f72b2
[MLIR][LLVM] Fix #llvm.constant_range parsing (#123009)
Kuree Jan 17, 2025
71ad9a9
[fuchsia][cmake] Add runtimes for cortex-m4 for the Fuchsia toolchain…
ilovepi Jan 17, 2025
89305c3
[z/OS] add tail padding to TypeLoc if needed (#122761)
perry-ca Jan 17, 2025
9f627cf
[libc][docs] Add sys/time page to the status of implementations docs …
StarOne01 Jan 17, 2025
3f07af9
[AST] Migrate away from PointerUnion::dyn_cast (NFC) (#123283)
kazutakahirata Jan 17, 2025
f5736ae
[Sema] Migrate away from PointerUnion::dyn_cast (NFC) (#123284)
kazutakahirata Jan 17, 2025
d5ef2c0
[AST] Avoid repeated hash lookups (NFC) (#123285)
kazutakahirata Jan 17, 2025
d5aa6df
[Analysis] Avoid repeated hash lookups (NFC) (#123286)
kazutakahirata Jan 17, 2025
c531255
[CodeGen] Avoid repeated hash lookups (NFC) (#123287)
kazutakahirata Jan 17, 2025
f719771
Revert "[AArch64] Combine and and lsl into ubfiz" (#123356)
c-rhodes Jan 17, 2025
d54d8d7
[libc][docs] Add termios page to the status of implementations docs (…
StarOne01 Jan 17, 2025
c83e5e8
[libc++] Enable _LIBCPP_NODEBUG again (#123318)
philnik777 Jan 17, 2025
4b692a9
[SPIRV] Expand RWBuffer load and store from HLSL (#122355)
s-perron Jan 17, 2025
ee1c852
[DebugInfo][InstrRef] Treat ORRWrr as a copy instr (#123102)
rastogishubham Jan 17, 2025
3065cf2
[bazel] Remove //clang:basic_internal_headers target (NFC) (#123230)
slackito Jan 17, 2025
ebfdd38
[SLP][NFC]Replace undef with constant zero in tests, NFC
alexey-bataev Jan 17, 2025
c7ea4c1
[clang][bytecode] Revisit global variables separately (#123358)
tbaederr Jan 17, 2025
8815c50
[MLIR] Allow setting call stack limit for SourceMgrDiagnosticHandler …
JoelWee Jan 17, 2025
fbea21a
[AMDGPU] Add test for VALU hoisiting from WWM region. NFC. (#123234)
rampitec Jan 17, 2025
f12e0c9
[libc][docs] Add sys/stat page to the status of implementations docs …
StarOne01 Jan 17, 2025
1c3c655
[lld-macho] Document '-icf' flag options (#123372)
alx32 Jan 17, 2025
2dc5682
Verifier: Add check for DICompositeType elements being null
dwblaikie Jan 17, 2025
bbd871e
[libc++] Don't implement <stdatomic.h> before C++23 (#123130)
ldionne Jan 17, 2025
58a70df
[msan] Add debugging for handleUnknownIntrinsic (#123381)
thurstond Jan 17, 2025
6716ce8
Revert "Verifier: Add check for DICompositeType elements being null"
dwblaikie Jan 17, 2025
eddeb36
[SPIRV] add pre legalization instruction combine (#122839)
farzonl Jan 17, 2025
fec503d
[SLP][NFC]Add safe createExtractVector and use instead Builder.Create…
alexey-bataev Jan 17, 2025
10fdd09
[clang][DebugInfo] Emit DW_AT_object_pointer on function declarations…
Michael137 Jan 17, 2025
128e2e4
[SandboxVec][VecUtils][NFC] Move functions to VecUtils.cpp and add a …
Jan 17, 2025
6b048ae
[LLDB] Add SBProgress so Python scripts can also report progress (#11…
Jlalond Jan 17, 2025
a807b2f
[gn build] Port 128e2e446e90
llvmgnsyncbot Jan 17, 2025
580ba2e
[gn build] Port 6b048aeaf837
llvmgnsyncbot Jan 17, 2025
71ff486
Reland "[flang] Inline hlfir.dot_product. (#123143)" (#123385)
vzakhari Jan 17, 2025
ce6e66d
[RISCV] Add coverage for an upcoming select lowering change
preames Jan 17, 2025
5a735a2
[HLSL][Sema] Fixed Diagnostics that assumed only two arguments (#122772)
farzonl Jan 17, 2025
e237e37
[libc] Fix riscv32 Block assertion failure on #117815
mysterymath Jan 17, 2025
dce5d1f
[FMV][GlobalOpt] Do not statically resolve non-FMV callers. (#123383)
labrinea Jan 17, 2025
7b3a353
[mlir][spirv] Add common SPIRV Extended Ops for Vectors (#122322)
mishaobu Jan 17, 2025
e5a28a3
[mlir][spirv] Add MatrixTimesVector Op (#122302)
mishaobu Jan 17, 2025
b1bf95c
ReduxWidth check for 0 (#123257)
gchaltas Jan 17, 2025
078dfd8
[RISCV] Fix variable naming in recently pre-committed test
preames Jan 17, 2025
8b0c774
[lld][InstrProf][NFC] Fix typo in help message (#123390)
ellishg Jan 17, 2025
5db2867
[libc] Fix malloc riscv32 test failures from #117815
mysterymath Jan 17, 2025
a440c3e
[libc] Correct previous malloc fix
mysterymath Jan 17, 2025
98067a3
[libc] Outer size, not inner size
mysterymath Jan 17, 2025
8f18f36
[lldb] Skip unreliable test under ASAN
adrian-prantl Jan 17, 2025
04383d6
[Static analysis] Encodes a filename before inserting it into a URL. …
rniwa Jan 17, 2025
d6315af
[SandboxVec][InstrMaps] EraseInstr callback (#123256)
Jan 17, 2025
ae932be
[clang][Sema] Upstream HeuristicResolver from clangd (#121314)
HighCommander4 Jan 17, 2025
358d654
[SandboxVectorizer] Fix a warning
kazutakahirata Jan 17, 2025
18eec97
[gn build] Port ae932becb2c9
llvmgnsyncbot Jan 17, 2025
65cd9e4
[VPlan] Make VPValue constructors protected. (NFC)
fhahn Jan 17, 2025
0c6e03e
[RISCV] Fold vp.store(vp.reverse(VAL), ADDR, MASK) -> vp.strided.stor…
topperc Jan 17, 2025
2523d3b
[flang][cuda] Perform scalar assignment of c_devptr inlined (#123407)
clementval Jan 17, 2025
22d4ff1
[SandboxIR] Fix CmpInst::create() when it gets folded (#123408)
Jan 17, 2025
87e4b68
[SandboxVec][Legality] Implement ShuffleMask (#123404)
Jan 17, 2025
9fdc38c
[WebAssembly][Object] Support more elem segment flags (#123427)
dschuff Jan 18, 2025
5b6a26c
Add option to print entire function instead of just the loops for loo…
akshayrdeodhar Jan 18, 2025
07d4965
[SLP] Replace MainOp and AltOp in TreeEntry with InstructionsState. (…
HanKuanChen Jan 18, 2025
143c33c
[RISCV] Consider only legally typed splats to be legal shuffles (#123…
preames Jan 18, 2025
a7bca18
[clang-format] Correctly annotate braces in macro definitions (#123279)
owenca Jan 18, 2025
b62e558
[lldb][test] Remove compiler version check and use regex (#123393)
kusmour Jan 18, 2025
e240261
[clang-format] Fix option `BreakBinaryOperations` for operator `>>` (…
andergnet Jan 18, 2025
ef04755
[AutoBump] Merge with fixes of d28a4f1f (Jan 17)
jorickert Mar 20, 2025
c11d5c0
[AutoBump] Merge with e2402615 (Jan 17)
jorickert Mar 20, 2025
161b5c6
Merge pull request #523 from Xilinx/bump_to_e2402615
jorickert Apr 14, 2025
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
  •  
  •  
  •  
95 changes: 64 additions & 31 deletions clang-tools-extra/clang-tidy/modernize/RawStringLiteralCheck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
#include "RawStringLiteralCheck.h"
#include "clang/AST/ASTContext.h"
#include "clang/ASTMatchers/ASTMatchFinder.h"
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Lex/Lexer.h"
#include "llvm/ADT/StringRef.h"
#include <optional>

using namespace clang::ast_matchers;

Expand Down Expand Up @@ -66,20 +70,6 @@ bool containsDelimiter(StringRef Bytes, const std::string &Delimiter) {
: (")" + Delimiter + R"(")")) != StringRef::npos;
}

std::string asRawStringLiteral(const StringLiteral *Literal,
const std::string &DelimiterStem) {
const StringRef Bytes = Literal->getBytes();
std::string Delimiter;
for (int I = 0; containsDelimiter(Bytes, Delimiter); ++I) {
Delimiter = (I == 0) ? DelimiterStem : DelimiterStem + std::to_string(I);
}

if (Delimiter.empty())
return (R"(R"()" + Bytes + R"lit()")lit").str();

return (R"(R")" + Delimiter + "(" + Bytes + ")" + Delimiter + R"(")").str();
}

} // namespace

RawStringLiteralCheck::RawStringLiteralCheck(StringRef Name,
Expand Down Expand Up @@ -119,30 +109,73 @@ void RawStringLiteralCheck::registerMatchers(MatchFinder *Finder) {
stringLiteral(unless(hasParent(predefinedExpr()))).bind("lit"), this);
}

static std::optional<StringRef>
createUserDefinedSuffix(const StringLiteral *Literal, const SourceManager &SM,
const LangOptions &LangOpts) {
const CharSourceRange TokenRange =
CharSourceRange::getTokenRange(Literal->getSourceRange());
Token T;
if (Lexer::getRawToken(Literal->getBeginLoc(), T, SM, LangOpts))
return std::nullopt;
const CharSourceRange CharRange =
Lexer::makeFileCharRange(TokenRange, SM, LangOpts);
if (T.hasUDSuffix()) {
StringRef Text = Lexer::getSourceText(CharRange, SM, LangOpts);
const size_t UDSuffixPos = Text.find_last_of('"');
if (UDSuffixPos == StringRef::npos)
return std::nullopt;
return Text.slice(UDSuffixPos + 1, Text.size());
}
return std::nullopt;
}

static std::string createRawStringLiteral(const StringLiteral *Literal,
const std::string &DelimiterStem,
const SourceManager &SM,
const LangOptions &LangOpts) {
const StringRef Bytes = Literal->getBytes();
std::string Delimiter;
for (int I = 0; containsDelimiter(Bytes, Delimiter); ++I) {
Delimiter = (I == 0) ? DelimiterStem : DelimiterStem + std::to_string(I);
}

std::optional<StringRef> UserDefinedSuffix =
createUserDefinedSuffix(Literal, SM, LangOpts);

if (Delimiter.empty())
return (R"(R"()" + Bytes + R"lit()")lit" + UserDefinedSuffix.value_or(""))
.str();

return (R"(R")" + Delimiter + "(" + Bytes + ")" + Delimiter + R"(")" +
UserDefinedSuffix.value_or(""))
.str();
}

static bool compareStringLength(StringRef Replacement,
const StringLiteral *Literal,
const SourceManager &SM,
const LangOptions &LangOpts) {
return Replacement.size() <=
Lexer::MeasureTokenLength(Literal->getBeginLoc(), SM, LangOpts);
}

void RawStringLiteralCheck::check(const MatchFinder::MatchResult &Result) {
const auto *Literal = Result.Nodes.getNodeAs<StringLiteral>("lit");
if (Literal->getBeginLoc().isMacroID())
return;

const SourceManager &SM = *Result.SourceManager;
const LangOptions &LangOpts = getLangOpts();
if (containsEscapedCharacters(Result, Literal, DisallowedChars)) {
std::string Replacement = asRawStringLiteral(Literal, DelimiterStem);
const std::string Replacement =
createRawStringLiteral(Literal, DelimiterStem, SM, LangOpts);
if (ReplaceShorterLiterals ||
Replacement.length() <=
Lexer::MeasureTokenLength(Literal->getBeginLoc(),
*Result.SourceManager, getLangOpts()))
replaceWithRawStringLiteral(Result, Literal, Replacement);
compareStringLength(Replacement, Literal, SM, LangOpts)) {
diag(Literal->getBeginLoc(),
"escaped string literal can be written as a raw string literal")
<< FixItHint::CreateReplacement(Literal->getSourceRange(),
Replacement);
}
}
}

void RawStringLiteralCheck::replaceWithRawStringLiteral(
const MatchFinder::MatchResult &Result, const StringLiteral *Literal,
StringRef Replacement) {
CharSourceRange CharRange = Lexer::makeFileCharRange(
CharSourceRange::getTokenRange(Literal->getSourceRange()),
*Result.SourceManager, getLangOpts());
diag(Literal->getBeginLoc(),
"escaped string literal can be written as a raw string literal")
<< FixItHint::CreateReplacement(CharRange, Replacement);
}

} // namespace clang::tidy::modernize
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ class RawStringLiteralCheck : public ClangTidyCheck {
void check(const ast_matchers::MatchFinder::MatchResult &Result) override;

private:
void replaceWithRawStringLiteral(
const ast_matchers::MatchFinder::MatchResult &Result,
const StringLiteral *Literal, StringRef Replacement);

std::string DelimiterStem;
CharsBitSet DisallowedChars;
const bool ReplaceShorterLiterals;
Expand Down
1 change: 0 additions & 1 deletion clang-tools-extra/clangd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ add_clang_library(clangDaemon STATIC
GlobalCompilationDatabase.cpp
Headers.cpp
HeaderSourceSwitch.cpp
HeuristicResolver.cpp
Hover.cpp
IncludeCleaner.cpp
IncludeFixer.cpp
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/FindTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "FindTarget.h"
#include "AST.h"
#include "HeuristicResolver.h"
#include "support/Logger.h"
#include "clang/AST/ASTConcept.h"
#include "clang/AST/ASTTypeTraits.h"
Expand All @@ -35,6 +34,7 @@
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/Specifiers.h"
#include "clang/Sema/HeuristicResolver.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringExtras.h"
Expand Down
4 changes: 3 additions & 1 deletion clang-tools-extra/clangd/FindTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
#include <bitset>

namespace clang {
namespace clangd {

class HeuristicResolver;

namespace clangd {

/// Describes the link between an AST node and a Decl it refers to.
enum class DeclRelation : unsigned;
/// A bitfield of DeclRelations.
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/InlayHints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "../clang-tidy/utils/DesignatedInitializers.h"
#include "AST.h"
#include "Config.h"
#include "HeuristicResolver.h"
#include "ParsedAST.h"
#include "Protocol.h"
#include "SourceCode.h"
Expand All @@ -27,6 +26,7 @@
#include "clang/Basic/OperatorKinds.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Sema/HeuristicResolver.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/ParsedAST.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "Feature.h"
#include "FeatureModule.h"
#include "Headers.h"
#include "HeuristicResolver.h"
#include "IncludeCleaner.h"
#include "IncludeFixer.h"
#include "Preamble.h"
Expand Down Expand Up @@ -53,6 +52,7 @@
#include "clang/Lex/Lexer.h"
#include "clang/Lex/PPCallbacks.h"
#include "clang/Lex/Preprocessor.h"
#include "clang/Sema/HeuristicResolver.h"
#include "clang/Serialization/ASTWriter.h"
#include "clang/Tooling/CompilationDatabase.h"
#include "clang/Tooling/Core/Diagnostic.h"
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/ParsedAST.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@
#include <vector>

namespace clang {
class HeuristicResolver;
class Sema;
namespace clangd {
class HeuristicResolver;

/// Stores and provides access to parsed AST.
class ParsedAST {
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/SemanticHighlighting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "SemanticHighlighting.h"
#include "Config.h"
#include "FindTarget.h"
#include "HeuristicResolver.h"
#include "ParsedAST.h"
#include "Protocol.h"
#include "SourceCode.h"
Expand All @@ -27,6 +26,7 @@
#include "clang/Basic/LangOptions.h"
#include "clang/Basic/SourceLocation.h"
#include "clang/Basic/SourceManager.h"
#include "clang/Sema/HeuristicResolver.h"
#include "clang/Tooling/Syntax/Tokens.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
Expand Down
2 changes: 1 addition & 1 deletion clang-tools-extra/clangd/XRefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "FindSymbols.h"
#include "FindTarget.h"
#include "Headers.h"
#include "HeuristicResolver.h"
#include "IncludeCleaner.h"
#include "ParsedAST.h"
#include "Protocol.h"
Expand Down Expand Up @@ -53,6 +52,7 @@
#include "clang/Index/IndexingOptions.h"
#include "clang/Index/USRGeneration.h"
#include "clang/Lex/Lexer.h"
#include "clang/Sema/HeuristicResolver.h"
#include "clang/Tooling/Syntax/Tokens.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
Expand Down
1 change: 0 additions & 1 deletion clang-tools-extra/clangd/unittests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ add_unittest(ClangdUnitTests ClangdTests
GlobalCompilationDatabaseTests.cpp
HeadersTests.cpp
HeaderSourceSwitchTests.cpp
HeuristicResolverTests.cpp
HoverTests.cpp
IncludeCleanerTests.cpp
IndexActionTests.cpp
Expand Down
4 changes: 4 additions & 0 deletions clang-tools-extra/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,10 @@ Changes in existing checks
a false positive when only an implicit conversion happened inside an
initializer list.

- Improved :doc:`modernize-raw-string-literal
<clang-tidy/checks/modernize/raw-string-literal>` check to fix incorrect
fix-it when the string contains a user-defined suffix.

- Improved :doc:`modernize-use-designated-initializers
<clang-tidy/checks/modernize/use-designated-initializers>` check to fix a
crash when a class is declared but not defined.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,16 @@ void callFn() {
// CHECK-MESSAGES: :[[@LINE-1]]:14: warning: {{.*}} can be written as a raw string literal
// CHECK-FIXES: {{^}} fn<double>(R"(foo\bar)");{{$}}
}

namespace std {
using size_t = decltype(sizeof(0));
namespace ud {
int operator""_abc(const char *str, std::size_t len);
} // namespace ud
} // namespace std
namespace gh97243 {
using namespace std::ud;
auto UserDefinedLiteral = "foo\\bar"_abc;
// CHECK-MESSAGES: :[[@LINE-1]]:27: warning: {{.*}} can be written as a raw string literal
// CHECK-FIXES: {{^}}auto UserDefinedLiteral = R"(foo\bar)"_abc;
} // namespace gh97243
2 changes: 1 addition & 1 deletion clang/cmake/caches/Fuchsia-stage2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ if(FUCHSIA_SDK)
set(LLVM_RUNTIME_MULTILIB_hwasan+noexcept_TARGETS "aarch64-unknown-fuchsia;riscv64-unknown-fuchsia" CACHE STRING "")
endif()

foreach(target armv6m-none-eabi;armv7m-none-eabi;armv8m.main-none-eabi;armv8.1m.main-none-eabi;aarch64-none-elf)
foreach(target armv6m-none-eabi;armv7m-none-eabi;armv7em-none-eabi;armv8m.main-none-eabi;armv8.1m.main-none-eabi;aarch64-none-elf)
list(APPEND BUILTIN_TARGETS "${target}")
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME Generic CACHE STRING "")
set(BUILTINS_${target}_CMAKE_SYSTEM_PROCESSOR arm CACHE STRING "")
Expand Down
7 changes: 7 additions & 0 deletions clang/include/clang/AST/ASTContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -1726,6 +1726,13 @@ class ASTContext : public RefCountedBase<ASTContext> {

QualType getEnumType(const EnumDecl *Decl) const;

/// Compute BestType and BestPromotionType for an enum based on the highest
/// number of negative and positive bits of its elements.
/// Returns true if enum width is too large.
bool computeBestEnumTypes(bool IsPacked, unsigned NumNegativeBits,
unsigned NumPositiveBits, QualType &BestType,
QualType &BestPromotionType);

QualType
getUnresolvedUsingType(const UnresolvedUsingTypenameDecl *Decl) const;

Expand Down
11 changes: 7 additions & 4 deletions clang/include/clang/AST/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -8841,13 +8841,16 @@ void FixedPointValueToString(SmallVectorImpl<char> &Str, llvm::APSInt Val,
unsigned Scale);

inline FunctionEffectsRef FunctionEffectsRef::get(QualType QT) {
const Type *TypePtr = QT.getTypePtr();
while (true) {
QualType Pointee = QT->getPointeeType();
if (Pointee.isNull())
if (QualType Pointee = TypePtr->getPointeeType(); !Pointee.isNull())
TypePtr = Pointee.getTypePtr();
else if (TypePtr->isArrayType())
TypePtr = TypePtr->getBaseElementTypeUnsafe();
else
break;
QT = Pointee;
}
if (const auto *FPT = QT->getAs<FunctionProtoType>())
if (const auto *FPT = TypePtr->getAs<FunctionProtoType>())
return FPT->getFunctionEffects();
return {};
}
Expand Down
1 change: 1 addition & 0 deletions clang/include/clang/AST/TypeLoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ class ConcreteTypeLoc : public Base {
unsigned extraAlign = asDerived()->getExtraLocalDataAlignment();
size = llvm::alignTo(size, extraAlign);
size += asDerived()->getExtraLocalDataSize();
size = llvm::alignTo(size, asDerived()->getLocalDataAlignment());
return size;
}

Expand Down
6 changes: 6 additions & 0 deletions clang/include/clang/Basic/BuiltinsSPIRV.td
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ def SPIRVDistance : Builtin {
let Attributes = [NoThrow, Const];
let Prototype = "void(...)";
}

def SPIRVLength : Builtin {
let Spellings = ["__builtin_spirv_length"];
let Attributes = [NoThrow, Const];
let Prototype = "void(...)";
}
8 changes: 4 additions & 4 deletions clang/include/clang/Basic/BuiltinsX86_64.td
Original file line number Diff line number Diff line change
Expand Up @@ -295,8 +295,8 @@ let Features = "amx-complex,amx-transpose", Attributes = [NoThrow] in {

let Features = "amx-avx512,avx10.2-512", Attributes = [NoThrow] in {
def tcvtrowd2ps_internal : X86Builtin<"_Vector<16, float>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
def tcvtrowps2pbf16h_internal : X86Builtin<"_Vector<32, __bf16>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
def tcvtrowps2pbf16l_internal : X86Builtin<"_Vector<32, __bf16>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
def tcvtrowps2bf16h_internal : X86Builtin<"_Vector<32, __bf16>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
def tcvtrowps2bf16l_internal : X86Builtin<"_Vector<32, __bf16>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
def tcvtrowps2phh_internal : X86Builtin<"_Vector<32, _Float16>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
def tcvtrowps2phl_internal : X86Builtin<"_Vector<32, _Float16>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
def tilemovrow_internal : X86Builtin<"_Vector<16, int>(unsigned short, unsigned short, _Vector<256, int>, unsigned int)">;
Expand Down Expand Up @@ -387,8 +387,8 @@ let Features = "amx-complex,amx-transpose", Attributes = [NoThrow] in {

let Features = "amx-avx512,avx10.2-512", Attributes = [NoThrow] in {
def tcvtrowd2ps : X86Builtin<"_Vector<16, float>(_Constant unsigned char, unsigned int)">;
def tcvtrowps2pbf16h : X86Builtin<"_Vector<32, __bf16>(_Constant unsigned char, unsigned int)">;
def tcvtrowps2pbf16l : X86Builtin<"_Vector<32, __bf16>(_Constant unsigned char, unsigned int)">;
def tcvtrowps2bf16h : X86Builtin<"_Vector<32, __bf16>(_Constant unsigned char, unsigned int)">;
def tcvtrowps2bf16l : X86Builtin<"_Vector<32, __bf16>(_Constant unsigned char, unsigned int)">;
def tcvtrowps2phh : X86Builtin<"_Vector<32, _Float16>(_Constant unsigned char, unsigned int)">;
def tcvtrowps2phl : X86Builtin<"_Vector<32, _Float16>(_Constant unsigned char, unsigned int)">;
def tilemovrow : X86Builtin<"_Vector<16, int>(_Constant unsigned char, unsigned int)">;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_HEURISTICRESOLVER_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANGD_HEURISTICRESOLVER_H
#ifndef LLVM_CLANG_SEMA_HEURISTICRESOLVER_H
#define LLVM_CLANG_SEMA_HEURISTICRESOLVER_H

#include "clang/AST/Decl.h"
#include <vector>
Expand All @@ -24,8 +24,6 @@ class NamedDecl;
class Type;
class UnresolvedUsingValueDecl;

namespace clangd {

// This class handles heuristic resolution of declarations and types in template
// code.
//
Expand Down Expand Up @@ -80,7 +78,6 @@ class HeuristicResolver {
ASTContext &Ctx;
};

} // namespace clangd
} // namespace clang

#endif
Loading