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) {
59
59
} // end anonymous namespace
60
60
61
61
void 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
+
62
66
// Fast path for the case where `decl` doesn't contain executable code, so it
63
67
// can't reference any other declarations that we would need to emit.
64
68
if (getDeclWithExecutableCode (const_cast <clang::Decl *>(decl)) == nullptr ) {
@@ -67,8 +71,6 @@ void IRGenModule::emitClangDecl(const clang::Decl *decl) {
67
71
return ;
68
72
}
69
73
70
- if (!GlobalClangDecls.insert (decl->getCanonicalDecl ()).second )
71
- return ;
72
74
SmallVector<const clang::Decl *, 8 > stack;
73
75
stack.push_back (decl);
74
76
You can’t perform that action at this time.
0 commit comments