This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Introduce new file wrapper class for runtime
ClosedPublic

Authored by jlpeyton on Dec 3 2020, 1:44 PM.

Details

Summary

Introduce new kmp_safe_file_t class with RAII semantics for file open/close. It is essentially a wrapper around the C-style FILE* object. This also unifies the way we error report if a file can't be opened.

Diff Detail

Event Timeline

jlpeyton created this revision.Dec 3 2020, 1:44 PM
jlpeyton requested review of this revision.Dec 3 2020, 1:44 PM

Really nice cleanup. My only request is more documentation for new code.

openmp/runtime/src/kmp.h
4066

Please include doxygen documentation, at least for non trivial methods and the class. Maybe use "RAII" in the class name to indicate the functionality and make it clear there is no "close" needed at use sites.

jlpeyton updated this revision to Diff 310643.Dec 9 2020, 1:43 PM

Updated with documentation. Class is now kmp_safe_raii_file_t

jdoerfert accepted this revision.Dec 9 2020, 2:59 PM

Thanks!

LGTM, update the commit message wrt. class name.

This revision is now accepted and ready to land.Dec 9 2020, 2:59 PM
This revision was landed with ongoing or failed builds.Dec 15 2020, 12:48 PM
This revision was automatically updated to reflect the committed changes.