Skip to content

Commit baacc73

Browse files
author
Erich Keane
committed
Do Alexey's feedback
1 parent 501e1a5 commit baacc73

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5023,24 +5023,23 @@ bool SYCLIntegrationFooter::emit(raw_ostream &OS) {
50235023
Policy.SuppressTypedefs = true;
50245024
Policy.SuppressUnwrittenScope = true;
50255025

5026-
llvm::SmallVector<const VarDecl *> VisitedSpecConstants;
5026+
llvm::SmallSet<const VarDecl *, 8> VisitedSpecConstants;
50275027

50285028
// Used to uniquely name the 'shim's as we generate the names in each
50295029
// anonymous namespace.
50305030
unsigned ShimCounter = 0;
50315031
for (const VarDecl *VD : SpecConstants) {
50325032
VD = VD->getCanonicalDecl();
50335033

5034-
// Skip if we've already visited this.
5035-
if (llvm::find(VisitedSpecConstants, VD) != VisitedSpecConstants.end())
5036-
continue;
5037-
50385034
// Skip if this isn't a SpecIdType. This can happen if it was a deduced
50395035
// type.
50405036
if (!Util::isSyclSpecIdType(VD->getType().getCanonicalType()))
50415037
continue;
50425038

5043-
// TODO: skip if visited.
5039+
// Skip if we've already visited this.
5040+
if (llvm::find(VisitedSpecConstants, VD) != VisitedSpecConstants.end())
5041+
continue;
5042+
50445043
VisitedSpecConstants.push_back(VD);
50455044
std::string TopShim = EmitSpecIdShims(OS, ShimCounter, VD);
50465045
OS << "__SYCL_INLINE_NAMESPACE(cl) {\n";

0 commit comments

Comments
 (0)