Skip to content

Commit

Permalink
Merge pull request #13403 from dlongnecke-cray/mli-fix-unsupported-ty…
Browse files Browse the repository at this point in the history
…pe-errors

Skip standard modules when generating MLL wrappers

This PR will resolve #13394.

Standard modules export functions with types that multi-locale
libraries are not ready to support yet. This PR causes the code
generation for exported functions in multi-locale libraries to skip
over standard modules as well as internal.

In addition, this PR also absorbs changes from closed PR #13393,
since that PR's testing was dependent on this.

Testing:

- [x] interop/C/multilocale on darwin when CHPL_COMM=gasnet
- [x] interop/python/multilocale on darwin when CHPL_COMM=gasnet
- [x] ALL on linux64 when CHPL_COMM=gasnet
- [x] ALL on linux64 when CHPL_COMM=none

Thanks @lydia-duncan for review.
  • Loading branch information
dlongnecke-cray authored Jul 10, 2019
2 parents f29eaeb + 76be303 commit df0561e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions compiler/codegen/mli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ MLIContext::~MLIContext() {
}

bool MLIContext::shouldEmit(ModuleSymbol* md) {
return (md->modTag != MOD_INTERNAL);
return (md->modTag != MOD_INTERNAL &&
md->modTag != MOD_STANDARD);
}

bool MLIContext::shouldEmit(FnSymbol* fn) {
Expand Down Expand Up @@ -435,7 +436,8 @@ std::string MLIContext::genMarshalRoutine(Type* t, bool out) {
} else if (t == dtStringC) {
gen += this->genMarshalBodyStringC(t, out);
} else {
USR_FATAL("Multi-locale libraries do not support type", t);
USR_FATAL(t, "Multi-locale libraries do not support type: %s",
t->name());
}

// If we are unpacking, return our temporary.
Expand Down Expand Up @@ -626,13 +628,17 @@ bool MLIContext::isSupportedType(Type* t) {
void MLIContext::verifyPrototype(FnSymbol* fn) {

if (fn->retType != dtVoid && not isSupportedType(fn->retType)) {
USR_FATAL("Multi-locale libraries do not support type", fn->retType);
Type* t = fn->retType;
USR_FATAL(fn, "Multi-locale libraries do not support return type: %s",
t->name());
}

for (int i = 1; i <= fn->numFormals(); i++) {
ArgSymbol* as = fn->getFormal(i);
if (not this->isSupportedType(as->type)) {
USR_FATAL("Multi-locale libraries do not support type", as->type);
Type* t = as->type;
USR_FATAL(fn, "Multi-locale libraries do not support formal type: %s",
t->name());
}
}

Expand Down

0 comments on commit df0561e

Please sign in to comment.