File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,10 @@ clang::Decl *getDeclWithExecutableCode(clang::Decl *decl) {
5959} // end anonymous namespace
6060
6161void IRGenModule::emitClangDecl (const clang::Decl *decl) {
62+ // Ignore this decl if we've seen it before.
63+ if (!GlobalClangDecls.insert (decl->getCanonicalDecl ()).second )
64+ return ;
65+
6266 // Fast path for the case where `decl` doesn't contain executable code, so it
6367 // can't reference any other declarations that we would need to emit.
6468 if (getDeclWithExecutableCode (const_cast <clang::Decl *>(decl)) == nullptr ) {
@@ -67,8 +71,6 @@ void IRGenModule::emitClangDecl(const clang::Decl *decl) {
6771 return ;
6872 }
6973
70- if (!GlobalClangDecls.insert (decl->getCanonicalDecl ()).second )
71- return ;
7274 SmallVector<const clang::Decl *, 8 > stack;
7375 stack.push_back (decl);
7476
You can’t perform that action at this time.
0 commit comments