Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two issues found in our internal build #5002

Merged
merged 1 commit into from
Feb 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions tools/clang/include/clang/SPIRV/SpirvBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ namespace spirv {
struct StringMapInfo {
static inline std::string getEmptyKey() { return ""; }
static inline std::string getTombstoneKey() { return ""; }
static unsigned getHashValue(const std::string Val) {
static unsigned getHashValue(const std::string& Val) {
return llvm::hash_combine(Val);
}
static bool isEqual(const std::string LHS, const std::string RHS) {
static bool isEqual(const std::string& LHS, const std::string& RHS) {
// Either both are null, or both should have the same underlying type.
return LHS == RHS;
}
Expand Down Expand Up @@ -851,7 +851,7 @@ class SpirvBuilder {
// kept track of separately. This is because the empty string is used
// as the EmptyKey and TombstoneKey for the map, prohibiting insertion
// of the empty string as a contained value.
llvm::DenseMap<llvm::StringRef, SpirvString *, StringMapInfo> stringLiterals;
llvm::DenseMap<std::string, SpirvString *, StringMapInfo> stringLiterals;
SpirvString *emptyString;

/// Mapping of CTBuffers including matrix 1xN with FXC memory layout to their
Expand Down
4 changes: 2 additions & 2 deletions tools/clang/lib/SPIRV/DeclResultIdMapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2095,7 +2095,7 @@ bool DeclResultIdMapper::finalizeStageIOLocations(bool forInput) {
// If alphabetical ordering was requested, sort by semantic string.
if (spirvOptions.stageIoOrder == "alpha") {
// Sort stage input/output variables alphabetically
std::sort(vars.begin(), vars.end(),
std::stable_sort(vars.begin(), vars.end(),
[](const StageVar *a, const StageVar *b) {
return a->getSemanticStr() < b->getSemanticStr();
});
Expand All @@ -2117,7 +2117,7 @@ bool DeclResultIdMapper::finalizeStageIOLocations(bool forInput) {
// alphabetical ordering.
if ((!forInput && spvContext.isHS()) || (forInput && spvContext.isDS())) {
// Sort stage input/output variables alphabetically
std::sort(vars.begin(), vars.end(),
std::stable_sort(vars.begin(), vars.end(),
[](const StageVar *a, const StageVar *b) {
return a->getSemanticStr() < b->getSemanticStr();
});
Expand Down