Skip to content

Commit 30a74a5

Browse files
authored
Merge branch 'main' into users/qinkunbao/spr/nosanitizelistnfi-add-containsprefix-to-remove-duplicated-logics
2 parents b4871cc + f9073e7 commit 30a74a5

File tree

239 files changed

+7143
-4879
lines changed

Some content is hidden

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

239 files changed

+7143
-4879
lines changed

.ci/monolithic-linux.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function at-exit {
3838

3939
ccache --print-stats > artifacts/ccache_stats.txt
4040
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
41-
cp "${BUILD_DIR}"/test-results.*.xml artifacts/
41+
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
4242

4343
# If building fails there will be no results files.
4444
shopt -s nullglob

.ci/monolithic-windows.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function at-exit {
3333
mkdir -p artifacts
3434
sccache --show-stats >> artifacts/sccache_stats.txt
3535
cp "${BUILD_DIR}"/.ninja_log artifacts/.ninja_log
36-
cp "${BUILD_DIR}"/test-results.*.xml artifacts/
36+
cp "${BUILD_DIR}"/test-results.*.xml artifacts/ || :
3737

3838
# If building fails there will be no results files.
3939
shopt -s nullglob

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@ getFunctionPrototype(const FunctionDecl *FuncDecl) {
113113
Stream << " " << ParamDecl->getNameAsString();
114114

115115
// Print default argument if it exists
116-
if (ParamDecl->hasDefaultArg()) {
117-
const Expr *DefaultArg = ParamDecl->getDefaultArg();
118-
if (DefaultArg) {
116+
if (ParamDecl->hasDefaultArg() &&
117+
!ParamDecl->hasUninstantiatedDefaultArg()) {
118+
if (const Expr *DefaultArg = ParamDecl->getDefaultArg()) {
119119
Stream << " = ";
120120
DefaultArg->printPretty(Stream, nullptr, Ctx.getPrintingPolicy());
121121
}

clang/include/clang/Basic/DiagnosticParseKinds.td

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,9 @@ def err_acc_unexpected_directive
14561456
def err_acc_invalid_directive
14571457
: Error<"invalid OpenACC directive %select{%1|'%1 %2'}0">;
14581458
def err_acc_invalid_clause : Error<"invalid OpenACC clause %0">;
1459+
def warn_acc_unsupported_extension_clause
1460+
: Warning<"unsupported OpenACC extension clause %0">,
1461+
InGroup<DiagGroup<"unknown-acc-extension-clause">>;
14591462
def err_acc_missing_directive : Error<"expected OpenACC directive">;
14601463
def err_acc_invalid_open_paren
14611464
: Error<"expected clause-list or newline in OpenACC directive">;

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12952,7 +12952,7 @@ def warn_hlsl_deprecated_register_type_i: Warning<"binding type 'i' ignored. The
1295212952
def err_hlsl_unsupported_register_number : Error<"register number should be an integer">;
1295312953
def err_hlsl_expected_space : Error<"invalid space specifier '%0' used; expected 'space' followed by an integer, like space1">;
1295412954
def err_hlsl_space_on_global_constant : Error<"register space cannot be specified on global constants">;
12955-
def warn_hlsl_implicit_binding : Warning<"resource has implicit register binding">, InGroup<HLSLImplicitBinding>, DefaultError;
12955+
def warn_hlsl_implicit_binding : Warning<"resource has implicit register binding">, InGroup<HLSLImplicitBinding>, DefaultIgnore;
1295612956
def warn_hlsl_packoffset_mix : Warning<"cannot mix packoffset elements with nonpackoffset elements in a cbuffer">,
1295712957
InGroup<HLSLMixPackOffset>;
1295812958
def err_hlsl_packoffset_overlap : Error<"packoffset overlap between %0, %1">;

clang/include/clang/Lex/HLSLRootSignatureTokenKinds.def

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@
5353
#ifndef SHADER_VISIBILITY_ENUM
5454
#define SHADER_VISIBILITY_ENUM(NAME, LIT) ENUM(NAME, LIT)
5555
#endif
56+
#ifndef TEXTURE_ADDRESS_MODE_ENUM
57+
#define TEXTURE_ADDRESS_MODE_ENUM(NAME, LIT) ENUM(NAME, LIT)
58+
#endif
5659

5760
// General Tokens:
5861
TOK(invalid, "invalid identifier")
@@ -102,6 +105,12 @@ KEYWORD(offset)
102105

103106
// StaticSampler Keywords:
104107
KEYWORD(mipLODBias)
108+
KEYWORD(addressU)
109+
KEYWORD(addressV)
110+
KEYWORD(addressW)
111+
KEYWORD(maxAnisotropy)
112+
KEYWORD(minLOD)
113+
KEYWORD(maxLOD)
105114

106115
// Unbounded Enum:
107116
UNBOUNDED_ENUM(unbounded, "unbounded")
@@ -145,6 +154,14 @@ SHADER_VISIBILITY_ENUM(Pixel, "SHADER_VISIBILITY_PIXEL")
145154
SHADER_VISIBILITY_ENUM(Amplification, "SHADER_VISIBILITY_AMPLIFICATION")
146155
SHADER_VISIBILITY_ENUM(Mesh, "SHADER_VISIBILITY_MESH")
147156

157+
// Texture Address Mode Enums:
158+
TEXTURE_ADDRESS_MODE_ENUM(Wrap, "TEXTURE_ADDRESS_WRAP")
159+
TEXTURE_ADDRESS_MODE_ENUM(Mirror, "TEXTURE_ADDRESS_MIRROR")
160+
TEXTURE_ADDRESS_MODE_ENUM(Clamp, "TEXTURE_ADDRESS_CLAMP")
161+
TEXTURE_ADDRESS_MODE_ENUM(Border, "TEXTURE_ADDRESS_BORDER")
162+
TEXTURE_ADDRESS_MODE_ENUM(MirrorOnce, "TEXTURE_ADDRESS_MIRRORONCE")
163+
164+
#undef TEXTURE_ADDRESS_MODE_ENUM
148165
#undef SHADER_VISIBILITY_ENUM
149166
#undef DESCRIPTOR_RANGE_FLAG_ENUM
150167
#undef DESCRIPTOR_RANGE_FLAG_ENUM_OFF

clang/include/clang/Parse/ParseHLSLRootSignature.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ class RootSignatureParser {
112112
struct ParsedStaticSamplerParams {
113113
std::optional<llvm::hlsl::rootsig::Register> Reg;
114114
std::optional<float> MipLODBias;
115+
std::optional<llvm::hlsl::rootsig::TextureAddressMode> AddressU;
116+
std::optional<llvm::hlsl::rootsig::TextureAddressMode> AddressV;
117+
std::optional<llvm::hlsl::rootsig::TextureAddressMode> AddressW;
118+
std::optional<uint32_t> MaxAnisotropy;
119+
std::optional<float> MinLOD;
120+
std::optional<float> MaxLOD;
115121
};
116122
std::optional<ParsedStaticSamplerParams> parseStaticSamplerParams();
117123

@@ -122,6 +128,8 @@ class RootSignatureParser {
122128

123129
/// Parsing methods of various enums
124130
std::optional<llvm::hlsl::rootsig::ShaderVisibility> parseShaderVisibility();
131+
std::optional<llvm::hlsl::rootsig::TextureAddressMode>
132+
parseTextureAddressMode();
125133
std::optional<llvm::hlsl::rootsig::RootDescriptorFlags>
126134
parseRootDescriptorFlags();
127135
std::optional<llvm::hlsl::rootsig::DescriptorRangeFlags>

clang/include/clang/Tooling/DependencyScanning/ModuleDepCollector.h

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -178,25 +178,12 @@ struct ModuleDeps {
178178
/// on, not including transitive dependencies.
179179
std::vector<PrebuiltModuleDep> PrebuiltModuleDeps;
180180

181-
/// This struct contains information about a single dependency.
182-
struct DepInfo {
183-
/// Identifies the dependency.
184-
ModuleID ID;
185-
186-
/// Indicates if the module that has this dependency exports it or not.
187-
bool Exported = false;
188-
189-
bool operator<(const DepInfo &Other) const {
190-
return std::tie(ID, Exported) < std::tie(Other.ID, Other.Exported);
191-
}
192-
};
193-
194-
/// A list of DepsInfo containing information about modules this module
195-
/// directly depends on, not including transitive dependencies.
181+
/// A list of module identifiers this module directly depends on, not
182+
/// including transitive dependencies.
196183
///
197184
/// This may include modules with a different context hash when it can be
198185
/// determined that the differences are benign for this compilation.
199-
std::vector<ModuleDeps::DepInfo> ClangModuleDeps;
186+
std::vector<ModuleID> ClangModuleDeps;
200187

201188
/// The set of libraries or frameworks to link against when
202189
/// an entity from this module is used.
@@ -283,8 +270,7 @@ class ModuleDepCollectorPP final : public PPCallbacks {
283270
llvm::DenseSet<const Module *> &AddedModules);
284271

285272
/// Add discovered module dependency for the given module.
286-
void addOneModuleDep(const Module *M, bool Exported, const ModuleID ID,
287-
ModuleDeps &MD);
273+
void addOneModuleDep(const Module *M, const ModuleID ID, ModuleDeps &MD);
288274
};
289275

290276
/// Collects modular and non-modular dependencies of the main file by attaching
@@ -325,8 +311,6 @@ class ModuleDepCollector final : public DependencyCollector {
325311
const ArrayRef<StringRef> StableDirs;
326312
/// Path to the main source file.
327313
std::string MainFile;
328-
/// Hash identifying the compilation conditions of the current TU.
329-
std::string ContextHash;
330314
/// Non-modular file dependencies. This includes the main source file and
331315
/// textually included header files.
332316
std::vector<std::string> FileDeps;
@@ -366,16 +350,16 @@ class ModuleDepCollector final : public DependencyCollector {
366350

367351
/// Collect module map files for given modules.
368352
llvm::DenseSet<const FileEntry *>
369-
collectModuleMapFiles(ArrayRef<ModuleDeps::DepInfo> ClangModuleDeps) const;
353+
collectModuleMapFiles(ArrayRef<ModuleID> ClangModuleDeps) const;
370354

371355
/// Add module map files to the invocation, if needed.
372356
void addModuleMapFiles(CompilerInvocation &CI,
373-
ArrayRef<ModuleDeps::DepInfo> ClangModuleDeps) const;
357+
ArrayRef<ModuleID> ClangModuleDeps) const;
374358
/// Add module files (pcm) to the invocation, if needed.
375359
void addModuleFiles(CompilerInvocation &CI,
376-
ArrayRef<ModuleDeps::DepInfo> ClangModuleDeps) const;
360+
ArrayRef<ModuleID> ClangModuleDeps) const;
377361
void addModuleFiles(CowCompilerInvocation &CI,
378-
ArrayRef<ModuleDeps::DepInfo> ClangModuleDeps) const;
362+
ArrayRef<ModuleID> ClangModuleDeps) const;
379363

380364
/// Add paths that require looking up outputs to the given dependencies.
381365
void addOutputPaths(CowCompilerInvocation &CI, ModuleDeps &Deps);

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,9 +764,11 @@ static bool interp__builtin_addressof(InterpState &S, CodePtr OpPC,
764764
const InterpFrame *Frame,
765765
const CallExpr *Call) {
766766
assert(Call->getArg(0)->isLValue());
767-
PrimType PtrT = S.getContext().classify(Call->getArg(0)).value_or(PT_Ptr);
767+
[[maybe_unused]] PrimType PtrT =
768+
S.getContext().classify(Call->getArg(0)).value_or(PT_Ptr);
768769
assert(PtrT == PT_Ptr &&
769770
"Unsupported pointer type passed to __builtin_addressof()");
771+
(void)PtrT;
770772
return true;
771773
}
772774

clang/lib/Basic/NoSanitizeList.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ NoSanitizeList::~NoSanitizeList() = default;
2929

3030
bool NoSanitizeList::containsPrefix(SanitizerMask Mask, StringRef Prefix,
3131
StringRef Name, StringRef Category) const {
32-
auto NoSan = SSCL->inSectionBlame(Mask, Prefix, Name, Category);
32+
std::pair<unsigned, unsigned> NoSan = SSCL->inSectionBlame(Mask, Prefix, Name, Category);
3333
if (NoSan == llvm::SpecialCaseList::NotFound)
3434
return false;
35-
auto San = SSCL->inSectionBlame(Mask, Prefix, Name, "sanitize");
35+
std::pair<unsigned, unsigned> San = SSCL->inSectionBlame(Mask, Prefix, Name, "sanitize");
3636
return San == llvm::SpecialCaseList::NotFound || NoSan > San;
3737
}
3838

0 commit comments

Comments
 (0)