Skip to content

Conversation

@eugeneepshteyn
Copy link
Contributor

@eugeneepshteyn eugeneepshteyn commented Apr 8, 2025

Previously, hostnm extended intrinsic was implemented as proper intrinsic. Since then we found out that some applications use hostnm as external routine via external hostnm. This prevents hostnm from being recognized as an intrinsic. This PR implements hostnm as external routine.

	modified:   flang-rt/lib/runtime/extensions.cpp
	modified:   flang-rt/lib/runtime/extensions.cpp
	modified:   flang/include/flang/Runtime/extensions.h
@llvmbot llvmbot added the flang Flang issues not falling into any other category label Apr 8, 2025
@github-actions
Copy link

github-actions bot commented Apr 8, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

}

int FORTRAN_PROCEDURE_NAME(hostnm)(char *hn, int length) {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a lot easier to read if it wasn't so needlessly stretched out vertically by all these blank lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed some blank lines.

if (status == 0) {
// Find zero terminator and fill the string from the
// zero terminator to the end with spaces
char *str_end = hn + length;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always use braced initialization in the runtime and other modern C++ directories, please.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@eugeneepshteyn eugeneepshteyn requested a review from klausler April 15, 2025 21:07
@eugeneepshteyn eugeneepshteyn merged commit 3428cc9 into llvm:main Apr 15, 2025
6 of 9 checks passed
@eugeneepshteyn eugeneepshteyn deleted the hostnm-c branch April 15, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants