This is an archive of the discontinued LLVM Phabricator instance.

[OPENMP51] Codegen support for error directive.
ClosedPublic

Authored by jyu2 on Dec 1 2022, 7:40 PM.

Details

Summary

Added codegen for error directive.
Generate IR to call: void __kmpc_error(ident_t *loc, int severity, const char *message);

Diff Detail

Event Timeline

jyu2 created this revision.Dec 1 2022, 7:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2022, 7:40 PM
jyu2 requested review of this revision.Dec 1 2022, 7:40 PM
jdoerfert added inline comments.Dec 1 2022, 8:06 PM
clang/lib/CodeGen/CGOpenMPRuntime.h
335

Why the new argument?

jyu2 added inline comments.Dec 2 2022, 7:58 AM
clang/lib/CodeGen/CGOpenMPRuntime.h
335

Emit error without -g (debug info turn on.)

jyu2 added inline comments.Dec 2 2022, 5:19 PM
clang/lib/CodeGen/CGOpenMPRuntime.h
335

Hi @jdoerfert,
Thanks for your review. I added comment on what meaning of EmitLoc as:

/// \param EmitLoc emit source location with debug-info is off.

Do you mean that is not clear to you? Any suggestion?

Thanks.
Jennifer

jyu2 updated this revision to Diff 481319.Dec 8 2022, 9:10 AM

Rebase

ABataev added inline comments.Dec 8 2022, 10:11 AM
clang/lib/CodeGen/CGOpenMPRuntime.h
335

Why do you need this location? To output it for the user in the runtime library call?

jyu2 added inline comments.Dec 8 2022, 10:47 AM
clang/lib/CodeGen/CGOpenMPRuntime.h
335

Thanks Alexey!
Yes. When run time emit error, the location will be presented like:

OMP: Warning #283: test_error_directive.cpp:6:1: Encountered user-directed warning: 2 or more procs required..

...

This revision is now accepted and ready to land.Dec 8 2022, 10:52 AM
This revision was landed with ongoing or failed builds.Dec 8 2022, 1:22 PM
This revision was automatically updated to reflect the committed changes.