Skip to content

Commit ed80508

Browse files
asudarsaKornevNikita
authored andcommitted
Fix some static analyzer issues (#1789)
Signed-off-by: Arvind Sudarsanam <[email protected]> Original commit: KhronosGroup/SPIRV-LLVM-Translator@a8b0c8e
1 parent e8646b9 commit ed80508

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3314,7 +3314,7 @@ void generateIntelFPGAAnnotation(
33143314
Out << "{simple_dual_port:1}";
33153315
if (E->hasDecorate(DecorationMergeINTEL)) {
33163316
Out << "{merge";
3317-
for (auto Str : E->getDecorationStringLiteral(DecorationMergeINTEL))
3317+
for (const auto &Str : E->getDecorationStringLiteral(DecorationMergeINTEL))
33183318
Out << ":" << Str;
33193319
Out << '}';
33203320
}
@@ -3396,8 +3396,8 @@ void generateIntelFPGAAnnotationForStructMember(
33963396
Out << "{simple_dual_port:1}";
33973397
if (E->hasMemberDecorate(DecorationMergeINTEL, 0, MemberNumber)) {
33983398
Out << "{merge";
3399-
for (auto Str : E->getMemberDecorationStringLiteral(DecorationMergeINTEL,
3400-
MemberNumber))
3399+
for (const auto &Str : E->getMemberDecorationStringLiteral(
3400+
DecorationMergeINTEL, MemberNumber))
34013401
Out << ":" << Str;
34023402
Out << '}';
34033403
}

llvm-spirv/lib/SPIRV/libSPIRV/SPIRVModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1810,7 +1810,7 @@ class TopologicalSort {
18101810
for (auto *V : VariableVec)
18111811
EntryStateMap[V] = DFSState::Unvisited;
18121812
// Run topoligical sort
1813-
for (auto ES : EntryStateMap) {
1813+
for (const auto &ES : EntryStateMap) {
18141814
if (visit(ES.first))
18151815
llvm_unreachable("Cyclic dependency for types detected");
18161816
}

0 commit comments

Comments
 (0)