This is an archive of the discontinued LLVM Phabricator instance.

[mlir] On Windows, silence warning on functions definition
ClosedPublic

Authored by aganea on Mar 23 2020, 5:21 PM.

Details

Summary

This fixes the following warnings, where a function is re-defined after it is tagged as "being imported":

D:\llvm-project\mlir\lib\ExecutionEngine\CRunnerUtils.cpp(24,17): warning: 'print_i32' redeclared without 'dllimport' attribute: 'dllexport' attribute added [-Winconsistent-dllimport]
extern "C" void print_i32(int32_t i) { fprintf(stdout, "%" PRId32, i); }
                ^
D:\llvm-project\mlir\include\mlir/ExecutionEngine/CRunnerUtils.h(168,42): note: previous declaration is here
extern "C" MLIR_CRUNNERUTILS_EXPORT void print_i32(int32_t i);
                                         ^

Diff Detail

Event Timeline

aganea created this revision.Mar 23 2020, 5:21 PM
aartbik added inline comments.Mar 23 2020, 5:41 PM
mlir/lib/ExecutionEngine/CRunnerUtils.cpp
24

some whitespace was introduced here by mistake

35

missing newline

aganea updated this revision to Diff 252190.Mar 23 2020, 5:46 PM
aganea marked 2 inline comments as done.

Updated as requested.

Any further comments here? Can I go ahead with this?

nicolasvasilache accepted this revision.Mar 26 2020, 8:22 AM
This revision is now accepted and ready to land.Mar 26 2020, 8:22 AM
This revision was automatically updated to reflect the committed changes.