Skip to content

Commit adf4236

Browse files
Merge branch 'llvm:main' into mcmodel_crash
2 parents 843d4cc + d814824 commit adf4236

File tree

207 files changed

+18377
-8212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

207 files changed

+18377
-8212
lines changed

clang-tools-extra/clang-doc/HTMLGenerator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -964,7 +964,7 @@ HTMLGenerator::generateDocs(StringRef RootDir,
964964
for (const auto &Group : FileToInfos) {
965965
std::error_code FileErr;
966966
llvm::raw_fd_ostream InfoOS(Group.getKey(), FileErr,
967-
llvm::sys::fs::OF_None);
967+
llvm::sys::fs::OF_Text);
968968
if (FileErr) {
969969
return llvm::createStringError(FileErr, "Error opening file '%s'",
970970
Group.getKey().str().c_str());
@@ -1047,7 +1047,7 @@ static llvm::Error serializeIndex(ClangDocContext &CDCtx) {
10471047
llvm::SmallString<128> FilePath;
10481048
llvm::sys::path::native(CDCtx.OutDirectory, FilePath);
10491049
llvm::sys::path::append(FilePath, "index_json.js");
1050-
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_None);
1050+
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_Text);
10511051
if (FileErr != OK) {
10521052
return llvm::createStringError(llvm::inconvertibleErrorCode(),
10531053
"error creating index file: " +
@@ -1108,7 +1108,7 @@ static llvm::Error genIndex(const ClangDocContext &CDCtx) {
11081108
llvm::SmallString<128> IndexPath;
11091109
llvm::sys::path::native(CDCtx.OutDirectory, IndexPath);
11101110
llvm::sys::path::append(IndexPath, "index.html");
1111-
llvm::raw_fd_ostream IndexOS(IndexPath, FileErr, llvm::sys::fs::OF_None);
1111+
llvm::raw_fd_ostream IndexOS(IndexPath, FileErr, llvm::sys::fs::OF_Text);
11121112
if (FileErr != OK) {
11131113
return llvm::createStringError(llvm::inconvertibleErrorCode(),
11141114
"error creating main index: " +

clang-tools-extra/clang-doc/MDGenerator.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ static llvm::Error serializeIndex(ClangDocContext &CDCtx) {
300300
llvm::SmallString<128> FilePath;
301301
llvm::sys::path::native(CDCtx.OutDirectory, FilePath);
302302
llvm::sys::path::append(FilePath, "all_files.md");
303-
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_None);
303+
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_Text);
304304
if (FileErr)
305305
return llvm::createStringError(llvm::inconvertibleErrorCode(),
306306
"error creating index file: " +
@@ -323,7 +323,7 @@ static llvm::Error genIndex(ClangDocContext &CDCtx) {
323323
llvm::SmallString<128> FilePath;
324324
llvm::sys::path::native(CDCtx.OutDirectory, FilePath);
325325
llvm::sys::path::append(FilePath, "index.md");
326-
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_None);
326+
llvm::raw_fd_ostream OS(FilePath, FileErr, llvm::sys::fs::OF_Text);
327327
if (FileErr)
328328
return llvm::createStringError(llvm::inconvertibleErrorCode(),
329329
"error creating index file: " +
@@ -407,7 +407,7 @@ MDGenerator::generateDocs(StringRef RootDir,
407407
for (const auto &Group : FileToInfos) {
408408
std::error_code FileErr;
409409
llvm::raw_fd_ostream InfoOS(Group.getKey(), FileErr,
410-
llvm::sys::fs::OF_None);
410+
llvm::sys::fs::OF_Text);
411411
if (FileErr) {
412412
return llvm::createStringError(FileErr, "Error opening file '%s'",
413413
Group.getKey().str().c_str());

clang-tools-extra/clang-doc/YAMLGenerator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ YAMLGenerator::generateDocs(StringRef RootDir,
347347
}
348348

349349
std::error_code FileErr;
350-
llvm::raw_fd_ostream InfoOS(Path, FileErr, llvm::sys::fs::OF_None);
350+
llvm::raw_fd_ostream InfoOS(Path, FileErr, llvm::sys::fs::OF_Text);
351351
if (FileErr) {
352352
return llvm::createStringError(FileErr, "Error opening file '%s'",
353353
Path.c_str());

clang-tools-extra/clang-include-fixer/FuzzySymbolIndex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ FuzzySymbolIndex::queryRegexp(const std::vector<std::string> &Tokens) {
131131

132132
llvm::Expected<std::unique_ptr<FuzzySymbolIndex>>
133133
FuzzySymbolIndex::createFromYAML(StringRef FilePath) {
134-
auto Buffer = llvm::MemoryBuffer::getFile(FilePath);
134+
auto Buffer = llvm::MemoryBuffer::getFile(FilePath, /*IsText=*/true);
135135
if (!Buffer)
136136
return llvm::errorCodeToError(Buffer.getError());
137137
return std::make_unique<MemSymbolIndex>(

clang-tools-extra/clang-include-fixer/YamlSymbolIndex.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace include_fixer {
2222

2323
llvm::ErrorOr<std::unique_ptr<YamlSymbolIndex>>
2424
YamlSymbolIndex::createFromFile(llvm::StringRef FilePath) {
25-
auto Buffer = llvm::MemoryBuffer::getFile(FilePath);
25+
auto Buffer = llvm::MemoryBuffer::getFile(FilePath, /*IsText=*/true);
2626
if (!Buffer)
2727
return Buffer.getError();
2828

clang-tools-extra/clang-include-fixer/find-all-symbols/tool/FindAllSymbolsMain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ bool Merge(llvm::StringRef MergeDir, llvm::StringRef OutputFile) {
9595
// Parse YAML files in parallel.
9696
Pool.async(
9797
[&AddSymbols](std::string Path) {
98-
auto Buffer = llvm::MemoryBuffer::getFile(Path);
98+
auto Buffer = llvm::MemoryBuffer::getFile(Path, /*IsText=*/true);
9999
if (!Buffer) {
100100
llvm::errs() << "Can't open " << Path << "\n";
101101
return;
@@ -114,7 +114,7 @@ bool Merge(llvm::StringRef MergeDir, llvm::StringRef OutputFile) {
114114
}
115115
}
116116

117-
llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_None);
117+
llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_Text);
118118
if (EC) {
119119
llvm::errs() << "Can't open '" << OutputFile << "': " << EC.message()
120120
<< '\n';

clang-tools-extra/clang-include-fixer/tool/ClangIncludeFixer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ int includeFixerMain(int argc, const char **argv) {
415415
llvm::errs() << llvm::toString(InsertStyle.takeError()) << "\n";
416416
return 1;
417417
}
418-
auto Buffer = llvm::MemoryBuffer::getFile(FilePath);
418+
auto Buffer = llvm::MemoryBuffer::getFile(FilePath, /*IsText=*/true);
419419
if (!Buffer) {
420420
errs() << "Couldn't open file: " + FilePath.str() + ": "
421421
<< Buffer.getError().message() + "\n";

clang/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ Bug Fixes to Compiler Builtins
136136

137137
Bug Fixes to Attribute Support
138138
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
139+
- Fixed crash when a parameter to the ``clang::annotate`` attribute evaluates to ``void``. See #GH119125
139140

140141
Bug Fixes to C++ Support
141142
^^^^^^^^^^^^^^^^^^^^^^^^

clang/include/clang/AST/DeclTemplate.h

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1841,15 +1841,23 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl,
18411841
LLVM_PREFERRED_TYPE(TemplateSpecializationKind)
18421842
unsigned SpecializationKind : 3;
18431843

1844+
/// Indicate that we have matched a parameter pack with a non pack
1845+
/// argument, when the opposite match is also allowed (strict pack match).
1846+
/// This needs to be cached as deduction is performed during declaration,
1847+
/// and we need the information to be preserved so that it is consistent
1848+
/// during instantiation.
1849+
bool MatchedPackOnParmToNonPackOnArg : 1;
1850+
18441851
protected:
18451852
ClassTemplateSpecializationDecl(ASTContext &Context, Kind DK, TagKind TK,
18461853
DeclContext *DC, SourceLocation StartLoc,
18471854
SourceLocation IdLoc,
18481855
ClassTemplateDecl *SpecializedTemplate,
18491856
ArrayRef<TemplateArgument> Args,
1857+
bool MatchedPackOnParmToNonPackOnArg,
18501858
ClassTemplateSpecializationDecl *PrevDecl);
18511859

1852-
explicit ClassTemplateSpecializationDecl(ASTContext &C, Kind DK);
1860+
ClassTemplateSpecializationDecl(ASTContext &C, Kind DK);
18531861

18541862
public:
18551863
friend class ASTDeclReader;
@@ -1859,7 +1867,7 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl,
18591867
Create(ASTContext &Context, TagKind TK, DeclContext *DC,
18601868
SourceLocation StartLoc, SourceLocation IdLoc,
18611869
ClassTemplateDecl *SpecializedTemplate,
1862-
ArrayRef<TemplateArgument> Args,
1870+
ArrayRef<TemplateArgument> Args, bool MatchedPackOnParmToNonPackOnArg,
18631871
ClassTemplateSpecializationDecl *PrevDecl);
18641872
static ClassTemplateSpecializationDecl *CreateDeserialized(ASTContext &C,
18651873
GlobalDeclID ID);
@@ -1930,6 +1938,10 @@ class ClassTemplateSpecializationDecl : public CXXRecordDecl,
19301938
SpecializationKind = TSK;
19311939
}
19321940

1941+
bool hasMatchedPackOnParmToNonPackOnArg() const {
1942+
return MatchedPackOnParmToNonPackOnArg;
1943+
}
1944+
19331945
/// Get the point of instantiation (if any), or null if none.
19341946
SourceLocation getPointOfInstantiation() const {
19351947
return PointOfInstantiation;

clang/include/clang/Basic/BuiltinsX86.td

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<128>] in {
130130
}
131131
}
132132

133-
let Features = "sse", Header = "xmmintrin.h", Attributes = [NoThrow, Const] in {
134-
def _mm_prefetch : X86LibBuiltin<"void(void const *, int)">;
135-
}
136-
137133
// AVX
138134
let Attributes = [Const, NoThrow, RequiredVectorWidth<256>], Features = "avx" in {
139135
foreach Op = ["addsub", "hadd", "hsub", "max", "min"] in {
@@ -142,12 +138,6 @@ let Attributes = [Const, NoThrow, RequiredVectorWidth<256>], Features = "avx" in
142138
}
143139
}
144140

145-
// PRFCHW
146-
let Features = "prfchw", Header = "intrin.h", Attributes = [NoThrow, Const] in {
147-
def _m_prefetch : X86LibBuiltin<"void(void *)">;
148-
def _m_prefetchw : X86LibBuiltin<"void(void volatile const *)">;
149-
}
150-
151141

152142
// Mechanically ported builtins from the original `.def` file.
153143
//
@@ -156,6 +146,10 @@ let Features = "prfchw", Header = "intrin.h", Attributes = [NoThrow, Const] in {
156146
// current formulation is based on what was easiest to recognize from the
157147
// pre-TableGen version.
158148

149+
let Features = "mmx", Attributes = [NoThrow, Const] in {
150+
def _mm_prefetch : X86NoPrefixBuiltin<"void(char const *, int)">;
151+
}
152+
159153
let Features = "sse", Attributes = [NoThrow] in {
160154
def ldmxcsr : X86Builtin<"void(unsigned int)">;
161155
}

0 commit comments

Comments
 (0)