Removed the function that used a lock and varargs
Used the same mechanism as for debug messages
Details
Diff Detail
- Repository
- rOMP OpenMP
Event Timeline
I don't understand this: In the last review you said that we need the complicated FatalMessage and now you are reverting that?!?
I am reimplementing this because it needs an include that may be fragile on some platforms (D51219)
using the #def, I can avoid getting a lock as the whole printing is done in one fprintf
Can you please elaborate on "fragile"? It's in the standard, we can just use that include!
using the #def, I can avoid getting a lock as the whole printing is done in one fprintf
(I suggested this back in https://reviews.llvm.org/D50522#1199469)
libomptarget/src/interface.cpp | ||
---|---|---|
58 | What scenario would result in this. |
Alexey was not happy about adding an include, and we already used the define approach for the debug messages. So we reuse the same functionality that we already used for debug.
Agreed that Johnas suggested it, and given the problem with the include, Alexey urged me to change the code to what we have here.
If you prefer the old code with the added include, we can go back to that. Just trying to make you guys happy.
@ABataev what's wrong with cstdarg?
In the end I don't have a strong opinion here (just a general dislike of too many nasty macros), but in the end it's hard to review a change without any justifaction.
libomptarget/src/private.h | ||
---|---|---|
53 | If anything please use the do { ... } while (0) logic, that's actually a good thing for macros: https://stackoverflow.com/a/1067238 |
libomptarget/src/interface.cpp | ||
---|---|---|
58 | Ravi, its probably unlikely, just wanted it here to cover all cases. |
libomptarget/src/interface.cpp | ||
---|---|---|
59 | The reason I asked is because you have different way of reporting for tgt_disabled and tgt_default. |
Just wanted to exclude some extra dependencies from the code. If you're ok with it, I'm fine too.
libomptarget/src/interface.cpp | ||
---|---|---|
59 | ok, will make default the same way as disabled |
As long as we don't need to change back to the current way of doing things next week, I think I'm also fine with the macro if you think it's better. Please address the inline comment about do { ... } while (0) before committing.
libomptarget/src/private.h | ||
---|---|---|
53 | Ping! |
libomptarget/src/private.h | ||
---|---|---|
53 | do { ... } while (0) wasn't a typo, please see the link.
|
- Merge branch 'unpatched-master' into unpatched-master-target-offload-envvar
- while (0) edit
libomptarget/src/private.h | ||
---|---|---|
53 | changed |
LGTM. One very minor comment inline, I leave it up to you whether you want to make that change - it's more important that we unbreak the build.
libomptarget/src/private.h | ||
---|---|---|
51 | You could probably put _str directly into the string as in FATAL_MESSAGE, but I don't think this makes a difference. |
libomptarget/src/interface.cpp | ||
---|---|---|
23 | Fun fact: We include stdarg.h here. I'll remove this as it shouldn't be needed anymore. |
libomptarget/src/interface.cpp | ||
---|---|---|
23 | Done in r341563. |
Fun fact: We include stdarg.h here. I'll remove this as it shouldn't be needed anymore.