Skip to content

Commit a52fdad

Browse files
jaebaeksudonatalie
andauthored
[spirv] Use sequential container for ivars (#4129)
To ensure a deterministic order of the interface variable in OpEntryPoint, use a SetVector to hold them. Fixes #4088 Co-authored-by: Natalie Chouinard <[email protected]>
1 parent e400314 commit a52fdad

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

tools/clang/lib/SPIRV/SpirvEmitter.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include "clang/SPIRV/AstTypeProbe.h"
2121
#include "clang/SPIRV/String.h"
2222
#include "clang/Sema/Sema.h"
23+
#include "llvm/ADT/SetVector.h"
2324
#include "llvm/ADT/StringExtras.h"
2425
#include "InitListHandler.h"
2526
#include "dxc/DXIL/DxilConstants.h"
@@ -622,8 +623,8 @@ SpirvEmitter::getInterfacesForEntryPoint(SpirvFunction *entryPoint) {
622623
// declIdMapper keeps the mapping between variables with Input or Output
623624
// storage class and their storage class, we have to rely on
624625
// declIdMapper.collectStageVars() to collect them.
625-
llvm::DenseSet<SpirvVariable *> interfaces;
626-
interfaces.insert(stageVars.begin(), stageVars.end());
626+
llvm::SetVector<SpirvVariable *> interfaces(stageVars.begin(),
627+
stageVars.end());
627628
for (auto *moduleVar : spvBuilder.getModule()->getVariables()) {
628629
if (moduleVar->getStorageClass() != spv::StorageClass::Input &&
629630
moduleVar->getStorageClass() != spv::StorageClass::Output) {

0 commit comments

Comments
 (0)