File tree 1 file changed +9
-7
lines changed
1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -1968,15 +1968,17 @@ static void codegen_header(std::set<const char*> & cnames,
1968
1968
if (!info->cfile ) {
1969
1969
#ifdef HAVE_LLVM
1970
1970
// Codegen any type annotations that are necessary.
1971
- // Start with primitive types in case they are referenced by
1972
- // records or classes.
1973
- forv_Vec (TypeSymbol, typeSymbol, gTypeSymbols ) {
1974
- if (typeSymbol->defPoint ->parentExpr == rootModule->block &&
1975
- isPrimitiveType (typeSymbol->type ) &&
1976
- typeSymbol->hasLLVMType ()) {
1977
- typeSymbol->codegenMetadata ();
1971
+ // Start with primitive types and function types in case they are used
1972
+ // by records or classes.
1973
+ forv_Vec (TypeSymbol, ts, gTypeSymbols ) {
1974
+ bool isInRootModule = ts->defPoint ->parentExpr == rootModule->block ;
1975
+ if (isInRootModule && ts->hasLLVMType ()) {
1976
+ if (isPrimitiveType (ts->type ) || isFunctionType (ts->type )) {
1977
+ ts->codegenMetadata ();
1978
+ }
1978
1979
}
1979
1980
}
1981
+
1980
1982
forv_Vec (TypeSymbol, typeSymbol, types) {
1981
1983
if (!isDecoratedClassType (typeSymbol->type ))
1982
1984
typeSymbol->codegenMetadata ();
You can’t perform that action at this time.
0 commit comments